org.geotoolkit.image.jai
Class FloodFill

Object
  extended by PlanarImage
      extended by OpImage
          extended by FloodFill
All Implemented Interfaces:
RenderedImage, ImageJAI, PropertyChangeEmitter, PropertySource, WritablePropertySource

public abstract class FloodFill
extends OpImage

Performs the Flood Fill operation on the given raster.


Algorithm
This class implements a Scan line flood fill algorithm as documented in Wikipedia on June 2009, section Alternative implementations (queue-based) modified as described in Scanline fill section. The algorithm has been modified in order to work properly with tiled images.

Since:
3.01
Version:
3.01
Author:
Martin Desruisseaux (Geomatys)
Module:
coverage/geotk-coverage (download)    View source code for this class
TODO:
This class is abstract for now because not yet implemented as a JAI operation. However the static methods are ready for use.

Field Summary
static String OPERATION_NAME
          The name of this operation in the JAI registry.
 
Fields inherited from class OpImage
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler
 
Fields inherited from class PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
 
Constructor Summary
FloodFill(RenderedImage source, ImageLayout layout, Map<?,?> configuration, double[][] oldValues, double[] newValues)
          Constructs a new Flood Fill for the given image.
 
Method Summary
static void fill(WritableRenderedImage image, Color[] oldColors, Color newColors, Point... points)
          Colors an area of connected pixels with the same set of color.
static void fill(WritableRenderedImage image, double[][] oldValues, double[] newValues, Point... points)
          Colors an area of connected pixels with the same set of color.
 Vector<RenderedImage> getSources()
          Returns the source images.
 
Methods inherited from class OpImage
addTileToCache, cancelTiles, computeRect, computeRect, computesUniqueTiles, computeTile, createTile, dispose, getExpandedNumBands, getFormatTags, getOperationComputeType, getTile, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapDestRect, mapSourcePoint, mapSourceRect, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorize
 
Methods inherited from class PlanarImage
addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, copyData, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, finalize, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, getData, getData, getDefaultColorModel, getExtendedData, getGraphics, getHeight, getImageID, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTiles, getTileWidth, getWidth, overlapsMultipleTiles, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPERATION_NAME

public static final String OPERATION_NAME
The name of this operation in the JAI registry. This is "org.geotoolkit.FloodFill".

See Also:
Constant Field Values
Constructor Detail

FloodFill

public FloodFill(RenderedImage source,
                 ImageLayout layout,
                 Map<?,?> configuration,
                 double[][] oldValues,
                 double[] newValues)
Constructs a new Flood Fill for the given image. While this constructor is public, it should usually not be invoked directly. You should use JAI factory methods instead.

Parameters:
source - The source image.
layout - The image layout.
configuration - The image properties and rendering hints.
oldValues - The old values in the source images.
newValues - The new values in the source images.
Method Detail

getSources

public Vector<RenderedImage> getSources()
Returns the source images.

Specified by:
getSources in interface RenderedImage
Overrides:
getSources in class PlanarImage

fill

public static void fill(WritableRenderedImage image,
                        Color[] oldColors,
                        Color newColors,
                        Point... points)
Colors an area of connected pixels with the same set of color. The fill is performed in place in the given image. The operation is performed immediately; it is not deferred like usual JAI operations.

Parameters:
image - The image in which to colors an area.
oldColors - The colors to replace (usually only 1 color, but more are allowed).
newColors - The new colors replacing the old ones.
points - The coordinate of the starting point. There is usually only one such point, but more are allowed.

fill

public static void fill(WritableRenderedImage image,
                        double[][] oldValues,
                        double[] newValues,
                        Point... points)
Colors an area of connected pixels with the same set of color. The fill is performed in place in the given image. The operation is performed immediately; it is not deferred like usual JAI operations.

Parameters:
image - The image in which to colors an area.
oldValues - The colors to replace (usually only 1 color, but more are allowed).
newValues - The new colors replacing the old ones.
points - The coordinate of the starting point. There is usually only one such point, but more are allowed.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.