Package com.luciad.format.raster
Class ALcdRaster
java.lang.Object
com.luciad.format.raster.ALcdRaster
- All Implemented Interfaces:
ILcdRaster,ILcdBounded,ILcdCache,ILcdDisposable,AutoCloseable
- Direct Known Subclasses:
TLcdRaster
Base class for ILcdRaster implementations.
- Since:
- 2014.0
-
Constructor Summary
ConstructorsConstructorDescriptionALcdRaster(ILcdBounds aBounds, double aTileWidth, double aTileHeight, double aPixelDensity, int aDefaultValue, ColorModel aColorModel) Creates a new ALcdRaster. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the cache.voiddispose()Disposes of this object and allows it to release any system resources that it is holding.Returns theILcdBoundsby which the geometry of thisILcdBoundedobject 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.intReturns the pixel value that is returned for points outside the bounds of the raster.doubleReturns the average number of pixels per unit of area in raster coordinates.intReturns the pixel size of the tiles in this raster, expressed in bits.doubleReturns the height of a single tile, expressed in raster coordinates.doubleReturns the width of a single tile, expressed in raster coordinates.intgetType()Returns the internal storage type of the raster values.voidinsertIntoCache(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.intretrieveValue(double aX, double aY) Retrieves the raster value at the specified location.voidsetColorModel(ColorModel aColorModel) Sets theColorModelof the raster.voidsetDefaultValue(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, waitMethods inherited from interface com.luciad.util.ILcdDisposable
closeMethods inherited from interface com.luciad.format.raster.ILcdRaster
getTileColumnCount, getTileRowCount, retrieveTile
-
Constructor Details
-
ALcdRaster
public ALcdRaster(ILcdBounds aBounds, double aTileWidth, double aTileHeight, double aPixelDensity, int aDefaultValue, ColorModel aColorModel) Creates a new ALcdRaster. 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.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
-
setColorModel
Description copied from interface:ILcdRasterSets theColorModelof the raster.- Specified by:
setColorModelin interfaceILcdRaster- Parameters:
aColorModel- the color model.
-
getColorModel
Description copied from interface:ILcdRasterReturns the optional color model of the raster.- Specified by:
getColorModelin interfaceILcdRaster- Returns:
- the color model, or
nullif the raster doesn't have an explicit color model.
-
getTileWidth
public double getTileWidth()Description copied from interface:ILcdRasterReturns 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:
getTileWidthin interfaceILcdRaster
-
getTileHeight
public double getTileHeight()Description copied from interface:ILcdRasterReturns 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:
getTileHeightin interfaceILcdRaster
-
getPixelDensity
public double getPixelDensity()Description copied from interface:ILcdRasterReturns the average number of pixels per unit of area in raster coordinates.- Specified by:
getPixelDensityin interfaceILcdRaster
-
getDefaultValue
public int getDefaultValue()Description copied from interface:ILcdRasterReturns the pixel value that is returned for points outside the bounds of the raster.- Specified by:
getDefaultValuein interfaceILcdRaster- See Also:
-
setDefaultValue
public void setDefaultValue(int aDefaultValue) Description copied from interface:ILcdRasterSets the pixel value that is returned for points outside the bounds of the raster.- Specified by:
setDefaultValuein interfaceILcdRaster- Parameters:
aDefaultValue- the default pixel value.
-
retrieveValue
public int retrieveValue(double aX, double aY) Description copied from interface:ILcdRasterRetrieves the raster value at the specified location.- Specified by:
retrieveValuein 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.
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject 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
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
insertIntoCache
Description copied from interface:ILcdCacheInserts a cache Object corresponding to the given key Object.- Specified by:
insertIntoCachein 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:ILcdCacheLooks up and returns the cached Object corresponding to the given key.- Specified by:
getCachedObjectin 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:ILcdCacheLooks up and removes the cached Object corresponding to the given key.- Specified by:
removeCachedObjectin 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:ILcdCacheClears the cache.- Specified by:
clearCachein interfaceILcdCache
-
dispose
public void dispose()Description copied from interface:ILcdDisposableDisposes 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:
disposein interfaceILcdDisposable
-
getType
public int getType()Description copied from interface:ILcdRasterReturns the internal storage type of the raster values.- Specified by:
getTypein interfaceILcdRaster- Returns:
- one of
ILcdTile.BYTE,ILcdTile.SHORT, orILcdTile.INT.
-
getPixelSize
public int getPixelSize()Description copied from interface:ILcdRasterReturns the pixel size of the tiles in this raster, expressed in bits.- Specified by:
getPixelSizein interfaceILcdRaster
-