Package com.luciad.format.cadrg
Class TLcdCADRGImageDecoder
java.lang.Object
com.luciad.format.raster.ALcdTileDecoder
com.luciad.format.cadrg.TLcdCADRGImageDecoder
- All Implemented Interfaces:
ILcdTileDecoder,ILcdInputStreamFactoryCapable
This
ILcdTileDecoder decodes CADRG/CIB frame files.
By default, the decoder will produce tiles with IndexColorModel
instances. If desired, it can expand the color maps to full ARGB
DirectColorModel instances, in order to avoid problems with
clashing color maps from different CADRG tiles (cfr. MIL-C-89038, Section
3.10.3 "Color reduction").
This class is thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newTLcdCADRGImageDecoderthat does not expand the color maps of the decoded tiles.TLcdCADRGImageDecoder(boolean aExpandColorMap) Creates a newTLcdCADRGImageDecoder. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the color maps of the decoded tiles are expanded.booleanDeprecated.This method has been deprecated.readTile(String aFileName, int aImageIndex, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) Reads a sub-tile from a file.readTile(URL aURL, int aImageIndex, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) Reads a sub-tile from a URL.protected ILcdTileInforeadTileFromStream(InputStream aInputStream, int aOffset, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) Reads a sub-tile from an input stream.voidsetExpandColorMap(boolean aExpandColorMap) Sets whether the color maps of the decoded tiles should be expanded.voidsetTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated.Methods inherited from class com.luciad.format.raster.ALcdTileDecoder
getInputStreamFactory, setClassTraceOn, setInputStreamFactory
-
Constructor Details
-
TLcdCADRGImageDecoder
public TLcdCADRGImageDecoder()Creates a newTLcdCADRGImageDecoderthat does not expand the color maps of the decoded tiles. -
TLcdCADRGImageDecoder
public TLcdCADRGImageDecoder(boolean aExpandColorMap) Creates a newTLcdCADRGImageDecoder.- Parameters:
aExpandColorMap- specifies whether the color maps of the decoded tiles should be expanded.
-
-
Method Details
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen only the informative, warning and error log messages are recorded.- Overrides:
setTraceOnin classALcdTileDecoder- Parameters:
aTraceOn- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrueif tracing is enabled for this class.- Overrides:
isTraceOnin classALcdTileDecoder- Returns:
- true if tracing is enabled for this class, false otherwise.
-
setExpandColorMap
public void setExpandColorMap(boolean aExpandColorMap) Sets whether the color maps of the decoded tiles should be expanded. -
isExpandColorMap
public boolean isExpandColorMap()Returns whether the color maps of the decoded tiles are expanded. -
readTile
public ILcdTileInfo readTile(String aFileName, int aImageIndex, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) throws TLcdCodecException Description copied from interface:ILcdTileDecoderReads a sub-tile from a file.- Specified by:
readTilein interfaceILcdTileDecoder- Overrides:
readTilein classALcdTileDecoder- Parameters:
aFileName- the name of the file containing the tile.aImageIndex- the index of the tile in the given file (if applicable).aSubTileWidth- the width of the sub-tiles, expressed in pixels.aSubTileHeight- the height of the sub-tiles, expressed in pixels.aRowIndex- the row number of the sub-tile to be decoded.aColumnIndex- the column number of the sub-tile to be decoded.aBuffer- the buffer in which the decoded bytes will be stored.- Returns:
ILcdTileInfoinformation about the decoded tile.- Throws:
TLcdCodecException- in case of decoding problems.
-
readTile
public ILcdTileInfo readTile(URL aURL, int aImageIndex, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) throws TLcdCodecException Description copied from interface:ILcdTileDecoderReads a sub-tile from a URL.- Specified by:
readTilein interfaceILcdTileDecoder- Overrides:
readTilein classALcdTileDecoder- Parameters:
aURL- the URL containing the tile.aImageIndex- the index of the tile in the given URL (if applicable).aSubTileWidth- the width of the sub-tiles, expressed in pixels.aSubTileHeight- the height of the sub-tiles, expressed in pixels.aRowIndex- the row number of the sub-tile to be decoded.aColumnIndex- the column number of the sub-tile to be decoded.aBuffer- the buffer in which the decoded bytes will be stored.- Returns:
ILcdTileInfoinformation about the decoded tile.- Throws:
TLcdCodecException- in case of decoding problems.
-
readTileFromStream
protected ILcdTileInfo readTileFromStream(InputStream aInputStream, int aOffset, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) throws TLcdCodecException Description copied from class:ALcdTileDecoderReads a sub-tile from an input stream.- Specified by:
readTileFromStreamin classALcdTileDecoder- Parameters:
aInputStream- the input stream from which the tile data can be read.aOffset- the index of the tile in the given input stream (if applicable).aSubTileWidth- the width of the sub-tiles, expressed in pixels.aSubTileHeight- the height of the sub-tiles, expressed in pixels.aRowIndex- the row number of the sub-tile to be decoded.aColumnIndex- the column number of the sub-tile to be decoded.aBuffer- the buffer in which the decoded bytes will be stored.- Returns:
ILcdTileInfoinformation about the decoded tile.- Throws:
TLcdCodecException- in case of decoding problems.
-