org.geotoolkit.image.jai
Class Mask
Object
PlanarImage
OpImage
PointOpImage
Mask
- All Implemented Interfaces:
- RenderedImage, ImageJAI, PropertyChangeEmitter, PropertySource, WritablePropertySource
public class Mask
- extends PointOpImage
Applies a mask (typically a binary
image) on an source image. For every pixel in the source image there is a choice:
- If the corresponding pixel in the mask is 0, then the source pixel is copied unchanged
to the destination image.
- Otherwise there is a choice:
- If replacement values were explicitly given to this image operation, then those
values are copied to the destination image.
- Otherwise the value from the mask is used as the replacement values.
Example:
- Since:
- 3.00
- Version:
- 3.00
- Author:
- Martin Desruisseaux (Geomatys)
- Module:
| Fields inherited from class PlanarImage |
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width |
| Methods inherited from class OpImage |
addTileToCache, cancelTiles, computeRect, computesUniqueTiles, createTile, getExpandedNumBands, getFormatTags, getOperationComputeType, getTile, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapSourcePoint, 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 |
OPERATION_NAME
public static final String OPERATION_NAME
- The name of this operation in the JAI registry.
This is "org.geotoolkit.Mask".
- See Also:
- Constant Field Values
Mask
public Mask(RenderedImage source,
RenderedImage mask,
ImageLayout layout,
Map<?,?> configuration,
double[] newValues)
- Constructs a new mask 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.mask - The mask. If it has smaller bounds than the source image, then every
pixels outside the mask are treated as if they were zero.layout - The image layout.configuration - The image properties and rendering hints.newValues - The values to copy to the destination images for every masked pixels,
or null for using the mask values. If non-null, then the array
length must be equals to the number of bands in the destination image.
getSources
public Vector<RenderedImage> getSources()
- Returns the source images.
- Specified by:
getSources in interface RenderedImage- Overrides:
getSources in class PlanarImage
computeRect
protected void computeRect(PlanarImage[] sources,
WritableRaster dest,
Rectangle destRect)
- Computes a rectangle of outputs.
- Overrides:
computeRect in class OpImage
- Parameters:
sources - The source images. Should be an array of length 2.dest - The raster to be filled in.destRect - The region within the raster to be filled.
Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.