/** * Fills the region connected to the specified start pixel. * A pixel belongs to this region if there is a path between it and the starting * pixel which passes only through pixels of value {@code v} within the range * {@code start_pixel_value - tolerance <= v <= start_pixel_value + tolerance}. * * @param x start pixel x coordinate * * @param y start pixel y coordinate * * @param fillValue the value to write to the destination image for this region * * @return a new {@linkplain FillResult} */ public FillResult fill(int x, int y, int fillValue) { return fill(x, y, fillValue, srcIter.getSampleDouble(x, y, srcBand)); }
@Override public Raster computeTile(int tileX, int tileY) { Rectangle destRect = getTileRect(tileX, tileY); synchronized (computeTileLock) { for (int destY = destRect.y, row = 0; row < destRect.height; destY++, row++) { for (int destX = destRect.x, col = 0; col < destRect.width; destX++, col++) { if (getRegionForPixel(destX, destY) == NO_REGION) { FillResult fill = filler.fill(destX, destY, currentID); regions.put(currentID, new Region(fill)); currentID++; } } } tileComputed[getTileIndex(tileX, tileY)] = true; } return regionImage.getTile(tileX, tileY); }
@Override public Raster computeTile(int tileX, int tileY) { Rectangle destRect = getTileRect(tileX, tileY); synchronized (computeTileLock) { for (int destY = destRect.y, row = 0; row < destRect.height; destY++, row++) { for (int destX = destRect.x, col = 0; col < destRect.width; destX++, col++) { if (getRegionForPixel(destX, destY) == NO_REGION) { FillResult fill = filler.fill(destX, destY, currentID); regions.put(currentID, new Region(fill)); currentID++; } } } tileComputed[getTileIndex(tileX, tileY)] = true; } return regionImage.getTile(tileX, tileY); }