Scribus
Open source desktop publishing at your fingertips
CEncoder Class Reference

PGF encoder. More...

#include <Encoder.h>

Public Member Functions

 CEncoder (CPGFStream *stream, PGFPreHeader preHeader, PGFHeader header, const PGFPostHeader &postHeader, UINT64 &userDataPos, bool useOMP) THROW_
 
 ~CEncoder ()
 Destructor.
 
void FavorSpeedOverSize ()
 Encoder favors speed over compression size.
 
void Flush () THROW_
 
void UpdatePostHeaderSize (PGFPreHeader preHeader) THROW_
 
UINT32 WriteLevelLength (UINT32 *&levelLength) THROW_
 
UINT32 UpdateLevelLength () THROW_
 
void Partition (CSubband *band, int width, int height, int startPos, int pitch) THROW_
 
void SetEncodedLevel (int currentLevel)
 
void WriteValue (CSubband *band, int bandPos) THROW_
 
INT64 ComputeHeaderLength () const
 
INT64 ComputeBufferLength () const
 
INT64 ComputeOffset () const
 
void SetBufferStartPos ()
 Save current stream position as beginning of current level.
 
void EncodeTileBuffer () THROW_
 
void SetROI ()
 Enables region of interest (ROI) status.
 

Detailed Description

PGF encoder.

PGF encoder class.

Author
C. Stamm

Constructor & Destructor Documentation

CEncoder::CEncoder ( CPGFStream stream,
PGFPreHeader  preHeader,
PGFHeader  header,
const PGFPostHeader postHeader,
UINT64 &  userDataPos,
bool  useOMP 
)

Write pre-header, header, post-Header, and levelLength. It might throw an IOException.

Parameters
streamA PGF stream
preHeaderA already filled in PGF pre-header
headerAn already filled in PGF header
postHeader[in] An already filled in PGF post-header (containing color table, user data, ...)
userDataPos[out] File position of user data
useOMPIf true, then the encoder will use multi-threading based on openMP

Write pre-header, header, postHeader, and levelLength. It might throw an IOException.

Parameters
streamA PGF stream
preHeaderA already filled in PGF pre-header
headerAn already filled in PGF header
postHeader[in] An already filled in PGF post-header (containing color table, user data, ...)
userDataPos[out] File position of user data
useOMPIf true, then the encoder will use multi-threading based on openMP

Member Function Documentation

INT64 CEncoder::ComputeBufferLength ( ) const
inline

Compute stream length of encoded buffer.

Returns
encoded buffer length
INT64 CEncoder::ComputeHeaderLength ( ) const
inline

Compute stream length of header.

Returns
header length
INT64 CEncoder::ComputeOffset ( ) const
inline

Compute file offset between real and expected levelLength position.

Returns
file offset
void CEncoder::EncodeTileBuffer ( )
inline

Encodes tile buffer and writes it into stream It might throw an IOException.

void CEncoder::Flush ( )

Pad buffer with zeros and encode buffer. It might throw an IOException.

void CEncoder::Partition ( CSubband band,
int  width,
int  height,
int  startPos,
int  pitch 
)

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

Parameters
bandA subband
widthThe width of the rectangle
heightThe height of the rectangle
startPosThe absolute subband position of the top left corner of the rectangular region
pitchThe number of bytes in row of the subband
void CEncoder::SetEncodedLevel ( int  currentLevel)
inline

Informs the encoder about the encoded level.

Parameters
currentLevelencoded level [0, nLevels)
UINT32 CEncoder::UpdateLevelLength ( )

Write new levelLength into stream. It might throw an IOException.

Returns
Written image bytes.
void CEncoder::UpdatePostHeaderSize ( PGFPreHeader  preHeader)

Increase post-header size and write new size into stream.

Parameters
preHeaderAn already filled in PGF pre-header It might throw an IOException.
UINT32 CEncoder::WriteLevelLength ( UINT32 *&  levelLength)

Create level length data structure and write a place holder into stream. It might throw an IOException.

Parameters
levelLengthA reference to an integer array, large enough to save the relative file positions of all PGF levels
Returns
number of bytes written into stream
void CEncoder::WriteValue ( CSubband band,
int  bandPos 
)

Write a single value into subband at given position. It might throw an IOException.

Parameters
bandA subband
bandPosA valid position in subband band

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