Package org.esa.snap.core.image
Class TiledFileOpImage
java.lang.Object
javax.media.jai.PlanarImage
javax.media.jai.OpImage
javax.media.jai.SourcelessOpImage
org.esa.snap.core.image.TiledFileOpImage
- All Implemented Interfaces:
RenderedImage
,javax.media.jai.ImageJAI
,javax.media.jai.PropertyChangeEmitter
,javax.media.jai.PropertySource
,javax.media.jai.WritablePropertySource
public class TiledFileOpImage
extends javax.media.jai.SourcelessOpImage
-
Field Summary
Fields inherited from class javax.media.jai.OpImage
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler
Fields inherited from class javax.media.jai.PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
-
Method Summary
Modifier and TypeMethodDescriptioncomputeTile
(int tileX, int tileY) Computes a tile.static TiledFileOpImage
create
(VirtualDir imageDir, Properties defaultImageProperties) static TiledFileOpImage
create
(File imageDir, Properties defaultImageProperties) static TiledFileOpImage
create
(Path imageDir, Properties defaultImageProperties) void
dispose()
static Object
getDataObject
(Raster raster) Gets the data object from the data buffer of the given raster.static void
readRawDataTile
(ImageInputStream stream, WritableRaster raster) Reads the data buffer of the given raster from the given image input stream.static void
writeRawDataTile
(Raster raster, ImageOutputStream stream) Writes the data buffer of the given raster to the given image output stream.Methods inherited from class javax.media.jai.SourcelessOpImage
computesUniqueTiles, mapDestRect, mapSourceRect
Methods inherited from class javax.media.jai.OpImage
addTileToCache, cancelTiles, computeRect, computeRect, createTile, 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, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
-
Method Details
-
create
public static TiledFileOpImage create(File imageDir, Properties defaultImageProperties) throws IOException - Throws:
IOException
-
create
public static TiledFileOpImage create(VirtualDir imageDir, Properties defaultImageProperties) throws IOException - Throws:
IOException
-
create
public static TiledFileOpImage create(Path imageDir, Properties defaultImageProperties) throws IOException - Throws:
IOException
-
computeTile
Computes a tile. Since the operation has no sources, there is no need to worry about cobbling.Subclasses should implement the
computeRect(PlanarImage[], WritableRaster, Rectangle)
method to perform the actual computation.- Overrides:
computeTile
in classjavax.media.jai.SourcelessOpImage
- Parameters:
tileX
- The X index of the tile.tileY
- The Y index of the tile.
-
readRawDataTile
public static void readRawDataTile(ImageInputStream stream, WritableRaster raster) throws IOException Reads the data buffer of the given raster from the given image input stream.- Parameters:
stream
- The image input stream.raster
- The raster.- Throws:
IOException
- if an I/O error occursIllegalArgumentException
- if theraster
's data arrays cannot be retrievedNullPointerException
- ifraster
orstream
is null
-
writeRawDataTile
Writes the data buffer of the given raster to the given image output stream.- Parameters:
raster
- The raster.stream
- The image output stream.- Throws:
IOException
- if an I/O error occursIllegalArgumentException
- if theraster
's data arrays cannot be retrievedNullPointerException
- ifraster
orstream
is null
-
getDataObject
Gets the data object from the data buffer of the given raster. The data object which will always be of a primitive array type.- Parameters:
raster
- The raster.- Returns:
- The data array.
- Throws:
IllegalArgumentException
- if theraster
's data arrays cannot be retrievedNullPointerException
- ifraster
is null
-
dispose
public void dispose()- Overrides:
dispose
in classjavax.media.jai.OpImage
-