it.geosolutions.jaiext.rescale
Class RescaleOpImage

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

public class RescaleOpImage
extends javax.media.jai.PointOpImage

This class is used for rescaling the source image pixels with the given scale and offset factors. At the instantiation time this class checks if the input parameters are suitable for the Rescale operation. If the image data type is Byte, the rescale operation on every pixel value is pre-calculated and stored inside a byte array and the rescaling is effectively a simple lookup operation. For the other data types the Rescale operation is performed at runtime. The rescale operation is executed for each tile independently. If input ROI or NoData values are founded, then they are not rescaled, but the input destination No Data value is returned.


Field Summary
protected static javax.media.jai.BorderExtender ROI_EXTENDER
          ROI extender
 
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
RescaleOpImage(RenderedImage source, javax.media.jai.ImageLayout layout, Map configuration, double[] valueScale, double[] valueOffsets, double destinationNoData, javax.media.jai.ROI roi, Range noData, boolean useROIAccessor)
           
 
Method Summary
protected  void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)
          Rescales to the pixel values within a specified rectangle.
 
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

ROI_EXTENDER

protected static final javax.media.jai.BorderExtender ROI_EXTENDER
ROI extender

Constructor Detail

RescaleOpImage

public RescaleOpImage(RenderedImage source,
                      javax.media.jai.ImageLayout layout,
                      Map configuration,
                      double[] valueScale,
                      double[] valueOffsets,
                      double destinationNoData,
                      javax.media.jai.ROI roi,
                      Range noData,
                      boolean useROIAccessor)
Method Detail

computeRect

protected void computeRect(Raster[] sources,
                           WritableRaster dest,
                           Rectangle destRect)
Rescales to the pixel values within a specified rectangle.

Overrides:
computeRect in class javax.media.jai.OpImage
Parameters:
sources - Cobbled sources, guaranteed to provide all the source data necessary for computing the rectangle.
dest - The tile containing the rectangle to be computed.
destRect - The rectangle within the tile to be computed.


Copyright © 2006–2014 GeoSolutions. All rights reserved.