Class GridCoverage2DRIA
- All Implemented Interfaces:
RenderedImage
,ImageJAI
,PropertyChangeEmitter
,PropertySource
,WritablePropertySource
The exposed Layout will be the same as the target, and each Point in the target grid can be used in the resulting RenderedImage,
- Author:
- ETj <etj at geo-solutions.it>
-
Field Summary
Fields inherited from class GeometricOpImage
backgroundValues, computableBounds, extender, intBackgroundValues, interp, setBackground
Fields inherited from class OpImage
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler
Fields inherited from class PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GridCoverage2DRIA
(GridCoverage2D src, GridGeometry2D dst, Vector sources, ImageLayout layout, Map configuration, boolean cobbleSources, BorderExtender extender, Interpolation interp, double[] nodata, ROI roi, Hints hints) -
Method Summary
Modifier and TypeMethodDescriptionprotected Rectangle
backwardMapRect
(Rectangle destRect, int sourceIndex) Returns the minimum bounding box of the region of the specified source to which a particularRectangle
of the destination will be mapped.protected void
computeRect
(PlanarImage[] sources, WritableRaster dest, Rectangle destRect) Warps a rectangle.static GridCoverage2DRIA
create
(GridCoverage2D src, GridCoverage2D dst, double[] nodata) static GridCoverage2DRIA
create
(GridCoverage2D src, GridCoverage2D dst, double[] nodata, Hints hints, ROI roi) Wrap the src coverage in the dst layout.static GridCoverage2DRIA
create
(GridCoverage2D src, GridGeometry2D dst, double[] nodata) Wrap the src coverage in the dst layout.static GridCoverage2DRIA
create
(GridCoverage2D src, GridGeometry2D dst, double[] nodata, Hints hints) static GridCoverage2DRIA
create
(GridCoverage2D src, GridGeometry2D dst, double[] nodata, Hints hints, ROI roi) Wrap the src coverage in the dst layout.protected Rectangle
forwardMapRect
(Rectangle pxRect, int sourceIndex) Returns the minimum bounding box of the region of the destination to which a particularRectangle
of the specified source will be mapped.getTile
(int tileX, int tileY) mapDestPoint
(Point2D destPt, int sourceIndex) mapSourcePoint
(Point2D srcPt, int sourceIndex) float[]
warpRect
(int x, int y, int width, int height, float[] destRect) float[]
warpSparseRect
(int x0, int y0, int width, int height, int periodX, int periodY, float[] destRect) Methods inherited from class GeometricOpImage
computeTile, getBorderExtender, getInterpolation, mapDestRect, mapSourceRect
Methods inherited from class OpImage
addTileToCache, cancelTiles, computeRect, computesUniqueTiles, createTile, dispose, getExpandedNumBands, getFormatTags, getOperationComputeType, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorize
Methods inherited from class 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, 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
-
Constructor Details
-
GridCoverage2DRIA
protected GridCoverage2DRIA(GridCoverage2D src, GridGeometry2D dst, Vector sources, ImageLayout layout, Map configuration, boolean cobbleSources, BorderExtender extender, Interpolation interp, double[] nodata, ROI roi, Hints hints)
-
-
Method Details
-
create
Wrap the src coverage in the dst layout.
The resulting RenderedImage will contain the data in src, and will be accessible via the grid specs of dst,- Parameters:
src
- the data coverage to be remapped on dst griddst
- the provider of the final gridnodata
- the nodata value to set for cells not covered by src but included in dst. All bands will share the same nodata value.- Returns:
- an instance of Coverage2RenderedImageAdapter
-
create
-
create
public static GridCoverage2DRIA create(GridCoverage2D src, GridGeometry2D dst, double[] nodata, Hints hints) -
create
public static GridCoverage2DRIA create(GridCoverage2D src, GridGeometry2D dst, double[] nodata, Hints hints, ROI roi) Wrap the src coverage in the dst layout.
The resulting RenderedImage will contain the data in src, and will be accessible via the grid specs of dst,- Parameters:
src
- the data coverage to be remapped on dst griddst
- the provider of the final gridnodata
- the nodata values to set for cells not covered by src but included in dst. All bands will use the related nodata value.hints
- hints to use for the Rendering, Actually only ImageLayout is considered- Returns:
- an instance of Coverage2RenderedImageAdapter
-
create
public static GridCoverage2DRIA create(GridCoverage2D src, GridCoverage2D dst, double[] nodata, Hints hints, ROI roi) Wrap the src coverage in the dst layout.
The resulting RenderedImage will contain the data in src, and will be accessible via the grid specs of dst,- Parameters:
src
- the data coverage to be remapped on dst griddst
- the provider of the final gridnodata
- the nodata values to set for cells not covered by src but included in dst. All bands will use the related nodata value.- Returns:
- an instance of Coverage2RenderedImageAdapter
-
getTile
- Specified by:
getTile
in interfaceRenderedImage
- Overrides:
getTile
in classOpImage
-
mapSourcePoint
- Overrides:
mapSourcePoint
in classGeometricOpImage
-
forwardMapRect
Returns the minimum bounding box of the region of the destination to which a particularRectangle
of the specified source will be mapped.The integral source rectangle coordinates should be considered pixel indices. The "energy" of each pixel is defined to be concentrated in the continuous plane of pixels at an offset of (0.5, 0.5) from the index of the pixel. Forward mappings must take this (0.5, 0.5) pixel center into account. Thus given integral source pixel indices as input, the fractional destination location, as calculated by functions Xf(xSrc, ySrc), Yf(xSrc, ySrc), is given by:
xDst = Xf(xSrc+0.5, ySrc+0.5) - 0.5 yDst = Yf(xSrc+0.5, ySrc+0.5) - 0.5
- Specified by:
forwardMapRect
in classGeometricOpImage
- Parameters:
pxRect
- theRectangle
in source coordinates.sourceIndex
- the index of the source image.- Returns:
- a
Rectangle
indicating the destination bounding box, ornull
if the bounding box is unknown. - Throws:
IllegalArgumentException
- ifsourceIndex
is negative or greater than the index of the last source.IllegalArgumentException
- ifsourceRect
isnull
.
-
mapDestPoint
- Overrides:
mapDestPoint
in classGeometricOpImage
-
backwardMapRect
Returns the minimum bounding box of the region of the specified source to which a particularRectangle
of the destination will be mapped.The integral destination rectangle coordinates should be considered pixel indices. The "energy" of each pixel is defined to be concentrated in the continuous plane of pixels at an offset of (0.5, 0.5) from the index of the pixel. Backward mappings must take this (0.5, 0.5) pixel center into account. Thus given integral destination pixel indices as input, the fractional source location, as calculated by functions Xb(xDst, yDst), Yb(xDst, yDst), is given by:
xSrc = Xb(xDst+0.5, yDst+0.5) - 0.5 ySrc = Yb(xDst+0.5, yDst+0.5) - 0.5
- Specified by:
backwardMapRect
in classGeometricOpImage
- Parameters:
destRect
- theRectangle
in destination coordinates.sourceIndex
- the index of the source image.- Returns:
- a
Rectangle
indicating the source bounding box, ornull
if the bounding box is unknown. - Throws:
IllegalArgumentException
- ifsourceIndex
is negative or greater than the index of the last source.IllegalArgumentException
- ifdestRect
isnull
.
-
computeRect
Warps a rectangle.Offers Improved performance with support for no data and region of interest.
- Overrides:
computeRect
in classOpImage
-
warpRect
public float[] warpRect(int x, int y, int width, int height, float[] destRect) -
warpSparseRect
public float[] warpSparseRect(int x0, int y0, int width, int height, int periodX, int periodY, float[] destRect) - Parameters:
x0
- The minimum X coordinate of the destination region.y0
- The minimum Y coordinate of the destination region.width
- The width of the destination region.height
- The height of the destination region.periodX
- The horizontal sampling period.periodY
- The vertical sampling period.destRect
- Afloat
array containing at least2*((width+periodX-1)/periodX)* ((height+periodY-1)/periodY)
elements, ornull
. Ifnull
, a new array will be constructed.- Returns:
- A reference to the
destRect
parameter if it is non-null
, or a newfloat
array otherwise.
-
getSources
- Specified by:
getSources
in interfaceRenderedImage
- Overrides:
getSources
in classPlanarImage
-