svoid orBitMatrixWithItselfShifted(int dx, int dy, BitMatrix m) { if (dx == 0 && dy == 0); int w = m.getWidth(), h = m.getHeight(); if (dx <= 0 && dy <= 0) { for (int y = -dy; y < h; y++) for (int x = -dx; x < h; x++) if (m.get(x, y)) m.set(x+dx, y+dy, true); } else if (dx <= 0 && dy > 0) { for (int y = 0; y < h-y; y++) for (int x = -dx; x < h; x++) if (m.get(x, y)) m.set(x+dx, y+dy, true); } else if (dx > 0 && dy <= 0) { for (int y = -dy; y < h; y++) for (int x = 0; x < h-dx; x++) if (m.get(x, y)) m.set(x+dx, y+dy, true); } else if (dx > 0 && dy > 0) { for (int y = 0; y < h-dy; y++) for (int x = 0; x < h-dx; x++) if (m.get(x, y)) m.set(x+dx, y+dy, true); } }