Package org.esa.snap.core.image
Class RasterDataNodeOpImage
- java.lang.Object
-
- javax.media.jai.PlanarImage
-
- javax.media.jai.OpImage
-
- javax.media.jai.SourcelessOpImage
-
- org.esa.snap.core.image.SingleBandedOpImage
-
- org.esa.snap.core.image.RasterDataNodeOpImage
-
- All Implemented Interfaces:
RenderedImage
,javax.media.jai.ImageJAI
,javax.media.jai.PropertyChangeEmitter
,javax.media.jai.PropertySource
,javax.media.jai.WritablePropertySource
- Direct Known Subclasses:
BandOpImage
,RasterDataNodeSampleOpImage
,TiePointGridOpImage
public abstract class RasterDataNodeOpImage extends SingleBandedOpImage
A base class forOpImage
s acting as source image for aRasterDataNode
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RasterDataNodeOpImage(RasterDataNode rasterDataNode, ResolutionLevel level)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
computeProductData(ProductData productData, Rectangle region)
Computes the target pixel data for this level image.protected void
computeRect(javax.media.jai.PlanarImage[] sourceImages, WritableRaster tile, Rectangle destRect)
protected static void
copyLine(int y, int destWidth, ProductData src, ProductData dest, int[] sourceCoords)
protected ProductData
getGeophysicalProductData(RasterDataNode band, Rectangle region)
Utility method that allows to retrieve data from a raster data node whose geophysical image shares the same multi-level model (aka image pyramid model).RasterDataNode
getRasterDataNode()
protected ProductData
getRawProductData(RasterDataNode band, Rectangle region)
Utility method that allows to retrieve data from a raster data node whose source image shares the same multi-level model (aka image pyramid model).protected int[]
getSourceCoords(int sourceLength, int targetLength)
Utility method which computes source (offset) coordinates for a given source and target lengths.String
toString()
-
Methods inherited from class org.esa.snap.core.image.SingleBandedOpImage
computeRect, createNoDataRaster, getLevel, getLevelImageSupport, getScale, getSourceCoord, getSourceHeight, getSourceWidth, getSourceX, getSourceY
-
Methods inherited from class javax.media.jai.SourcelessOpImage
computesUniqueTiles, computeTile, mapDestRect, mapSourceRect
-
Methods inherited from class javax.media.jai.OpImage
addTileToCache, cancelTiles, createTile, dispose, 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, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
-
-
-
-
Constructor Detail
-
RasterDataNodeOpImage
protected RasterDataNodeOpImage(RasterDataNode rasterDataNode, ResolutionLevel level)
Constructor.- Parameters:
rasterDataNode
- The target raster data node.level
- The resolution level.- See Also:
ResolutionLevel.create(com.bc.ceres.glevel.MultiLevelModel, int)
-
-
Method Detail
-
getRasterDataNode
public RasterDataNode getRasterDataNode()
- Returns:
- The target raster data node.
-
getGeophysicalProductData
protected ProductData getGeophysicalProductData(RasterDataNode band, Rectangle region)
Utility method that allows to retrieve data from a raster data node whose geophysical image shares the same multi-level model (aka image pyramid model).- Parameters:
band
- A raster data node whose geophysical image shares the same multi-level model.region
- The region in pixel coordinates of the given resolution level (seeSingleBandedOpImage.getLevel()
).- Returns:
- The retrieved pixel data in geophysical units.
- See Also:
getRawProductData(RasterDataNode, java.awt.Rectangle)
-
getRawProductData
protected ProductData getRawProductData(RasterDataNode band, Rectangle region)
Utility method that allows to retrieve data from a raster data node whose source image shares the same multi-level model (aka image pyramid model).- Parameters:
band
- A raster data node whose source image shares the same multi-level model.region
- The region in pixel coordinates of the given resolution level (seeSingleBandedOpImage.getLevel()
).- Returns:
- The retrieved, raw and unscaled source pixel data.
- See Also:
getGeophysicalProductData(RasterDataNode, java.awt.Rectangle)
-
computeRect
protected void computeRect(javax.media.jai.PlanarImage[] sourceImages, WritableRaster tile, Rectangle destRect)
- Overrides:
computeRect
in classjavax.media.jai.OpImage
-
computeProductData
protected abstract void computeProductData(ProductData productData, Rectangle region) throws IOException
Computes the target pixel data for this level image.- Parameters:
productData
- The target pixel buffer to write to. The number of elements in this buffer will always beregion.width * region.height
.region
- The target region in pixel coordinates valid for this image level.- Throws:
IOException
- May be thrown if an I/O error occurs during the computation.
-
toString
public String toString()
- Overrides:
toString
in classjavax.media.jai.PlanarImage
-
getSourceCoords
protected int[] getSourceCoords(int sourceLength, int targetLength)
Utility method which computes source (offset) coordinates for a given source and target lengths.- Parameters:
sourceLength
- The source length in source pixel units.targetLength
- The target length in target pixel units.- Returns:
- An array of size
targetLength
containing source (offset) coordinates.
-
copyLine
protected static void copyLine(int y, int destWidth, ProductData src, ProductData dest, int[] sourceCoords)
-
-