static L floodFillGrid(BitSet grid, int gw, int gh, int g) { new L clips; for (int y = 0; y < gh; y++) for (int x = 0; x < gw; x++) if (grid.get(y*gw+x)) { Rect r = floodFillGrid_step(grid, gw, gh, x, y); r = scaleRect(r, g); clips.add(r); } ret clips; }