Class MaskedConvolveOpImage

  extended by
      extended by
          extended by
              extended by
All Implemented Interfaces:

public class MaskedConvolveOpImage

An operator to perform masked convolution on a source image.

Michael Bedward
See Also:
Description of the algorithm and example

Field Summary
static float KERNEL_TOL
          The tolerance used when marking kernel cells as active (ie.
Fields inherited from class
bottomPadding, extender, leftPadding, rightPadding, topPadding
Fields inherited from class
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler
Fields inherited from class
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
Constructor Summary
MaskedConvolveOpImage(RenderedImage source, extender, Map config, layout, kernel, roi, Boolean maskSrc, Boolean maskDest, Number nilValue, int minCells, Collection<Object> noDataValues, Boolean strictNodata)
          Creates a new instance.
Method Summary
protected  void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)
          Performs convolution on a specified rectangle.
Methods inherited from class
computeTile, getBorderExtender, getBottomPadding, getLeftPadding, getRightPadding, getTopPadding, mapDestRect, mapSourceRect
Methods inherited from class
addTileToCache, cancelTiles, computeRect, computesUniqueTiles, createTile, dispose, getExpandedNumBands, getFormatTags, getOperationComputeType, getTile, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapSourcePoint, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorize
Methods inherited from class
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, getSources, 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 java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


public static final float KERNEL_TOL
The tolerance used when marking kernel cells as active (ie. having a non-zero value that contributes to the convolution result) or inactive. Cells with an absolute value less than this tolerance will be treated as inactive (zero).

See Also:
Constant Field Values
Constructor Detail


public MaskedConvolveOpImage(RenderedImage source,
                             Map config,
                             Boolean maskSrc,
                             Boolean maskDest,
                             Number nilValue,
                             int minCells,
                             Collection<Object> noDataValues,
                             Boolean strictNodata)
Creates a new instance.

source - the source image to convolve
extender - an optional BorderExtender, or null
config - configurable attributes of the image (see AreaOpImage)
layout - an optional ImageLayout specifying destination image parameters, or null
kernel - the convolution kernel
roi - the ROI used to control masking; must contain the source image bounds
maskSrc - if true, exclude masked pixels (roi.contains == false) from convolution kernel calculation
maskDest - if true, do not place kernel over masked pixels (dest will be 0)
nilValue - value to write to the destination image for pixels where there is no convolution result
minCells - the minimum number of non-zero kernel cells that be positioned over unmasked source image cells for convolution to be performed for the target cell
noDataValues - option Collection of values and/or Ranges to treat as NO_DATA
strictNodata - if true no convolution is performed for pixels with any NO_DATA values in their neighbourhood
IllegalArgumentException - if the roi's bounds do not contain the entire source image
Method Detail


protected void computeRect(Raster[] sources,
                           WritableRaster dest,
                           Rectangle destRect)
Performs convolution on a specified rectangle.

computeRect in class
sources - an array of source Rasters, guaranteed to provide all necessary source data for computing the output.
dest - a WritableRaster tile containing the area to be computed.
destRect - the rectangle within dest to be processed.

Copyright © 2009-2013. All Rights Reserved.