org.geotools.image.jai
Class Combine

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

public class Combine
extends PointOpImage

Computes a set of arbitrary linear combinations of the bands of many rendered source images, using a specified matrix. The matrix size (numRows×numColumns) must be equals to the following:

The number of source bands used to determine the matrix dimensions is given by the following code regardless of the type of ColorModel the sources have:

 int sourceBands = 0;
 for (int i=0; i
The extra column in the matrix contains constant values each of which is added to the respective band of the destination. The transformation is therefore defined by the pseudocode:
 // s = source pixel (not all from the same source image)
 // d = destination pixel
 for (int i=0; i
In the special case where there is only one source, this method is equivalent to JAI's "BandCombine" operation.

Since:
2.1
Author:
Martin Desruisseaux (IRD), Remi Eve
Module:
modules/library/coverage (gt-coverage.jar)

Field Summary
protected  CombineTransform transform
          The transform to apply on sample values before the linear combinaison, or null if none.
 
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
Combine(Vector images, double[][] matrix, CombineTransform transform, RenderingHints hints)
          Construct an image with the specified matrix.
 
Method Summary
 void computeRect(PlanarImage[] images, WritableRaster dest, Rectangle destRect)
          Compute one tile.
 
Methods inherited from class PointOpImage
computeTile, dispose, isColormapOperation, mapDestRect, mapSourceRect, permitInPlaceOperation
 
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, 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 Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

transform

protected final CombineTransform transform
The transform to apply on sample values before the linear combinaison, or null if none.

Constructor Detail

Combine

public Combine(Vector images,
               double[][] matrix,
               CombineTransform transform,
               RenderingHints hints)
        throws MismatchedSizeException
Construct an image with the specified matrix.

Parameters:
images - The rendered sources.
matrix - The linear combinaison coefficients as a matrix.
transform - The transform to apply on sample values before the linear combinaison, or null if none.
hints - The rendering hints.
Throws:
MismatchedSizeException - if some rows in the matrix argument doesn't have the expected length.
Method Detail

computeRect

public void computeRect(PlanarImage[] images,
                        WritableRaster dest,
                        Rectangle destRect)
Compute one tile.

Overrides:
computeRect in class OpImage
Parameters:
images - An array of PlanarImage sources.
dest - A WritableRaster to be filled in.
destRect - The Rectangle within the destination to be written.


Copyright © 1996-2010 Geotools. All Rights Reserved.