public class TLcdCADRGImageDecoder extends ALcdTileDecoder implements ILcdTileDecoder
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 and Description |
---|
TLcdCADRGImageDecoder()
Creates a new
TLcdCADRGImageDecoder that does not expand the
color maps of the decoded tiles. |
TLcdCADRGImageDecoder(boolean aExpandColorMap)
Creates a new
TLcdCADRGImageDecoder . |
Modifier and Type | Method and Description |
---|---|
boolean |
isExpandColorMap()
Returns whether the color maps of the decoded tiles are expanded.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
ILcdTileInfo |
readTile(String aFileName,
int aImageIndex,
int aSubTileWidth,
int aSubTileHeight,
int aRowIndex,
int aColumnIndex,
ILcdBuffer aBuffer)
Reads a sub-tile from a file.
|
ILcdTileInfo |
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. It is recommended to use the
standard Java logging framework directly.
|
getInputStreamFactory, setClassTraceOn, setInputStreamFactory
public TLcdCADRGImageDecoder()
TLcdCADRGImageDecoder
that does not expand the
color maps of the decoded tiles.public TLcdCADRGImageDecoder(boolean aExpandColorMap)
TLcdCADRGImageDecoder
.aExpandColorMap
- specifies whether the color maps of the decoded
tiles should be expanded.public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.setTraceOn
in class ALcdTileDecoder
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.public boolean isTraceOn()
true
if tracing is enabled for this class.isTraceOn
in class ALcdTileDecoder
public void setExpandColorMap(boolean aExpandColorMap)
public boolean isExpandColorMap()
public ILcdTileInfo readTile(String aFileName, int aImageIndex, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) throws TLcdCodecException
ILcdTileDecoder
readTile
in interface ILcdTileDecoder
readTile
in class ALcdTileDecoder
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.ILcdTileInfo
information about the decoded tile.TLcdCodecException
- in case of decoding problems.public ILcdTileInfo readTile(URL aURL, int aImageIndex, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) throws TLcdCodecException
ILcdTileDecoder
readTile
in interface ILcdTileDecoder
readTile
in class ALcdTileDecoder
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.ILcdTileInfo
information about the decoded tile.TLcdCodecException
- in case of decoding problems.protected ILcdTileInfo readTileFromStream(InputStream aInputStream, int aOffset, int aSubTileWidth, int aSubTileHeight, int aRowIndex, int aColumnIndex, ILcdBuffer aBuffer) throws TLcdCodecException
ALcdTileDecoder
readTileFromStream
in class ALcdTileDecoder
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.ILcdTileInfo
information about the decoded tile.TLcdCodecException
- in case of decoding problems.