libpgf
6.11.42
PGF - Progressive Graphics File
|
PGF encoder. More...
#include <Encoder.h>
Classes | |
class | CMacroBlock |
A macro block is an encoding unit of fixed size (uncoded) More... |
Public Member Functions | |
CEncoder (CPGFStream *stream, PGFPreHeader preHeader, PGFHeader header, const PGFPostHeader &postHeader, UINT32 *&levelLength, bool useOMP=true) THROW_ | |
~CEncoder () | |
void | FavorSpeedOverSize () |
void | Flush () THROW_ |
UINT32 | WriteLevelLength () 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_ |
UINT32 | ComputeHeaderLength () const |
UINT32 | ComputeBufferLength () const |
void | SetBufferStartPos () |
Private Member Functions | |
void | EncodeBuffer (ROIBlockHeader h) THROW_ |
void | WriteMacroBlock (CMacroBlock *block) THROW_ |
Private Attributes | |
CPGFStream * | m_stream |
UINT64 | m_startPosition |
file position of PGF start (PreHeader) | |
UINT64 | m_levelLengthPos |
file position of Metadata | |
UINT64 | m_bufferStartPos |
file position of encoded buffer | |
CMacroBlock ** | m_macroBlocks |
array of macroblocks | |
int | m_macroBlockLen |
array length | |
int | m_lastMacroBlock |
array index of the last created macro block | |
CMacroBlock * | m_currentBlock |
current macro block (used by main thread) | |
UINT32 * | m_levelLength |
temporary saves the level index | |
int | m_currLevelIndex |
counts where (=index) to save next value | |
UINT8 | m_nLevels |
number of levels | |
bool | m_favorSpeed |
favor speed over size | |
bool | m_forceWriting |
all macro blocks have to be written into the stream |
CEncoder::CEncoder | ( | CPGFStream * | stream, |
PGFPreHeader | preHeader, | ||
PGFHeader | header, | ||
const PGFPostHeader & | postHeader, | ||
UINT32 *& | levelLength, | ||
bool | useOMP = true |
||
) |
Write pre-header, header, postHeader, and levelLength. It might throw an IOException.
stream | A PGF stream |
preHeader | A already filled in PGF pre header |
header | An already filled in PGF header |
postHeader | [in] A already filled in PGF post header (containing color table, user data, ...) |
levelLength | A reference to an integer array, large enough to save the relative file positions of all PGF levels |
useOMP | If true, then the encoder will use multi-threading based on openMP |
Definition at line 66 of file Encoder.cpp.
CEncoder::~CEncoder | ( | ) |
Destructor
Definition at line 146 of file Encoder.cpp.
|
inline |
|
inline |
|
private |
Definition at line 287 of file Encoder.cpp.
|
inline |
Encoder favors speed over compression size
Definition at line 116 of file Encoder.h.
void CEncoder::Flush | ( | ) |
Pad buffer with zeros and encode buffer. It might throw an IOException.
Definition at line 225 of file Encoder.cpp.
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 into buffer. It might throw an IOException.
band | A subband |
width | The width of the rectangle |
height | The height of the rectangle |
startPos | The buffer position of the top left corner of the rectangular region |
pitch | The number of bytes in row of the subband |
Definition at line 161 of file Encoder.cpp.
|
inline |
|
inline |
Informs the encoder about the encoded level.
currentLevel | encoded level [0, nLevels) |
Definition at line 144 of file Encoder.h.
UINT32 CEncoder::WriteLevelLength | ( | ) |
Write levelLength into header.
Definition at line 239 of file Encoder.cpp.
|
private |
Definition at line 346 of file Encoder.cpp.
void CEncoder::WriteValue | ( | CSubband * | band, |
int | bandPos | ||
) |
Write a single value into subband at given position. It might throw an IOException.
band | A subband |
bandPos | A valid position in subband band |
Definition at line 272 of file Encoder.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |