|
libpgf 6.14.12
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, 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. | |
Private Member Functions | |
| void | EncodeBuffer (ROIBlockHeader h) THROW_ |
| void | WriteMacroBlock (CMacroBlock *block) THROW_ |
Private Attributes | |
| CPGFStream * | m_stream |
| output PMF stream | |
| UINT64 | m_startPosition |
| stream position of PGF start (PreHeader) | |
| UINT64 | m_levelLengthPos |
| stream position of Metadata | |
| UINT64 | m_bufferStartPos |
| stream 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, | ||
| UINT64 & | userDataPos, | ||
| bool | useOMP ) |
Write pre-header, header, post-Header, 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] An already filled in PGF post-header (containing color table, user data, ...) |
| userDataPos | [out] File position of user data |
| useOMP | If true, then the encoder will use multi-threading based on openMP |
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] An already filled in PGF post-header (containing color table, user data, ...) |
| userDataPos | [out] File position of user data |
| useOMP | If true, then the encoder will use multi-threading based on openMP |
Definition at line 70 of file Encoder.cpp.
| CEncoder::~CEncoder | ( | ) |
|
inline |
|
inline |
|
inline |
|
private |
Definition at line 341 of file Encoder.cpp.
|
inline |
| void CEncoder::Flush | ( | ) |
Pad buffer with zeros and encode buffer. It might throw an IOException.
Definition at line 310 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 from subband into the input buffer of a macro block. It might throw an IOException.
| band | A subband |
| width | The width of the rectangle |
| height | The height of the rectangle |
| startPos | The absolute subband position of the top left corner of the rectangular region |
| pitch | The number of bytes in row of the subband |
Definition at line 246 of file Encoder.cpp.
|
inline |
|
inline |
Informs the encoder about the encoded level.
| currentLevel | encoded level [0, nLevels) |
Definition at line 162 of file Encoder.h.
| UINT32 CEncoder::UpdateLevelLength | ( | ) |
Write new levelLength into stream. It might throw an IOException.
Definition at line 202 of file Encoder.cpp.
| void CEncoder::UpdatePostHeaderSize | ( | PGFPreHeader | preHeader | ) |
Increase post-header size and write new size into stream.
| preHeader | An already filled in PGF pre-header It might throw an IOException. |
Definition at line 160 of file Encoder.cpp.
| UINT32 CEncoder::WriteLevelLength | ( | UINT32 *& | levelLength | ) |
Create level length data structure and write a place holder into stream. It might throw an IOException.
| levelLength | A reference to an integer array, large enough to save the relative file positions of all PGF levels |
Definition at line 177 of file Encoder.cpp.
|
private |
Definition at line 406 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 326 of file Encoder.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |