Class GridCoverage2DRIA
- Object
-
- PlanarImage
-
- OpImage
-
- GeometricOpImage
-
- GridCoverage2DRIA
-
- All Implemented Interfaces:
RenderedImage
,ImageJAI
,PropertyChangeEmitter
,PropertySource
,WritablePropertySource
public class GridCoverage2DRIA extends GeometricOpImage
A RenderedImage that provides values coming from a source GridCoverage2D, with a backing grid addressable as the target GridCoverage2D.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
-
-
Constructor Summary
Constructors Modifier Constructor Description 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.Vector<RenderedImage>
getSources()
Raster
getTile(int tileX, int tileY)
Point2D
mapDestPoint(Point2D destPt, int sourceIndex)
Point2D
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 Detail
-
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 Detail
-
create
public static GridCoverage2DRIA create(GridCoverage2D src, GridGeometry2D dst, double[] nodata)
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
public static GridCoverage2DRIA create(GridCoverage2D src, GridCoverage2D dst, double[] nodata)
-
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
public Raster getTile(int tileX, int tileY)
- Specified by:
getTile
in interfaceRenderedImage
- Overrides:
getTile
in classOpImage
-
mapSourcePoint
public Point2D mapSourcePoint(Point2D srcPt, int sourceIndex)
- Overrides:
mapSourcePoint
in classGeometricOpImage
-
forwardMapRect
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.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
public Point2D mapDestPoint(Point2D destPt, int sourceIndex)
- Overrides:
mapDestPoint
in classGeometricOpImage
-
backwardMapRect
protected 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.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
protected void computeRect(PlanarImage[] sources, WritableRaster dest, Rectangle destRect)
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
public Vector<RenderedImage> getSources()
- Specified by:
getSources
in interfaceRenderedImage
- Overrides:
getSources
in classPlanarImage
-
-