C# (CSharp) CSJ2K.j2k.codestream.reader Пространство имен

Классы

Имя Описание
BitstreamReaderAgent This is the generic interface for bit stream reader agents. A bit stream reader agent is an entity that allows reading from a bit stream and requesting compressed code-blocks. It can be a simple file reader, or a network connection, or anything else.

The bit stream reader agent allows to make request for compressed block data in any order. The amount of data returned would normally depend on the data available at the time of the request, be it from a file or from a network connection.

The bit stream reader agent has the notion of a current tile, and coordinates are relative to the current tile, where applicable.

Resolution level 0 is the lowest resolution level, i.e. the LL subband alone.

FileBitstreamReaderAgent This class reads the bit stream (with the help of HeaderDecoder for tile headers and PktDecoder for packets header and body) and retrives location of all code-block's codewords.

Note: All tile-parts headers are read by the constructor whereas packets are processed when decoding related tile (when setTile method is called).

In parsing mode, the reader simulates a virtual layer-resolution progressive bit stream with the same truncation points in each code-block, whereas in truncation mode, only the first bytes are taken into account (it behaves like if it is a real truncated codestream).

HeaderDecoder This class reads main and tile-part headers from the codestream given a RandomAccessIO instance located at the beginning of the codestream (i.e just before the SOC marker) or at the beginning of a tile-part (i.e. just before a SOT marker segment) respectively.

A marker segment includes a marker and eventually marker segment parameters. It is designed by the three letters code of the marker associated with the marker segment. JPEG 2000 part 1 defines 6 types of markers segments:

  • Delimiting : SOC, SOT, SOD, EOC
  • Fixed information: SIZ.
  • Functional: COD, COC, RGN, QCD, QCC,POC.
  • In bit-stream: SOP, EPH.
  • Pointer: TLM, PLM, PLT, PPM, PPT.
  • Informational: CRG, COM.

The main header is read when the constructor is called whereas tile-part headers are read when the FileBitstreamReaderAgent instance is created. The reading is done in 2 passes:

  1. All marker segments are buffered and their corresponding flag is activated (extractMainMarkSeg and extractTilePartMarkSeg methods).
  2. Buffered marker segment are analyzed in a logical way and specifications are stored in appropriate member of DecoderSpecs instance (readFoundMainMarkSeg and readFoundTilePartMarkSeg methods).

Whenever a marker segment is not recognized a warning message is displayed and its length parameter is used to skip it.

The information found in this header is stored in HeaderInfo and DecoderSpecs instances.

PktDecoder This class is used to read packet's head and body. All the members must be re-initialized at the beginning of each tile thanks to the restart() method.