public final class OperationConstOpImage
extends javax.media.jai.ColormapOpImage
OpImage
implementing any operation defined by the AlgebraDescriptor.Operator
enum on an image with a constant value array.
This OpImage
executes the operation on the pixel values of the source image on a per-band basis.
The value of the pixel (x, y) in the destination image is defined as:
for (b = 0; b < numBands; b++) { dst[y][x][b] = op.calculate(src1[y][x][b],const[b]); }
If the result of the operation overflows/underflows the maximum/minimum value supported by the destination image, then it will be clamped to the
maximum/minimum value respectively. The data type byte
is treated as unsigned, with maximum value as 255 and minimum value as 0.
Modifier and Type | Field and Description |
---|---|
static boolean |
ARRAY_CALC
Constant indicating that the inner random iterators must pre-calculate an array of the image positions
|
static boolean |
TILE_CACHED
Constant indicating that the inner random iterators must cache the current tile position
|
Constructor and Description |
---|
OperationConstOpImage(RenderedImage source,
Map config,
javax.media.jai.ImageLayout layout,
AlgebraDescriptor.Operator op,
double[] constants,
javax.media.jai.ROI srcROI,
Range noData,
double destinationNoData)
Constructs an
OperationConstOpImage . |
Modifier and Type | Method and Description |
---|---|
protected void |
computeRect(Raster[] sources,
WritableRaster dest,
Rectangle destRect)
Computes the final pixel from the source image within a specified rectangle.
|
protected void |
transformColormap(byte[][] colormap) |
initializeColormapOperation, isColormapOperation
computeTile, dispose, mapDestRect, mapSourceRect, permitInPlaceOperation
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
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
public static final boolean ARRAY_CALC
public static final boolean TILE_CACHED
public OperationConstOpImage(RenderedImage source, Map config, javax.media.jai.ImageLayout layout, AlgebraDescriptor.Operator op, double[] constants, javax.media.jai.ROI srcROI, Range noData, double destinationNoData)
OperationConstOpImage
.
The layout
parameter may optionally contains the tile grid layout, sample model, and/or color model. The image dimension is
determined by the intersection of the bounding boxes of the two source images.
The image layout of the first source image, source1
, is used as the fall-back for the image layout of the destination image. Any
layout parameters not specified in the layout
argument are set to the same value as that of source1
.
source
- the source imageconfig
- the hintslayout
- The destination image layout.op
- Operation selectedconstants
- the constants values to use during the operationssrcROI
- ROI used for reducing computation AreanoData
- NoData Range used for checking noDatadestinationNoData
- value for replacing the source nodata valuesprotected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)
computeRect
in class javax.media.jai.OpImage
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.protected void transformColormap(byte[][] colormap)
transformColormap
in class javax.media.jai.ColormapOpImage
Copyright © 2006–2015 GeoSolutions. All rights reserved.