Package com.luciad.format.raster
Class TLcdInterpolatedRaster
java.lang.Object
com.luciad.format.raster.ALcdRaster
com.luciad.format.raster.TLcdRaster
com.luciad.format.raster.TLcdInterpolatedRaster
- All Implemented Interfaces:
ILcdRaster
,ILcdBounded
,ILcdCache
,ILcdDisposable
,AutoCloseable
This class provides an implementation of
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.
- Since:
- 9.1
- See Also:
-
Constructor Summary
ConstructorDescriptionTLcdInterpolatedRaster
(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. -
Method Summary
Modifier and TypeMethodDescriptionint
retrieveValue
(double aX, double aY) Retrieves the raster value at the specified location.Methods inherited from class com.luciad.format.raster.TLcdRaster
getTileColumnCount, getTileRowCount, retrieveTile
Methods inherited from class com.luciad.format.raster.ALcdRaster
clearCache, dispose, getBounds, getCachedObject, getColorModel, getDefaultValue, getPixelDensity, getPixelSize, getTileHeight, getTileWidth, getType, insertIntoCache, removeCachedObject, setColorModel, setDefaultValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.shape.ILcdBounded
getBounds
Methods inherited from interface com.luciad.util.ILcdCache
clearCache, getCachedObject, insertIntoCache, removeCachedObject
Methods inherited from interface com.luciad.util.ILcdDisposable
close
Methods inherited from interface com.luciad.format.raster.ILcdRaster
getColorModel, getDefaultValue, getPixelDensity, getPixelSize, getTileColumnCount, getTileHeight, getTileRowCount, getTileWidth, getType, retrieveTile, setColorModel, setDefaultValue
-
Constructor Details
-
TLcdInterpolatedRaster
public TLcdInterpolatedRaster(ILcdBounds aBounds, ILcdTile[][] aTiles, double aPixelDensity, int aDefaultValue, ColorModel aColorModel) Creates a new TLcdInterpolatedRaster with a regular tiling.- Parameters:
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.
-
TLcdInterpolatedRaster
public TLcdInterpolatedRaster(ILcdBounds aBounds, double aTileWidth, double aTileHeight, ILcdTile[][] aTiles, double aPixelDensity, int aDefaultValue, ColorModel aColorModel) Creates a new TLcdInterpolatedRaster. The tiling is regular, except possibly for the tiles in the right-most column and in the bottom row. If the sums of the tile widths and the tile heights extend beyond the bounds of the raster, the extending parts are considered to be padding and they are ignored.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>
- Parameters:
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.
-
-
Method Details
-
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
- Overrides:
retrieveValue
in classALcdRaster
- 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.
-