org.geotools.image.jai
Class Combine

java.lang.Object
  extended byjavax.media.jai.PlanarImage
      extended byjavax.media.jai.OpImage
          extended byjavax.media.jai.PointOpImage
              extended byorg.geotools.image.jai.Combine
All Implemented Interfaces:
javax.media.jai.ImageJAI, javax.media.jai.PropertyChangeEmitter, javax.media.jai.PropertySource, java.awt.image.RenderedImage, javax.media.jai.WritablePropertySource

public class Combine
extends javax.media.jai.PointOpImage

Computes a set of arbitrary linear combinations of the bands of many rendered source images, using a specified matrix. The matrix size (×) 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
Version:
$Id: Combine.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux, Remi Eve

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

transform

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

Constructor Detail

Combine

public Combine(java.util.Vector images,
               double[][] matrix,
               CombineTransform transform,
               java.awt.RenderingHints hints)
        throws javax.vecmath.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 if none.
hints - The rendering hints.
Throws:
javax.vecmath.MismatchedSizeException - if some rows in the argument doesn't have the expected length.
Method Detail

computeRect

public void computeRect(javax.media.jai.PlanarImage[] images,
                        java.awt.image.WritableRaster dest,
                        java.awt.Rectangle destRect)
Compute one tile.

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


Copyright © GeoTools. All Rights Reserved.