org.jaitools.media.jai.maskedconvolve
Class MaskedConvolveOpImage

java.lang.Object
  extended by javax.media.jai.PlanarImage
      extended by javax.media.jai.OpImage
          extended by javax.media.jai.AreaOpImage
              extended by org.jaitools.media.jai.maskedconvolve.MaskedConvolveOpImage
All Implemented Interfaces:
RenderedImage, javax.media.jai.ImageJAI, javax.media.jai.PropertyChangeEmitter, javax.media.jai.PropertySource, javax.media.jai.WritablePropertySource

public class MaskedConvolveOpImage
extends javax.media.jai.AreaOpImage

An operator to perform masked convolution on a source image.

Since:
1.0
Version:
$Id$
Author:
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 javax.media.jai.AreaOpImage
bottomPadding, extender, leftPadding, rightPadding, topPadding
 
Fields inherited from class javax.media.jai.OpImage
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler
 
Fields inherited from class javax.media.jai.PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
 
Constructor Summary
MaskedConvolveOpImage(RenderedImage source, javax.media.jai.BorderExtender extender, Map config, javax.media.jai.ImageLayout layout, javax.media.jai.KernelJAI kernel, javax.media.jai.ROI 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 javax.media.jai.AreaOpImage
computeTile, getBorderExtender, getBottomPadding, getLeftPadding, getRightPadding, getTopPadding, mapDestRect, mapSourceRect
 
Methods inherited from class javax.media.jai.OpImage
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 javax.media.jai.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, 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

KERNEL_TOL

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

MaskedConvolveOpImage

public MaskedConvolveOpImage(RenderedImage source,
                             javax.media.jai.BorderExtender extender,
                             Map config,
                             javax.media.jai.ImageLayout layout,
                             javax.media.jai.KernelJAI kernel,
                             javax.media.jai.ROI roi,
                             Boolean maskSrc,
                             Boolean maskDest,
                             Number nilValue,
                             int minCells,
                             Collection<Object> noDataValues,
                             Boolean strictNodata)
Creates a new instance.

Parameters:
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
Throws:
IllegalArgumentException - if the roi's bounds do not contain the entire source image
Method Detail

computeRect

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

Overrides:
computeRect in class javax.media.jai.OpImage
Parameters:
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.