PGF encoder.
More...
#include <Encoder.h>
|
| 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.
|
|
PGF encoder.
PGF encoder class.
- Author
- C. Stamm
Write pre-header, header, post-Header, and levelLength. It might throw an IOException.
- Parameters
-
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.
- Parameters
-
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 |
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.
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
-
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 |
void CEncoder::SetEncodedLevel |
( |
int |
currentLevel | ) |
|
|
inline |
Informs the encoder about the encoded level.
- Parameters
-
currentLevel | encoded 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
-
preHeader | An 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
-
levelLength | A 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
-
band | A subband |
bandPos | A valid position in subband band |
The documentation for this class was generated from the following files:
- /Users/ale/src/Scribus/scribus/third_party/pgf/Encoder.h
- /Users/ale/src/Scribus/scribus/third_party/pgf/Encoder.cpp