Package com.bc.ceres.multilevel.support
Class DefaultMultiLevelImage
java.lang.Object
javax.media.jai.PlanarImage
javax.media.jai.OpImage
javax.media.jai.SourcelessOpImage
com.bc.ceres.multilevel.MultiLevelImage
com.bc.ceres.multilevel.support.DefaultMultiLevelImage
- All Implemented Interfaces:
MultiLevelSource,RenderedImage,javax.media.jai.ImageJAI,javax.media.jai.PropertyChangeEmitter,javax.media.jai.PropertySource,javax.media.jai.WritablePropertySource
Adapts a JAI
PlanarImage to the MultiLevelSource
interface. The image data provided by this PlanarImage corresponds to the level zero image of the given
MultiLevelSource.-
Field Summary
Fields inherited from class javax.media.jai.OpImage
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecyclerFields inherited from class javax.media.jai.PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, widthFields inherited from interface com.bc.ceres.multilevel.MultiLevelSource
NULL -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new multi-level image from the given source.DefaultMultiLevelImage(MultiLevelSource source, javax.media.jai.ImageLayout layout) Constructs a new multi-level image from the given source and the image layout. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Provides a hint that an image will no longer be accessed from a reference in user space.final RenderedImagegetImage(int level) Gets the scaled image for the given resolution level.getImageShape(int level) Gets the shape of the area where this image's raster data contains valid pixels at the given resolution level.final MultiLevelModelgetModel()Gets the layout model for the multi-resolution image supported by thisLevelImageSource.final MultiLevelSourcevoidreset()Provides a hint that the level images provided so far will no longer be accessed from a reference in user space.Methods inherited from class com.bc.ceres.multilevel.MultiLevelImage
copyData, getData, getData, getTileMethods inherited from class javax.media.jai.SourcelessOpImage
computesUniqueTiles, computeTile, mapDestRect, mapSourceRectMethods inherited from class javax.media.jai.OpImage
addTileToCache, cancelTiles, computeRect, computeRect, createTile, getExpandedNumBands, getFormatTags, getOperationComputeType, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapSourcePoint, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorizeMethods inherited from class javax.media.jai.PlanarImage
addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, finalize, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, 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
-
Constructor Details
-
DefaultMultiLevelImage
Constructs a new multi-level image from the given source.- Parameters:
source- The multi-level image source.
-
DefaultMultiLevelImage
Constructs a new multi-level image from the given source and the image layout.- Parameters:
source- The multi-level image source.layout- The image layout.
-
-
Method Details
-
getSource
- Returns:
- The multi-level image source.
-
getModel
Description copied from interface:MultiLevelSourceGets the layout model for the multi-resolution image supported by thisLevelImageSource.- Returns:
- the multi-resolution image model.
-
getImage
Description copied from interface:MultiLevelSourceGets the scaled image for the given resolution level. The width and height of an image returned for a givenlevelisscaletimes smaller than the dimensions of the image atlevel=0.- Parameters:
level- The resolution level.- Returns:
- The scaled image, must be in the range 0 to
MultiLevelModel.getLevelCount()-1.
-
getImageShape
Description copied from interface:MultiLevelSourceGets the shape of the area where this image's raster data contains valid pixels at the given resolution level. The method returnsnull, if the entire image raster contains valid pixels.- Parameters:
level- The resolution level.- Returns:
- The shape of the area where the image has data, can be
null.
-
reset
public void reset()Description copied from interface:MultiLevelSourceProvides a hint that the level images provided so far will no longer be accessed from a reference in user space.
Therefore implementations of this method might also dispose any cached level images that have been provided so far.
After calling this method, a call to
MultiLevelSource.getImage(int)} for the same level may return a new level image instance.This method is particularly useful if properties have changed that affect the appearance of the returned images at all levels, e.g. after a new color palette has been assigned or the contrast range has changed.
-
dispose
public void dispose()Description copied from class:MultiLevelImageProvides a hint that an image will no longer be accessed from a reference in user space. The results are equivalent to those that occur when the program loses its last reference to this image, the garbage collector discovers this, and finalize is called. This can be used as a hint in situations where waiting for garbage collection would be overly conservative.The results of referencing an image after a call to
dispose()are undefined.Overrides shall call
super.dispose()in a final step.- Overrides:
disposein classMultiLevelImage
-