int height = ip.getHeight(); int color = ip.getPixel(x, y); fillLine(ip, x, x, y); int newColor = ip.getPixel(x, y); ip.putPixel(x, y, color); while (ip.getPixel(x2,y)==color && x2<width) x2++; // find end of scan-line x2--; fillLine(ip, x1,x2,y); // fill scan-line boolean inScanLine = false; for (int i=x1; i<=x2; i++) { // find scan-lines above this one
int height = ip.getHeight(); int color = ip.getPixel(x, y); fillLine(ip, x, x, y); int newColor = ip.getPixel(x, y); ip.putPixel(x, y, color); while (ip.getPixel(x2,y)==color && x2<width) x2++; // find end of scan-line x2--; fillLine(ip, x1,x2,y); // fill scan-line boolean inScanLine = false; for (int i=x1; i<=x2; i++) { // find scan-lines above this one