C# Класс CSJ2K.j2k.codestream.reader.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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
PktDecoder ( DecoderSpecs decSpec, HeaderDecoder hd, RandomAccessIO ehs, BitstreamReaderAgent src, bool isTruncMode, int maxCB ) : System

Creates an empty PktDecoder object associated with given decoder specifications and HeaderDecoder. This object must be initialized thanks to the restart method before being used.

getNumPrecinct ( int c, int r ) : int

Gets the number of precincts in a given component and resolution level.

getPPX ( int t, int c, int r ) : int

Returns the precinct partition width for the specified component, resolution level and tile.

getPPY ( int t, int c, int rl ) : int

Returns the precinct partition height for the specified component, resolution level and tile.

getPrecInfo ( int c, int r, int p ) : CSJ2K.j2k.codestream.PrecInfo

Get PrecInfo instance of the specified resolution level, component and precinct.

readEPHMarker ( CSJ2K.j2k.codestream.reader.PktHeaderBitReader bin ) : void

Try to read an EPH marker. If it is not possible then an Error is thrown.

readPktBody ( int l, int r, int c, int p, CSJ2K.j2k.codestream.reader.CBlkInfo cbI, int nb ) : bool

Reads specificied packet body in order to find offset of each code-block's piece of codeword. This use the list of found code-blocks in previous red packet head.

readPktHead ( int l, int r, int c, int p, CSJ2K.j2k.codestream.reader.CBlkInfo cbI, int nb ) : bool

Read specified packet head and found length of each code-block's piece of codewords as well as number of skipped most significant bit-planes.

readSOPMarker ( int nBytes, int p, int c, int r ) : bool

Try to read a SOP marker and check that its sequence number if not out of sequence. If so, an error is thrown.

restart ( int nc, int mdl, int nl, CSJ2K.j2k.codestream.reader.CBlkInfo cbI, bool pph, System pphbais ) : CSJ2K.j2k.codestream.reader.CBlkInfo[][][][][]

Re-initialize the PktDecoder instance at the beginning of a new tile.

Приватные методы

Метод Описание
fillPrecInfo ( int c, int r, int mdl ) : void

Retrives precincts and code-blocks coordinates in the given resolution, level and component. Finishes TagTreeEncoder initialization as well.

Описание методов

PktDecoder() публичный Метод

Creates an empty PktDecoder object associated with given decoder specifications and HeaderDecoder. This object must be initialized thanks to the restart method before being used.
public PktDecoder ( DecoderSpecs decSpec, HeaderDecoder hd, RandomAccessIO ehs, BitstreamReaderAgent src, bool isTruncMode, int maxCB ) : System
decSpec CSJ2K.j2k.decoder.DecoderSpecs The decoder specifications. /// ///
hd HeaderDecoder The HeaderDecoder instance. /// ///
ehs RandomAccessIO The stream where to read data from. /// ///
src BitstreamReaderAgent The bit stream reader agent. /// ///
isTruncMode bool Whether or not truncation mode is required. /// ///
maxCB int The maximum number of code-blocks to read before ncbquit /// /// ///
Результат System

getNumPrecinct() публичный Метод

Gets the number of precincts in a given component and resolution level.
public getNumPrecinct ( int c, int r ) : int
c int Component index /// ///
r int Resolution index /// ///
Результат int

getPPX() публичный Метод

Returns the precinct partition width for the specified component, resolution level and tile.
public getPPX ( int t, int c, int r ) : int
t int the tile index /// ///
c int The index of the component (between 0 and C-1) /// ///
r int The resolution level, from 0 to L. /// ///
Результат int

getPPY() публичный Метод

Returns the precinct partition height for the specified component, resolution level and tile.
public getPPY ( int t, int c, int rl ) : int
t int the tile index /// ///
c int The index of the component (between 0 and C-1) /// ///
rl int The resolution level, from 0 to L. /// ///
Результат int

getPrecInfo() публичный Метод

Get PrecInfo instance of the specified resolution level, component and precinct.
public getPrecInfo ( int c, int r, int p ) : CSJ2K.j2k.codestream.PrecInfo
c int Component index. /// ///
r int Resolution level index. /// ///
p int Precinct index. /// ///
Результат CSJ2K.j2k.codestream.PrecInfo

readEPHMarker() публичный Метод

Try to read an EPH marker. If it is not possible then an Error is thrown.
public readEPHMarker ( CSJ2K.j2k.codestream.reader.PktHeaderBitReader bin ) : void
bin CSJ2K.j2k.codestream.reader.PktHeaderBitReader The packet header reader to read the EPH marker from /// ///
Результат void

readPktBody() публичный Метод

Reads specificied packet body in order to find offset of each code-block's piece of codeword. This use the list of found code-blocks in previous red packet head.
public readPktBody ( int l, int r, int c, int p, CSJ2K.j2k.codestream.reader.CBlkInfo cbI, int nb ) : bool
l int layer index /// ///
r int Resolution level index /// ///
c int Component index /// ///
p int Precinct index /// ///
cbI CSJ2K.j2k.codestream.reader.CBlkInfo CBlkInfo array of relevant component and resolution /// level. /// ///
nb int The remainding number of bytes to read from the bit stream in /// each tile before reaching the decoding rate (in truncation mode) /// ///
Результат bool

readPktHead() публичный Метод

Read specified packet head and found length of each code-block's piece of codewords as well as number of skipped most significant bit-planes.
public readPktHead ( int l, int r, int c, int p, CSJ2K.j2k.codestream.reader.CBlkInfo cbI, int nb ) : bool
l int layer index /// ///
r int Resolution level index /// ///
c int Component index /// ///
p int Precinct index /// ///
cbI CSJ2K.j2k.codestream.reader.CBlkInfo CBlkInfo array of relevant component and resolution /// level. /// ///
nb int The number of bytes to read in each tile before reaching /// output rate (used by truncation mode) /// ///
Результат bool

readSOPMarker() публичный Метод

Try to read a SOP marker and check that its sequence number if not out of sequence. If so, an error is thrown.
public readSOPMarker ( int nBytes, int p, int c, int r ) : bool
nBytes int The number of bytes left to read from each tile /// ///
p int Precinct index /// ///
c int Component index /// ///
r int Resolution level index /// ///
Результат bool

restart() публичный Метод

Re-initialize the PktDecoder instance at the beginning of a new tile.
public restart ( int nc, int mdl, int nl, CSJ2K.j2k.codestream.reader.CBlkInfo cbI, bool pph, System pphbais ) : CSJ2K.j2k.codestream.reader.CBlkInfo[][][][][]
nc int The number of components in this tile /// ///
mdl int The maximum number of decomposition level in each component /// of this tile /// ///
nl int The number of layers in this tile /// ///
cbI CSJ2K.j2k.codestream.reader.CBlkInfo The code-blocks array /// ///
pph bool Flag indicating whether packed packet headers was used /// ///
pphbais System Stream containing the packed packet headers /// ///
Результат CSJ2K.j2k.codestream.reader.CBlkInfo[][][][][]