public class TLcdInterpolatedRaster extends TLcdRaster implements ILcdRaster
ILcdRaster
that
interpolates between the values of its tiles. More specifically, the method
retrieveValue(double, double)
provides bilinear interpolation
across the raster. Each tile must provide one additional row and column
beyond its returned width and height, in order to support the interpolation.
The additional row and column should be duplicates of the first row and
column of the neighboring tiles. Such a representation is naturally
supported by data formats like DTED and GRIB.
Note that the method TLcdRaster.retrieveTile(int, int)
still returns tiles
with discrete pixels. If the images of these tiles are painted directly,
they still look pixelated.
This class is thread-safe for concurrent read-only access of its contents.
TLcdClippedTile
Constructor and Description |
---|
TLcdInterpolatedRaster(ILcdBounds aBounds,
double aTileWidth,
double aTileHeight,
ILcdTile[][] aTiles,
double aPixelDensity,
int aDefaultValue,
ColorModel aColorModel)
Creates a new TLcdInterpolatedRaster.
|
TLcdInterpolatedRaster(ILcdBounds aBounds,
ILcdTile[][] aTiles,
double aPixelDensity,
int aDefaultValue,
ColorModel aColorModel)
Creates a new TLcdInterpolatedRaster with a regular tiling.
|
Modifier and Type | Method and Description |
---|---|
int |
retrieveValue(double aX,
double aY)
Retrieves the raster value at the specified location.
|
getTileColumnCount, getTileRowCount, retrieveTile
clearCache, dispose, getBounds, getCachedObject, getColorModel, getDefaultValue, getPixelDensity, getPixelSize, getTileHeight, getTileWidth, getType, insertIntoCache, removeCachedObject, setColorModel, setDefaultValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColorModel, getDefaultValue, getPixelDensity, getPixelSize, getTileColumnCount, getTileHeight, getTileRowCount, getTileWidth, getType, retrieveTile, setColorModel, setDefaultValue
getBounds
clearCache, getCachedObject, insertIntoCache, removeCachedObject
close
public TLcdInterpolatedRaster(ILcdBounds aBounds, ILcdTile[][] aTiles, double aPixelDensity, int aDefaultValue, ColorModel aColorModel)
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.public TLcdInterpolatedRaster(ILcdBounds aBounds, double aTileWidth, double aTileHeight, ILcdTile[][] aTiles, double aPixelDensity, int aDefaultValue, ColorModel aColorModel)
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.public int retrieveValue(double aX, double aY)
ILcdRaster
retrieveValue
in interface ILcdRaster
retrieveValue
in class ALcdRaster
aX
- the x ordinate of the value, expressed in raster coordinates.aY
- the y ordinate of the value, expressed in raster coordinates.