public class AlgebraOpImage
extends PointOpImage
OpImage
implementing any operation defined by the AlgebraDescriptor.Operator
enum on an image array.
This OpImage
executes the operation on the pixel values of N source images on a per-band basis. In case the N source images have different number of
bands, the number of bands for the destination image is the smaller band number of the N source images. That is
dstNumBands = Math.min(src1NumBands, src2NumBands,...)
. In case the source images have different data types, the data type
for the destination image is the bigger data type of the two source images.
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],src2[y][x][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.
Constructor and Description |
---|
AlgebraOpImage(Map config,
ImageLayout layout,
AlgebraDescriptor.Operator op,
ROI srcROI,
Range noData,
double destinationNoData,
RenderedImage... sources)
Constructs an
AlgebraOpImage . |
Modifier and Type | Method and Description |
---|---|
protected void |
computeRect(Raster[] sources,
WritableRaster dest,
Rectangle destRect)
Computes the final pixel from N source images within a specified rectangle.
|
computeTile, dispose, isColormapOperation, 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 AlgebraOpImage(Map config, ImageLayout layout, AlgebraDescriptor.Operator op, ROI srcROI, Range noData, double destinationNoData, RenderedImage... sources)
AlgebraOpImage
.
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
.
config
- the hintslayout
- The destination image layout.op
- Operation selectedsrcROI
- ROI used for reducing computation AreanoData
- NoData Range used for checking noDatadestinationNoData
- value for replacing the source nodata valuessources
- Array of Sourcesprotected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)
computeRect
in class 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.Copyright © 2006–2018 GeoSolutions. All rights reserved.