Class TiledDeferredImage

All Implemented Interfaces:
RenderedImage, Disposable

final class TiledDeferredImage extends BatchComputedImage
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 Details

    • width

      private final int width
      Number of pixels along X or Y axis in the whole rendered image.
    • height

      private final int height
      Number of pixels along X or Y axis in the whole rendered image.
    • minTileX

      private final int minTileX
      Index of the first tile in the image.
    • minTileY

      private final int minTileY
      Index of the first tile in the image.
    • iterator

      private final TiledGridCoverage.AOI 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, or null if none.
  • Method Details

    • getColorModel

      public ColorModel getColorModel()
      Returns the color model, or null if none.
    • getMinX

      public final int getMinX()
      Returns the minimum x coordinate (inclusive) of this image.
      Specified by:
      getMinX in interface RenderedImage
      Overrides:
      getMinX in class PlanarImage
      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 interface RenderedImage
      Overrides:
      getMinY in class PlanarImage
      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 interface RenderedImage
      Overrides:
      getMinTileX in class PlanarImage
      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 interface RenderedImage
      Overrides:
      getMinTileY in class PlanarImage
      Returns:
      the minimum tile index in the y direction.
    • computeTiles

      protected Raster[] computeTiles(Rectangle tiles) throws Exception
      Loads immediately and returns all tiles in the given ranges of tile indices.
      Specified by:
      computeTiles in class BatchComputedImage
      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.