Class TLcdCADRGImageDecoder

java.lang.Object
com.luciad.format.raster.ALcdTileDecoder
com.luciad.format.cadrg.TLcdCADRGImageDecoder
All Implemented Interfaces:
ILcdTileDecoder, ILcdInputStreamFactoryCapable

public class TLcdCADRGImageDecoder extends ALcdTileDecoder implements ILcdTileDecoder
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 Details

    • TLcdCADRGImageDecoder

      public TLcdCADRGImageDecoder()
      Creates a new TLcdCADRGImageDecoder that does not expand the color maps of the decoded tiles.
    • TLcdCADRGImageDecoder

      public TLcdCADRGImageDecoder(boolean aExpandColorMap)
      Creates a new TLcdCADRGImageDecoder.
      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 either 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.
      Overrides:
      setTraceOn in class ALcdTileDecoder
      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.
      Returns true if tracing is enabled for this class.
      Overrides:
      isTraceOn in class ALcdTileDecoder
      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 interface ILcdTileDecoder
      Overrides:
      readTile in class ALcdTileDecoder
      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 interface ILcdTileDecoder
      Overrides:
      readTile in class ALcdTileDecoder
      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 class ALcdTileDecoder
      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.