public class TLcdSingleTileRaster extends Object implements ILcdRaster, ILcdDisposable
ILcdRaster
,
containing only a single tile.
This class is thread-safe for concurrent read-only access of its contents.
Constructor and Description |
---|
TLcdSingleTileRaster()
Creates 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.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
void |
dispose()
Disposes of this object and allows it to release any system resources that it is holding.
|
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
ColorModel |
getColorModel()
Returns the optional color model of the raster.
|
int |
getDefaultValue()
Returns the pixel value that is returned for points outside the bounds of
the raster.
|
double |
getPixelDensity()
Returns the average number of pixels per unit of area in raster
coordinates.
|
int |
getPixelSize()
Returns the pixel size of the tiles in this raster, expressed in bits.
|
int |
getTileColumnCount()
Returns the number of the tile columns in the raster.
|
double |
getTileHeight()
Returns the height of a single tile, expressed in raster coordinates.
|
int |
getTileRowCount()
Returns the number of the tile rows in the raster.
|
double |
getTileWidth()
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.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
ILcdTile |
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 the
ColorModel of the raster. |
void |
setDefaultValue(int aDefaultValue)
Sets the pixel value that is returned for points outside the bounds of
the raster.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public TLcdSingleTileRaster()
public TLcdSingleTileRaster(ILcdBounds aBounds, ILcdTile aTile, int aDefaultValue, ColorModel aColorModel)
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.public TLcdSingleTileRaster(ILcdBounds aBounds, double aTileWidth, double aTileHeight, ILcdTile aTile, int aDefaultValue, ColorModel aColorModel)
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.public double getTileWidth()
ILcdRaster
getBounds().getWidth() - getTileWidth() * (getTileColumnCount() - 1)
getTileWidth
in interface ILcdRaster
public double getTileHeight()
ILcdRaster
getBounds().getHeight() - getTileHeight() * (getTileRowCount() - 1)
getTileHeight
in interface ILcdRaster
public int getTileRowCount()
ILcdRaster
getTileRowCount
in interface ILcdRaster
public int getTileColumnCount()
ILcdRaster
getTileColumnCount
in interface ILcdRaster
public double getPixelDensity()
ILcdRaster
getPixelDensity
in interface ILcdRaster
public int getType()
ILcdRaster
getType
in interface ILcdRaster
ILcdTile.BYTE
,
ILcdTile.SHORT
, or
ILcdTile.INT
.public int getPixelSize()
ILcdRaster
getPixelSize
in interface ILcdRaster
public int getDefaultValue()
ILcdRaster
getDefaultValue
in interface ILcdRaster
ILcdRaster.retrieveValue(double, double)
public void setDefaultValue(int aDefaultValue)
ILcdRaster
setDefaultValue
in interface ILcdRaster
aDefaultValue
- the default pixel value.public ILcdTile retrieveTile(int aRow, int aColumn)
ILcdRaster
retrieveTile
in interface ILcdRaster
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.public int retrieveValue(double aX, double aY)
ILcdRaster
retrieveValue
in interface ILcdRaster
aX
- the x ordinate of the value, expressed in raster coordinates.aY
- the y ordinate of the value, expressed in raster coordinates.public ColorModel getColorModel()
ILcdRaster
getColorModel
in interface ILcdRaster
null
if the raster doesn't have
an explicit color model.public void setColorModel(ColorModel aColorModel)
ILcdRaster
ColorModel
of the raster.setColorModel
in interface ILcdRaster
aColorModel
- the color model.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
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
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public void insertIntoCache(Object aKey, Object aObject)
ILcdCache
insertIntoCache
in interface ILcdCache
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.public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache
public void dispose()
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.
dispose
in interface ILcdDisposable