it.geosolutions.jaiext.lookup
Class LookupOpImage

java.lang.Object
  extended by javax.media.jai.PlanarImage
      extended by javax.media.jai.OpImage
          extended by javax.media.jai.PointOpImage
              extended by javax.media.jai.ColormapOpImage
                  extended by it.geosolutions.jaiext.lookup.LookupOpImage
All Implemented Interfaces:
RenderedImage, javax.media.jai.ImageJAI, javax.media.jai.PropertyChangeEmitter, javax.media.jai.PropertySource, javax.media.jai.WritablePropertySource

public class LookupOpImage
extends javax.media.jai.ColormapOpImage

The LookupOpImage class performs the lookup operation on an image with integral data type. This operation consist of passing the input pixels through a lookupTable(an array) of all the JAI data types. The output pixels are calculated from the table values by simply taking the array value associated to the selected index indicated by the input pixel. The table and source data type can be different, and the destination image will have the table data type. Even the band number can be different, in this case the destination image number will depend from the source and table band numbers. If the destination sample model is not the same as that of the table, another one is created from the table. A ROI object passed to the constructor is taken into account by passing to the table the informations extracted from it; an eventual No Data Range is passed to table if present. If No Data or ROI are used, then the destination No Data value is passed to the table. The image calculation is performed by calling the computeRect() method that selects an image tile, a raster containing Roi data if Roi RasterAccessor is used, and then these parameters are passed to the table that executes the lookup operation.


Field Summary
 
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
LookupOpImage(RenderedImage source, javax.media.jai.ImageLayout layout, Map configuration, LookupTable lookupTable, double destinationNoData, javax.media.jai.ROI roi, Range noData, boolean useRoiAccessor)
           
 
Method Summary
protected  void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)
          Performs the table lookup operation within the specified bounds.
protected  void transformColormap(byte[][] colormap)
          Transform the colormap via the lookup table.
 
Methods inherited from class javax.media.jai.ColormapOpImage
initializeColormapOperation, isColormapOperation
 
Methods inherited from class javax.media.jai.PointOpImage
computeTile, dispose, 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
 

Constructor Detail

LookupOpImage

public LookupOpImage(RenderedImage source,
                     javax.media.jai.ImageLayout layout,
                     Map configuration,
                     LookupTable lookupTable,
                     double destinationNoData,
                     javax.media.jai.ROI roi,
                     Range noData,
                     boolean useRoiAccessor)
Method Detail

computeRect

protected void computeRect(Raster[] sources,
                           WritableRaster dest,
                           Rectangle destRect)
Performs the table lookup operation within the specified bounds.

Overrides:
computeRect in class javax.media.jai.OpImage

transformColormap

protected void transformColormap(byte[][] colormap)
Transform the colormap via the lookup table. NoData values are not considered.

Specified by:
transformColormap in class javax.media.jai.ColormapOpImage


Copyright © 2006–2015 GeoSolutions. All rights reserved.