Package com.luciad.format.raster
Class TLcdSingleTileRaster
java.lang.Object
com.luciad.format.raster.TLcdSingleTileRaster
- All Implemented Interfaces:
ILcdRaster
,ILcdBounded
,ILcdCache
,ILcdDisposable
,AutoCloseable
This class provides a specialized implementation of
ILcdRaster
,
containing only a single tile.
This class is thread-safe for concurrent read-only access of its contents.
- Since:
- 9.1
-
Constructor Summary
ConstructorDescriptionCreates a new empty TLcdSingleTileRaster.TLcdSingleTileRaster
(ILcdBounds aBounds, double aTileWidth, double aTileHeight, ILcdTile aTile, int aDefaultValue, ColorModel aColorModel) Creates a new TLcdSingleTileRaster.TLcdSingleTileRaster
(ILcdBounds aBounds, ILcdTile aTile, int aDefaultValue, ColorModel aColorModel) Creates a new TLcdSingleTileRaster. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the cache.void
dispose()
Disposes of this object and allows it to release any system resources that it is holding.Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.getCachedObject
(Object aKey) Looks up and returns the cached Object corresponding to the given key.Returns the optional color model of the raster.int
Returns the pixel value that is returned for points outside the bounds of the raster.double
Returns the average number of pixels per unit of area in raster coordinates.int
Returns the pixel size of the tiles in this raster, expressed in bits.int
Returns the number of the tile columns in the raster.double
Returns the height of a single tile, expressed in raster coordinates.int
Returns the number of the tile rows in the raster.double
Returns the width of a single tile, expressed in raster coordinates.int
getType()
Returns the internal storage type of the raster values.void
insertIntoCache
(Object aKey, Object aObject) Inserts a cache Object corresponding to the given key Object.removeCachedObject
(Object aKey) Looks up and removes the cached Object corresponding to the given key.retrieveTile
(int aRow, int aColumn) Retrieves the specified tile.int
retrieveValue
(double aX, double aY) Retrieves the raster value at the specified location.void
setColorModel
(ColorModel aColorModel) Sets theColorModel
of the raster.void
setDefaultValue
(int aDefaultValue) Sets the pixel value that is returned for points outside the bounds of the raster.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdDisposable
close
-
Constructor Details
-
TLcdSingleTileRaster
public TLcdSingleTileRaster()Creates a new empty TLcdSingleTileRaster. -
TLcdSingleTileRaster
public TLcdSingleTileRaster(ILcdBounds aBounds, ILcdTile aTile, int aDefaultValue, ColorModel aColorModel) Creates a new TLcdSingleTileRaster.- Parameters:
aBounds
- the bounds of the raster in model coordinates.aTile
- the only tile of the raster.aDefaultValue
- a default value in case the raster cannot resolve a point.aColorModel
- an optional ColorModel that overrides the ColorModel of the raster's tile.
-
TLcdSingleTileRaster
public TLcdSingleTileRaster(ILcdBounds aBounds, double aTileWidth, double aTileHeight, ILcdTile aTile, int aDefaultValue, ColorModel aColorModel) Creates a new TLcdSingleTileRaster.- Parameters:
aBounds
- the bounds of the raster in model coordinates.aTileWidth
- the width of the tile in model coordinates.aTileHeight
- the height of the tile in model coordinates.aTile
- the only tile of the raster.aDefaultValue
- a default value in case the raster cannot resolve a point.aColorModel
- an optional ColorModel that overrides the ColorModel of the raster's tile.
-
-
Method Details
-
getTileWidth
public double getTileWidth()Description copied from interface:ILcdRaster
Returns the width of a single tile, expressed in raster coordinates. Note that the tiles in the last (right-most) column can be smaller then other columns. The width of the last column is:getBounds().getWidth() - getTileWidth() * (getTileColumnCount() - 1)
- Specified by:
getTileWidth
in interfaceILcdRaster
-
getTileHeight
public double getTileHeight()Description copied from interface:ILcdRaster
Returns the height of a single tile, expressed in raster coordinates. Note that the tiles in the last (bottom) row can be smaller then other rows. The height of the last row is:getBounds().getHeight() - getTileHeight() * (getTileRowCount() - 1)
- Specified by:
getTileHeight
in interfaceILcdRaster
-
getTileRowCount
public int getTileRowCount()Description copied from interface:ILcdRaster
Returns the number of the tile rows in the raster.- Specified by:
getTileRowCount
in interfaceILcdRaster
-
getTileColumnCount
public int getTileColumnCount()Description copied from interface:ILcdRaster
Returns the number of the tile columns in the raster.- Specified by:
getTileColumnCount
in interfaceILcdRaster
-
getPixelDensity
public double getPixelDensity()Description copied from interface:ILcdRaster
Returns the average number of pixels per unit of area in raster coordinates.- Specified by:
getPixelDensity
in interfaceILcdRaster
-
getType
public int getType()Description copied from interface:ILcdRaster
Returns the internal storage type of the raster values.- Specified by:
getType
in interfaceILcdRaster
- Returns:
- one of
ILcdTile.BYTE
,ILcdTile.SHORT
, orILcdTile.INT
.
-
getPixelSize
public int getPixelSize()Description copied from interface:ILcdRaster
Returns the pixel size of the tiles in this raster, expressed in bits.- Specified by:
getPixelSize
in interfaceILcdRaster
-
getDefaultValue
public int getDefaultValue()Description copied from interface:ILcdRaster
Returns the pixel value that is returned for points outside the bounds of the raster.- Specified by:
getDefaultValue
in interfaceILcdRaster
- See Also:
-
setDefaultValue
public void setDefaultValue(int aDefaultValue) Description copied from interface:ILcdRaster
Sets the pixel value that is returned for points outside the bounds of the raster.- Specified by:
setDefaultValue
in interfaceILcdRaster
- Parameters:
aDefaultValue
- the default pixel value.
-
retrieveTile
Description copied from interface:ILcdRaster
Retrieves the specified tile.- Specified by:
retrieveTile
in interfaceILcdRaster
- Parameters:
aRow
- the row number of the tile in the grid of tiles, ranging between 0 and the number of rows minus 1.aColumn
- the column number of the tile in the grid of tiles, ranging between 0 and the number of columns minus 1.- Returns:
- the specified tile.
-
retrieveValue
public int retrieveValue(double aX, double aY) Description copied from interface:ILcdRaster
Retrieves the raster value at the specified location.- Specified by:
retrieveValue
in interfaceILcdRaster
- Parameters:
aX
- the x ordinate of the value, expressed in raster coordinates.aY
- the y ordinate of the value, expressed in raster coordinates.- Returns:
- the integer raster value at the specified location.
-
getColorModel
Description copied from interface:ILcdRaster
Returns the optional color model of the raster.- Specified by:
getColorModel
in interfaceILcdRaster
- Returns:
- the color model, or
null
if the raster doesn't have an explicit color model.
-
setColorModel
Description copied from interface:ILcdRaster
Sets theColorModel
of the raster.- Specified by:
setColorModel
in interfaceILcdRaster
- Parameters:
aColorModel
- the color model.
-
getBounds
Description copied from interface:ILcdBounded
Returns theILcdBounds
by which the geometry of thisILcdBounded
object is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefined
bounds. You can create undefined bounds using the default constructors ofTLcdLonLatBounds
orTLcdXYBounds
.- Specified by:
getBounds
in interfaceILcdBounded
- Returns:
- the
ILcdBounds
by which the geometry of thisILcdBounded
object is bounded.
-
insertIntoCache
Description copied from interface:ILcdCache
Inserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCache
in interfaceILcdCache
- Parameters:
aKey
- the key Object that will be used to identify the Object. The key must therefore be a unique identifier, typically the caller itself:insertIntoCache(this, ...)
.aObject
- the Object to be cached.
-
getCachedObject
Description copied from interface:ILcdCache
Looks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObject
in interfaceILcdCache
- Parameters:
aKey
- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there is no Object corresponding to the given key.
-
removeCachedObject
Description copied from interface:ILcdCache
Looks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObject
in interfaceILcdCache
- Parameters:
aKey
- the key Object that was used for storing the cache Object.- Returns:
- the cached Object, or null if there was no Object corresponding to the given key.
-
clearCache
public void clearCache()Description copied from interface:ILcdCache
Clears the cache.- Specified by:
clearCache
in interfaceILcdCache
-
dispose
public void dispose()Description copied from interface:ILcdDisposable
Disposes of this object and allows it to release any system resources that it is holding.
The result of calling any other method (other than
finalize
) on this object subsequent to a call to this method is undefined.- Specified by:
dispose
in interfaceILcdDisposable
-