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 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: MaskedConvolveOpImage.java 1383 2011-02-10 11:22:29Z michael.bedward $
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)
          Constructor
 
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)
Constructor

Parameters:
source - a RenderedImage.
extender - a BorderExtender, or null.
config - configurable attributes of the image (see AreaOpImage)
layout - an ImageLayout optionally containing the tile grid layout, SampleModel, and ColorModel, 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)
Throws:
IllegalArgumentException - if the roi's bounds do not contain the entire source image
See Also:
MaskedConvolveDescriptor
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-2011. All Rights Reserved.