Package org.apache.sis.internal.storage
Class TiledDeferredImage
java.lang.Object
org.apache.sis.image.PlanarImage
org.apache.sis.image.ComputedImage
org.apache.sis.internal.coverage.j2d.BatchComputedImage
org.apache.sis.internal.storage.TiledDeferredImage
- All Implemented Interfaces:
RenderedImage
,Disposable
A rendered image where tiles are loaded only when first needed.
Used for
RasterLoadingStrategy.AT_GET_TILE_TIME
.
Other loading strategies should not instantiate this class.- Since:
- 1.2
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Number of pixels along X or Y axis in the whole rendered image.private final TiledGridCoverage.AOI
Iterator over tiles.private final int
Index of the first tile in the image.private final int
Index of the first tile in the image.private final int
Number of pixels along X or Y axis in the whole rendered image.Fields inherited from class org.apache.sis.image.ComputedImage
sampleModel, SOURCE_PADDING_KEY
Fields inherited from class org.apache.sis.image.PlanarImage
GRID_GEOMETRY_KEY, MASK_KEY, POSITIONAL_ACCURACY_KEY, SAMPLE_RESOLUTIONS_KEY, STATISTICS_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionTiledDeferredImage
(int[] imageSize, int[] tileLower, Map<String, Object> properties, TiledGridCoverage.AOI iterator) Creates a new tiled image. -
Method Summary
Modifier and TypeMethodDescriptionprotected Raster[]
computeTiles
(Rectangle tiles) Loads immediately and returns all tiles in the given ranges of tile indices.Returns the color model, ornull
if none.final int
Returns the number of pixels along Y axis in the whole rendered image.final int
Returns the minimum tile index in the X direction.final int
Returns the minimum tile index in the Y direction.final int
getMinX()
Returns the minimum x coordinate (inclusive) of this image.final int
getMinY()
Returns the minimum y coordinate (inclusive) of this image.final int
getWidth()
Returns the number of pixels along X axis in the whole rendered image.Methods inherited from class org.apache.sis.internal.coverage.j2d.BatchComputedImage
computeTile, getProperty, getPropertyNames, prefetch
Methods inherited from class org.apache.sis.image.ComputedImage
clearErrorFlags, createTile, dispose, getSampleModel, getSource, getSources, getTile, getTileHeight, getTileWidth, getWritableTileIndices, hasTileWriters, isTileWritable, markDirtyTiles, markTileWritable, sourceTileChanged
Methods inherited from class org.apache.sis.image.PlanarImage
copyData, getBounds, getData, getData, getNumXTiles, getNumYTiles, getTileGridXOffset, getTileGridYOffset, toString, verify
-
Field Details
-
width
private final int widthNumber of pixels along X or Y axis in the whole rendered image. -
height
private final int heightNumber of pixels along X or Y axis in the whole rendered image. -
minTileX
private final int minTileXIndex of the first tile in the image. -
minTileY
private final int minTileYIndex of the first tile in the image. -
iterator
Iterator over tiles. The iterator position should not be modified; instead subsets of this iterator will be created when needed.
-
-
Constructor Details
-
TiledDeferredImage
TiledDeferredImage(int[] imageSize, int[] tileLower, Map<String, Object> properties, TiledGridCoverage.AOI iterator) Creates a new tiled image.- Parameters:
imageSize
- full image size, after subsampling.tileLower
- indices of first tile to read, inclusive.properties
- image properties, ornull
if none.
-
-
Method Details
-
getColorModel
Returns the color model, ornull
if none. -
getMinX
public final int getMinX()Returns the minimum x coordinate (inclusive) of this image.- Specified by:
getMinX
in interfaceRenderedImage
- Overrides:
getMinX
in classPlanarImage
- Returns:
- the minimum x coordinate (column) of this image.
-
getMinY
public final int getMinY()Returns the minimum y coordinate (inclusive) of this image.- Specified by:
getMinY
in interfaceRenderedImage
- Overrides:
getMinY
in classPlanarImage
- Returns:
- the minimum y coordinate (row) of this image.
-
getWidth
public final int getWidth()Returns the number of pixels along X axis in the whole rendered image. -
getHeight
public final int getHeight()Returns the number of pixels along Y axis in the whole rendered image. -
getMinTileX
public final int getMinTileX()Returns the minimum tile index in the X direction.- Specified by:
getMinTileX
in interfaceRenderedImage
- Overrides:
getMinTileX
in classPlanarImage
- Returns:
- the minimum tile index in the x direction.
-
getMinTileY
public final int getMinTileY()Returns the minimum tile index in the Y direction.- Specified by:
getMinTileY
in interfaceRenderedImage
- Overrides:
getMinTileY
in classPlanarImage
- Returns:
- the minimum tile index in the y direction.
-
computeTiles
Loads immediately and returns all tiles in the given ranges of tile indices.- Specified by:
computeTiles
in classBatchComputedImage
- Parameters:
tiles
- range of tile indices for which to load tiles.- Returns:
- loaded tiles for the given indices, in row-major fashion.
- Throws:
Exception
- if an error occurred when computing tiles.
-