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
ConstructorDescriptionCreates a newTLcdCADRGImageDecoder
that does not expand the color maps of the decoded tiles.TLcdCADRGImageDecoder
(boolean aExpandColorMap) Creates a newTLcdCADRGImageDecoder
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the color maps of the decoded tiles are expanded.boolean
Deprecated.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 ILcdTileInfo
readTileFromStream
(InputStream aInputStream, int aOffset, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) Reads a sub-tile from an input stream.void
setExpandColorMap
(boolean aExpandColorMap) Sets whether the color maps of the decoded tiles should be expanded.void
setTraceOn
(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 newTLcdCADRGImageDecoder
that 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 eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Overrides:
setTraceOn
in 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.Returnstrue
if tracing is enabled for this class.- Overrides:
isTraceOn
in 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:ILcdTileDecoder
Reads a sub-tile from a file.- Specified by:
readTile
in interfaceILcdTileDecoder
- Overrides:
readTile
in 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:
ILcdTileInfo
information 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:ILcdTileDecoder
Reads a sub-tile from a URL.- Specified by:
readTile
in interfaceILcdTileDecoder
- Overrides:
readTile
in 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:
ILcdTileInfo
information 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:ALcdTileDecoder
Reads a sub-tile from an input stream.- Specified by:
readTileFromStream
in 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:
ILcdTileInfo
information about the decoded tile.- Throws:
TLcdCodecException
- in case of decoding problems.
-