Scribus
Open source desktop publishing at your fingertips
CDecoder Class Reference

PGF decoder. More...

#include <Decoder.h>

Public Member Functions

 CDecoder (CPGFStream *stream, PGFPreHeader &preHeader, PGFHeader &header, PGFPostHeader &postHeader, UINT32 *&levelLength, UINT64 &userDataPos, bool useOMP, bool skipUserData) THROW_
 
 ~CDecoder ()
 Destructor.
 
void Partition (CSubband *band, int quantParam, int width, int height, int startPos, int pitch) THROW_
 
void DecodeInterleaved (CWaveletTransform *wtChannel, int level, int quantParam) THROW_
 
UINT32 GetEncodedHeaderLength () const
 
void SetStreamPosToStart () THROW_
 Reset stream position to beginning of PGF pre-header.
 
void SetStreamPosToData () THROW_
 Reset stream position to beginning of data block.
 
void Skip (UINT64 offset) THROW_
 
void DequantizeValue (CSubband *band, UINT32 bandPos, int quantParam) THROW_
 
UINT32 ReadEncodedData (UINT8 *target, UINT32 len) const THROW_
 
void DecodeBuffer () THROW_
 
CPGFStreamGetStream ()
 
bool MacroBlocksAvailable () const
 
void DecodeTileBuffer () THROW_
 
void SkipTileBuffer () THROW_
 
void SetROI ()
 Enables region of interest (ROI) status.
 

Detailed Description

PGF decoder.

PGF decoder class.

Author
C. Stamm, R. Spuler

Constructor & Destructor Documentation

CDecoder::CDecoder ( CPGFStream stream,
PGFPreHeader preHeader,
PGFHeader header,
PGFPostHeader postHeader,
UINT32 *&  levelLength,
UINT64 &  userDataPos,
bool  useOMP,
bool  skipUserData 
)

Constructor: Read pre-header, header, and levelLength at current stream position. It might throw an IOException.

Parameters
streamA PGF stream
preHeader[out] A PGF pre-header
header[out] A PGF header
postHeader[out] A PGF post-header
levelLengthThe location of the levelLength array. The array is allocated in this method. The caller has to delete this array.
userDataPosThe stream position of the user data (metadata)
useOMPIf true, then the decoder will use multi-threading based on openMP
skipUserDataIf true, then user data is not read. In case of available user data, the file position is still returned in userDataPos.

Constructor Read pre-header, header, and levelLength It might throw an IOException.

Parameters
streamA PGF stream
preHeader[out] A PGF pre-header
header[out] A PGF header
postHeader[out] A PGF post-header
levelLengthThe location of the levelLength array. The array is allocated in this method. The caller has to delete this array.
userDataPosThe stream position of the user data (metadata)
useOMPIf true, then the decoder will use multi-threading based on openMP
skipUserDataIf true, then user data is not read. In case of available user data, the file position is still returned in userDataPos.

Member Function Documentation

void CDecoder::DecodeBuffer ( )

Reads stream and decodes tile buffer It might throw an IOException.

void CDecoder::DecodeInterleaved ( CWaveletTransform wtChannel,
int  level,
int  quantParam 
)

Deccoding and dequantization of HL and LH subband (interleaved) using partitioning scheme. Partitioning scheme: The plane is partitioned in squares of side length InterBlockSize. It might throw an IOException.

Parameters
wtChannelA wavelet transform channel containing the HL and HL band
levelWavelet transform level
quantParamDequantization value
void CDecoder::DecodeTileBuffer ( )

Reads stream and decodes tile buffer It might throw an IOException.

void CDecoder::DequantizeValue ( CSubband band,
UINT32  bandPos,
int  quantParam 
)

Dequantization of a single value at given position in subband. It might throw an IOException.

Parameters
bandA subband
bandPosA valid position in subband band
quantParamThe quantization parameter

Dequantization of a single value at given position in subband. If encoded data is available, then stores dequantized band value into buffer m_value at position m_valuePos. Otherwise reads encoded data block and decodes it. It might throw an IOException.

Parameters
bandA subband
bandPosA valid position in subband band
quantParamThe quantization parameter
UINT32 CDecoder::GetEncodedHeaderLength ( ) const
inline

Return the length of all encoded headers in bytes.

Returns
The length of all encoded headers in bytes
CPGFStream* CDecoder::GetStream ( )
inline
Returns
Stream
bool CDecoder::MacroBlocksAvailable ( ) const
inline
Returns
True if decoded macro blocks are available for processing
void CDecoder::Partition ( CSubband band,
int  quantParam,
int  width,
int  height,
int  startPos,
int  pitch 
)

Unpartitions a rectangular region of a given subband. Partitioning scheme: The plane is partitioned in squares of side length LinBlockSize. Read wavelet coefficients from the output buffer of a macro block. It might throw an IOException.

Parameters
bandA subband
quantParamDequantization value
widthThe width of the rectangle
heightThe height of the rectangle
startPosThe relative subband position of the top left corner of the rectangular region
pitchThe number of bytes in row of the subband
UINT32 CDecoder::ReadEncodedData ( UINT8 *  target,
UINT32  len 
) const

Copies data from the open stream to a target buffer. It might throw an IOException.

Parameters
targetThe target buffer
lenThe number of bytes to read
Returns
The number of bytes copied to the target buffer
void CDecoder::Skip ( UINT64  offset)

Skip a given number of bytes in the open stream. It might throw an IOException.

void CDecoder::SkipTileBuffer ( )

Resets stream position to next tile. It might throw an IOException.


The documentation for this class was generated from the following files: