public class TLcdGeoSPOTRaster extends ALcdImageMosaic implements ILcdRaster
ILcdRaster
contains additional information about the
GeoSPOT tile that it represents.
ALcdImageMosaic.Configuration
IMAGE_DATA_TYPE
Constructor and Description |
---|
TLcdGeoSPOTRaster(ILcdBounds aBounds,
double aTileWidth,
double aTileHeight,
ILcdTile[][] aTiles,
double aPixelDensity,
int aDefaultValue,
ColorModel aColorModel,
TLcdGeoSPOTRasterDescriptor aRasterDescriptor,
ILcdModelReference aModelReference)
Creates a new TLcdGeoSPOTRaster.
|
TLcdGeoSPOTRaster(ILcdBounds aBounds,
ILcdTile[][] aTiles,
double aPixelDensity,
int aDefaultValue,
ColorModel aColorModel,
TLcdGeoSPOTRasterDescriptor aRasterDescriptor,
ILcdModelReference aModelReference)
Creates a new TLcdGeoSPOTRaster with a regular tiling.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
ILcdBounds |
getBounds()
Returns the bounds of the image.
|
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.
|
ALcdImageMosaic.Configuration |
getConfiguration()
Returns an image configuration object describing the properties of this
image mosaic's data.
|
int |
getDefaultValue()
Returns the pixel value that is returned for points outside the bounds of
the raster.
|
TLcdGeoSPOTRasterDescriptor |
getGeoSPOTRasterDescriptor()
Returns the descriptor containing GeoSPOT metadata.
|
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.
|
ALcdBasicImage |
getTile(long aTileX,
long aTileY)
Returns a single tile from this image.
|
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 aValue)
Sets the pixel value that is returned for points outside the bounds of
the raster.
|
asMultilevelMosaic, fromDomainObject
public TLcdGeoSPOTRaster(ILcdBounds aBounds, ILcdTile[][] aTiles, double aPixelDensity, int aDefaultValue, ColorModel aColorModel, TLcdGeoSPOTRasterDescriptor aRasterDescriptor, ILcdModelReference aModelReference)
aBounds
- the bounds of the raster in model coordinates.aTiles
- the array of tiles of the raster.aPixelDensity
- an estimate of the number of pixels per unit area in
model coordinates.aDefaultValue
- a default value in case the raster cannot resolve
a point.aColorModel
- an optional ColorModel that overrides the ColorModel
of the raster's tiles.aRasterDescriptor
- the descriptor containing GeoSPOT metadata.public TLcdGeoSPOTRaster(ILcdBounds aBounds, double aTileWidth, double aTileHeight, ILcdTile[][] aTiles, double aPixelDensity, int aDefaultValue, ColorModel aColorModel, TLcdGeoSPOTRasterDescriptor aRasterDescriptor, ILcdModelReference aModelReference)
For a raster with a uniform pixel density, the tile width (and similarly the tile height) in model coordinates can be computed as follows:
<tile width> = <tile width in pixels> / <raster width in pixels> * <raster width>
aBounds
- the bounds of the raster in model coordinates.aTileWidth
- the width of the tiles in model coordinates.aTileHeight
- the height of the tiles in model coordinates.aTiles
- the array of tiles of the raster.aPixelDensity
- an estimate of the number of pixels per unit area in
model coordinates.aDefaultValue
- a default value in case the raster cannot resolve
a point.aColorModel
- an optional ColorModel that overrides the ColorModel
of the raster's tiles.aRasterDescriptor
- the descriptor containing GeoSPOT metadata.public TLcdGeoSPOTRasterDescriptor getGeoSPOTRasterDescriptor()
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 aValue)
ILcdRaster
setDefaultValue
in interface ILcdRaster
aValue
- 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()
ALcdImage
getBounds
in interface ILcdBounded
getBounds
in class ALcdImage
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 ALcdBasicImage getTile(long aTileX, long aTileY)
ALcdImageMosaic
null
if no data
is available. If the supplied sampling parameters allow it, however, the
image may also create a new tile by extrapolating data from other levels
of detail.
Note that this method may require costly IO. Even if data is loaded lazily then some IO may still be required to
determine if the tile exists or not. So typically this method should not be invoked from the paint thread. Also
note that a mosaic may contain many tiles (ex. millions) so iterating over all tiles may take a very long time.getTile
in class ALcdImageMosaic
aTileX
- the tile x coordinate in [0, getConfiguration().getColumnCount()[
aTileY
- the tile y coordinate in [0, getConfiguration().getRowCount()[
null
public ALcdImageMosaic.Configuration getConfiguration()
ALcdImageMosaic
getConfiguration
in class ALcdImageMosaic