libpgf
6.14.12
PGF - Progressive Graphics File
|
PGF main class. More...
#include <PGFimage.h>
Public Member Functions | |
CPGFImage () | |
Standard constructor: It is used to create a PGF instance for opening and reading. More... | |
virtual | ~CPGFImage () |
Destructor: Destroy internal data structures. More... | |
virtual void | Close () |
virtual void | Destroy () |
void | Open (CPGFStream *stream) THROW_ |
bool | IsOpen () const |
Returns true if the PGF has been opened and not closed. More... | |
void | Read (int level=0, CallbackPtr cb=NULL, void *data=NULL) THROW_ |
void | Read (PGFRect &rect, int level=0, CallbackPtr cb=NULL, void *data=NULL) THROW_ |
void | ReadPreview () THROW_ |
void | Reconstruct (int level=0) THROW_ |
void | GetBitmap (int pitch, UINT8 *buff, BYTE bpp, int channelMap[]=NULL, CallbackPtr cb=NULL, void *data=NULL) const THROW_ |
void | GetYUV (int pitch, DataT *buff, BYTE bpp, int channelMap[]=NULL, CallbackPtr cb=NULL, void *data=NULL) const THROW_ |
void | ImportBitmap (int pitch, UINT8 *buff, BYTE bpp, int channelMap[]=NULL, CallbackPtr cb=NULL, void *data=NULL) THROW_ |
void | ImportYUV (int pitch, DataT *buff, BYTE bpp, int channelMap[]=NULL, CallbackPtr cb=NULL, void *data=NULL) THROW_ |
void | Write (CPGFStream *stream, UINT32 *nWrittenBytes=NULL, CallbackPtr cb=NULL, void *data=NULL) THROW_ |
UINT32 | WriteHeader (CPGFStream *stream) THROW_ |
UINT32 | WriteImage (CPGFStream *stream, CallbackPtr cb=NULL, void *data=NULL) THROW_ |
UINT32 | Write (int level, CallbackPtr cb=NULL, void *data=NULL) THROW_ |
void | ConfigureEncoder (bool useOMP=true, bool favorSpeedOverSize=false) |
void | ConfigureDecoder (bool useOMP=true, bool skipUserData=false) |
void | ResetStreamPos () THROW_ |
Reset stream position to start of PGF pre-header. More... | |
void | SetChannel (DataT *channel, int c=0) |
void | SetHeader (const PGFHeader &header, BYTE flags=0, UINT8 *userData=0, UINT32 userDataLength=0) THROW_ |
void | SetMaxValue (UINT32 maxValue) |
void | SetProgressMode (ProgressMode pm) |
void | SetRefreshCallback (RefreshCB callback, void *arg) |
void | SetColorTable (UINT32 iFirstColor, UINT32 nColors, const RGBQUAD *prgbColors) THROW_ |
DataT * | GetChannel (int c=0) |
void | GetColorTable (UINT32 iFirstColor, UINT32 nColors, RGBQUAD *prgbColors) const THROW_ |
const RGBQUAD * | GetColorTable () const |
const PGFHeader * | GetHeader () const |
UINT32 | GetMaxValue () const |
UINT64 | GetUserDataPos () const |
const UINT8 * | GetUserData (UINT32 &size) const |
UINT32 | GetEncodedHeaderLength () const |
UINT32 | GetEncodedLevelLength (int level) const |
UINT32 | ReadEncodedHeader (UINT8 *target, UINT32 targetLen) const THROW_ |
UINT32 | ReadEncodedData (int level, UINT8 *target, UINT32 targetLen) const THROW_ |
UINT32 | ChannelWidth (int c=0) const |
UINT32 | ChannelHeight (int c=0) const |
BYTE | ChannelDepth () const |
UINT32 | Width (int level=0) const |
UINT32 | Height (int level=0) const |
BYTE | Level () const |
BYTE | Levels () const |
BYTE | Quality () const |
BYTE | Channels () const |
BYTE | Mode () const |
BYTE | BPP () const |
bool | ROIisSupported () const |
BYTE | UsedBitsPerChannel () const |
BYTE | Version () const |
Static Public Member Functions | |
static bool | ImportIsSupported (BYTE mode) |
static UINT32 | LevelWidth (UINT32 width, int level) |
static UINT32 | LevelHeight (UINT32 height, int level) |
static BYTE | CurrentVersion (BYTE version=PGFVersion) |
Return version. More... | |
static BYTE | CurrentChannelDepth (BYTE version=PGFVersion) |
Protected Attributes | |
CWaveletTransform * | m_wtChannel [MaxChannels] |
wavelet transformed color channels More... | |
DataT * | m_channel [MaxChannels] |
untransformed channels in YUV format More... | |
CDecoder * | m_decoder |
PGF decoder. More... | |
CEncoder * | m_encoder |
PGF encoder. More... | |
UINT32 * | m_levelLength |
length of each level in bytes; first level starts immediately after this array More... | |
UINT32 | m_width [MaxChannels] |
width of each channel at current level More... | |
UINT32 | m_height [MaxChannels] |
height of each channel at current level More... | |
PGFPreHeader | m_preHeader |
PGF pre-header. More... | |
PGFHeader | m_header |
PGF file header. More... | |
PGFPostHeader | m_postHeader |
PGF post-header. More... | |
UINT64 | m_userDataPos |
stream position of user data More... | |
int | m_currentLevel |
transform level of current image More... | |
BYTE | m_quant |
quantization parameter More... | |
bool | m_downsample |
chrominance channels are downsampled More... | |
bool | m_favorSpeedOverSize |
favor encoding speed over compression ratio More... | |
bool | m_useOMPinEncoder |
use Open MP in encoder More... | |
bool | m_useOMPinDecoder |
use Open MP in decoder More... | |
bool | m_skipUserData |
skip user data (metadata) during open More... | |
bool | m_streamReinitialized |
stream has been reinitialized More... | |
PGFRect | m_roi |
region of interest More... | |
Private Member Functions | |
void | ComputeLevels () |
bool | CompleteHeader () |
void | RgbToYuv (int pitch, UINT8 *rgbBuff, BYTE bpp, int channelMap[], CallbackPtr cb, void *data) THROW_ |
void | Downsample (int nChannel) |
UINT32 | UpdatePostHeaderSize () THROW_ |
void | WriteLevel () THROW_ |
void | SetROI (PGFRect rect) |
UINT8 | Clamp4 (DataT v) const |
UINT16 | Clamp6 (DataT v) const |
UINT8 | Clamp8 (DataT v) const |
UINT16 | Clamp16 (DataT v) const |
UINT32 | Clamp31 (DataT v) const |
Private Attributes | |
RefreshCB | m_cb |
pointer to refresh callback procedure More... | |
void * | m_cbArg |
refresh callback argument More... | |
double | m_percent |
progress [0..1] More... | |
ProgressMode | m_progressMode |
progress mode used in Read and Write; PM_Relative is default mode More... | |
PGF main class.
PGF image class is the main class. You always need a PGF object for encoding or decoding image data. Decoding: pgf.Open(...) pgf.Read(...) pgf.GetBitmap(...) Encoding: pgf.SetHeader(...) pgf.ImportBitmap(...) pgf.Write(...)
Definition at line 57 of file PGFimage.h.
CPGFImage::CPGFImage | ( | ) |
Standard constructor: It is used to create a PGF instance for opening and reading.
Definition at line 55 of file PGFimage.cpp.
|
virtual |
Destructor: Destroy internal data structures.
Definition at line 98 of file PGFimage.cpp.
|
inline |
Return the number of bits per pixel. Valid values can be 1, 8, 12, 16, 24, 32, 48, 64.
Definition at line 460 of file PGFimage.h.
|
inline |
Return bits per channel of the image's encoder.
Definition at line 409 of file PGFimage.h.
|
inline |
Return current image height of given channel in pixels. The returned height depends on the levels read so far and on ROI.
c | A channel index |
Definition at line 404 of file PGFimage.h.
|
inline |
Return the number of image channels. An image of type RGB contains 3 image channels (B, G, R).
Definition at line 447 of file PGFimage.h.
|
inline |
Return current image width of given channel in pixels. The returned width depends on the levels read so far and on ROI.
c | A channel index |
Definition at line 397 of file PGFimage.h.
|
inlineprivate |
Definition at line 561 of file PGFimage.h.
|
inlineprivate |
Definition at line 564 of file PGFimage.h.
|
inlineprivate |
Definition at line 551 of file PGFimage.h.
|
inlineprivate |
Definition at line 554 of file PGFimage.h.
|
inlineprivate |
Definition at line 557 of file PGFimage.h.
|
virtual |
Close PGF image after opening and reading. Destructor calls this method during destruction.
Definition at line 122 of file PGFimage.cpp.
|
private |
Definition at line 208 of file PGFimage.cpp.
|
private |
Definition at line 804 of file PGFimage.cpp.
|
inline |
Configures the decoder.
useOMP | Use parallel threading with Open MP during decoding. Default value: true. Influences the decoding only if the codec has been compiled with OpenMP support. |
skipUserData | The file might contain user data (metadata). User data ist usually read during Open and stored in memory. Set this flag to false when storing in memory is not needed. |
Definition at line 266 of file PGFimage.h.
|
inline |
Configures the encoder.
useOMP | Use parallel threading with Open MP during encoding. Default value: true. Influences the encoding only if the codec has been compiled with OpenMP support. |
favorSpeedOverSize | Favors encoding speed over compression ratio. Default value: false |
Definition at line 260 of file PGFimage.h.
|
inlinestatic |
Compute and return codec version.
Definition at line 508 of file PGFimage.h.
|
static |
Return version.
Compute and return codec version.
Definition at line 720 of file PGFimage.cpp.
|
virtual |
Destroy internal data structures. Destructor calls this method during destruction.
Definition at line 105 of file PGFimage.cpp.
|
private |
Definition at line 760 of file PGFimage.cpp.
void CPGFImage::GetBitmap | ( | int | pitch, |
UINT8 * | buff, | ||
BYTE | bpp, | ||
int | channelMap[] = NULL , |
||
CallbackPtr | cb = NULL , |
||
void * | data = NULL |
||
) | const |
Get image data in interleaved format: (ordering of RGB data is BGR[A]) Upsampling, YUV to RGB transform and interleaving are done here to reduce the number of passes over the data. The absolute value of pitch is the number of bytes of an image row of the given image buffer. If pitch is negative, then the image buffer must point to the last row of a bottom-up image (first byte on last row). if pitch is positive, then the image buffer must point to the first row of a top-down image (first byte). The sequence of output channels in the output image buffer does not need to be the same as provided by PGF. In case of different sequences you have to provide a channelMap of size of expected channels (depending on image mode). For example, PGF provides a channel sequence BGR in RGB color mode. If your provided image buffer expects a channel sequence ARGB, then the channelMap looks like { 3, 2, 1, 0 }. It might throw an IOException.
pitch | The number of bytes of a row of the image buffer. |
buff | An image buffer. |
bpp | The number of bits per pixel used in image buffer. |
channelMap | A integer array containing the mapping of PGF channel ordering to expected channel ordering. |
cb | A pointer to a callback procedure. The procedure is called after each copied buffer row. If cb returns true, then it stops proceeding. |
data | Data Pointer to C++ class container to host callback procedure. |
Definition at line 1720 of file PGFimage.cpp.
|
inline |
Return an internal YUV image channel.
c | A channel index |
Definition at line 321 of file PGFimage.h.
|
inline |
void CPGFImage::GetColorTable | ( | UINT32 | iFirstColor, |
UINT32 | nColors, | ||
RGBQUAD * | prgbColors | ||
) | const |
Retrieves red, green, blue (RGB) color values from a range of entries in the palette of the DIB section. It might throw an IOException.
iFirstColor | The color table index of the first entry to retrieve. |
nColors | The number of color table entries to retrieve. |
prgbColors | A pointer to the array of RGBQUAD structures to retrieve the color table entries. |
Definition at line 1292 of file PGFimage.cpp.
UINT32 CPGFImage::GetEncodedHeaderLength | ( | ) | const |
Return the length of all encoded headers in bytes. Precondition: The PGF image has been opened with a call of Open(...).
Definition at line 613 of file PGFimage.cpp.
|
inline |
Return the length of an encoded PGF level in bytes. Precondition: The PGF image has been opened with a call of Open(...).
level | The image level |
Definition at line 370 of file PGFimage.h.
|
inline |
Return the PGF header structure.
Definition at line 339 of file PGFimage.h.
|
inline |
Get maximum intensity value for image modes with more than eight bits per channel. Don't call this method before the PGF header has been read.
Definition at line 345 of file PGFimage.h.
const UINT8 * CPGFImage::GetUserData | ( | UINT32 & | size | ) | const |
Return user data and size of user data. Precondition: The PGF image has been opened with a call of Open(...).
size | [out] Size of user data in bytes. |
Definition at line 322 of file PGFimage.cpp.
|
inline |
Return the stream position of the user data or 0. Precondition: The PGF image has been opened with a call of Open(...).
Definition at line 350 of file PGFimage.h.
void CPGFImage::GetYUV | ( | int | pitch, |
DataT * | buff, | ||
BYTE | bpp, | ||
int | channelMap[] = NULL , |
||
CallbackPtr | cb = NULL , |
||
void * | data = NULL |
||
) | const |
Get YUV image data in interleaved format: (ordering is YUV[A]) The absolute value of pitch is the number of bytes of an image row of the given image buffer. If pitch is negative, then the image buffer must point to the last row of a bottom-up image (first byte on last row). if pitch is positive, then the image buffer must point to the first row of a top-down image (first byte). The sequence of output channels in the output image buffer does not need to be the same as provided by PGF. In case of different sequences you have to provide a channelMap of size of expected channels (depending on image mode). For example, PGF provides a channel sequence BGR in RGB color mode. If your provided image buffer expects a channel sequence VUY, then the channelMap looks like { 2, 1, 0 }. It might throw an IOException.
pitch | The number of bytes of a row of the image buffer. |
buff | An image buffer. |
bpp | The number of bits per pixel used in image buffer. |
channelMap | A integer array containing the mapping of PGF channel ordering to expected channel ordering. |
cb | A pointer to a callback procedure. The procedure is called after each copied buffer row. If cb returns true, then it stops proceeding. |
data | Data Pointer to C++ class container to host callback procedure. |
Get YUV image data in interleaved format: (ordering is YUV[A]) The absolute value of pitch is the number of bytes of an image row of the given image buffer. If pitch is negative, then the image buffer must point to the last row of a bottom-up image (first byte on last row). if pitch is positive, then the image buffer must point to the first row of a top-down image (first byte). The sequence of output channels in the output image buffer does not need to be the same as provided by PGF. In case of different sequences you have to provide a channelMap of size of expected channels (depending on image mode). For example, PGF provides a channel sequence BGR in RGB color mode. If your provided image buffer expects a channel sequence VUY, then the channelMap looks like { 2, 1, 0 }. It might throw an IOException.
pitch | The number of bytes of a row of the image buffer. |
buff | An image buffer. |
bpp | The number of bits per pixel used in image buffer. |
channelMap | A integer array containing the mapping of PGF channel ordering to expected channel ordering. |
cb | A pointer to a callback procedure. The procedure is called after each copied buffer row. If cb returns true, then it stops proceeding. |
Definition at line 2478 of file PGFimage.cpp.
|
inline |
Return image height of channel 0 at given level in pixels. The returned height is independent of any Read-operations and ROI.
level | A level |
Definition at line 423 of file PGFimage.h.
void CPGFImage::ImportBitmap | ( | int | pitch, |
UINT8 * | buff, | ||
BYTE | bpp, | ||
int | channelMap[] = NULL , |
||
CallbackPtr | cb = NULL , |
||
void * | data = NULL |
||
) |
Import an image from a specified image buffer. This method is usually called before Write(...) and after SetHeader(...). The absolute value of pitch is the number of bytes of an image row. If pitch is negative, then buff points to the last row of a bottom-up image (first byte on last row). If pitch is positive, then buff points to the first row of a top-down image (first byte). The sequence of input channels in the input image buffer does not need to be the same as expected from PGF. In case of different sequences you have to provide a channelMap of size of expected channels (depending on image mode). For example, PGF expects in RGB color mode a channel sequence BGR. If your provided image buffer contains a channel sequence ARGB, then the channelMap looks like { 3, 2, 1, 0 }. It might throw an IOException.
pitch | The number of bytes of a row of the image buffer. |
buff | An image buffer. |
bpp | The number of bits per pixel used in image buffer. |
channelMap | A integer array containing the mapping of input channel ordering to expected channel ordering. |
cb | A pointer to a callback procedure. The procedure is called after each imported buffer row. If cb returns true, then it stops proceeding. |
data | Data Pointer to C++ class container to host callback procedure. |
Definition at line 743 of file PGFimage.cpp.
|
static |
Check for valid import image mode.
mode | Image mode |
Definition at line 1247 of file PGFimage.cpp.
void CPGFImage::ImportYUV | ( | int | pitch, |
DataT * | buff, | ||
BYTE | bpp, | ||
int | channelMap[] = NULL , |
||
CallbackPtr | cb = NULL , |
||
void * | data = NULL |
||
) |
Import a YUV image from a specified image buffer. The absolute value of pitch is the number of bytes of an image row. If pitch is negative, then buff points to the last row of a bottom-up image (first byte on last row). If pitch is positive, then buff points to the first row of a top-down image (first byte). The sequence of input channels in the input image buffer does not need to be the same as expected from PGF. In case of different sequences you have to provide a channelMap of size of expected channels (depending on image mode). For example, PGF expects in RGB color mode a channel sequence BGR. If your provided image buffer contains a channel sequence VUY, then the channelMap looks like { 2, 1, 0 }. It might throw an IOException.
pitch | The number of bytes of a row of the image buffer. |
buff | An image buffer. |
bpp | The number of bits per pixel used in image buffer. |
channelMap | A integer array containing the mapping of input channel ordering to expected channel ordering. |
cb | A pointer to a callback procedure. The procedure is called after each imported buffer row. If cb returns true, then it stops proceeding. |
data | Data Pointer to C++ class container to host callback procedure. |
Import a YUV image from a specified image buffer. The absolute value of pitch is the number of bytes of an image row. If pitch is negative, then buff points to the last row of a bottom-up image (first byte on last row). If pitch is positive, then buff points to the first row of a top-down image (first byte). The sequence of input channels in the input image buffer does not need to be the same as expected from PGF. In case of different sequences you have to provide a channelMap of size of expected channels (depending on image mode). For example, PGF expects in RGB color mode a channel sequence BGR. If your provided image buffer contains a channel sequence VUY, then the channelMap looks like { 2, 1, 0 }. It might throw an IOException.
pitch | The number of bytes of a row of the image buffer. |
buff | An image buffer. |
bpp | The number of bits per pixel used in image buffer. |
channelMap | A integer array containing the mapping of input channel ordering to expected channel ordering. |
cb | A pointer to a callback procedure. The procedure is called after each imported buffer row. If cb returns true, then it stops proceeding. |
Definition at line 2589 of file PGFimage.cpp.
|
inline |
|
inline |
Return current image level. Since Read(...) can be used to read each image level separately, it is helpful to know the current level. The current level immediately after Open(...) is Levels().
Definition at line 430 of file PGFimage.h.
|
inlinestatic |
Compute and return image height at given level.
height | Original image height (at level 0) |
level | An image level |
Definition at line 498 of file PGFimage.h.
|
inline |
Return the number of image levels.
Definition at line 435 of file PGFimage.h.
|
inlinestatic |
Compute and return image width at given level.
width | Original image width (at level 0) |
level | An image level |
Definition at line 491 of file PGFimage.h.
|
inline |
Return the image mode. An image mode is a predefined constant value (see also PGFtypes.h) compatible with Adobe Photoshop. It represents an image type and format.
Definition at line 454 of file PGFimage.h.
void CPGFImage::Open | ( | CPGFStream * | stream | ) |
Open a PGF image at current stream position: read pre-header, header, and ckeck image type. Precondition: The stream has been opened for reading. It might throw an IOException.
stream | A PGF stream |
Definition at line 131 of file PGFimage.cpp.
|
inline |
Return the PGF quality. The quality is inbetween 0 and MaxQuality. PGF quality 0 means lossless quality.
Definition at line 441 of file PGFimage.h.
void CPGFImage::Read | ( | int | level = 0 , |
CallbackPtr | cb = NULL , |
||
void * | data = NULL |
||
) |
Read and decode some levels of a PGF image at current stream position. A PGF image is structered in levels, numbered between 0 and Levels() - 1. Each level can be seen as a single image, containing the same content as all other levels, but in a different size (width, height). The image size at level i is double the size (width, height) of the image at level i+1. The image at level 0 contains the original size. Precondition: The PGF image has been opened with a call of Open(...). It might throw an IOException.
level | [0, nLevels) The image level of the resulting image in the internal image buffer. |
cb | A pointer to a callback procedure. The procedure is called after reading a single level. If cb returns true, then it stops proceeding. |
data | Data Pointer to C++ class container to host callback procedure. |
Definition at line 384 of file PGFimage.cpp.
void CPGFImage::Read | ( | PGFRect & | rect, |
int | level = 0 , |
||
CallbackPtr | cb = NULL , |
||
void * | data = NULL |
||
) |
Read a rectangular region of interest of a PGF image at current stream position. The origin of the coordinate axis is the top-left corner of the image. All coordinates are measured in pixels. It might throw an IOException.
rect | [inout] Rectangular region of interest (ROI). The rect might be cropped. |
level | [0, nLevels) The image level of the resulting image in the internal image buffer. |
cb | A pointer to a callback procedure. The procedure is called after reading a single level. If cb returns true, then it stops proceeding. |
data | Data Pointer to C++ class container to host callback procedure. |
UINT32 CPGFImage::ReadEncodedData | ( | int | level, |
UINT8 * | target, | ||
UINT32 | targetLen | ||
) | const |
Reads the data of an encoded PGF level and copies it to a target buffer without decoding. Precondition: The PGF image has been opened with a call of Open(...). It might throw an IOException.
level | The image level |
target | The target buffer |
targetLen | The length of the target buffer in bytes |
Definition at line 659 of file PGFimage.cpp.
UINT32 CPGFImage::ReadEncodedHeader | ( | UINT8 * | target, |
UINT32 | targetLen | ||
) | const |
Reads the encoded PGF headers and copies it to a target buffer. Precondition: The PGF image has been opened with a call of Open(...). It might throw an IOException.
target | The target buffer |
targetLen | The length of the target buffer in bytes |
Definition at line 625 of file PGFimage.cpp.
|
inline |
Read and decode smallest level of a PGF image at current stream position. For details, please refert to Read(...) Precondition: The PGF image has been opened with a call of Open(...). It might throw an IOException.
Definition at line 121 of file PGFimage.h.
void CPGFImage::Reconstruct | ( | int | level = 0 | ) |
After you've written a PGF image, you can call this method followed by GetBitmap/GetYUV to get a quick reconstruction (coded -> decoded image). It might throw an IOException.
level | The image level of the resulting image in the internal image buffer. |
Definition at line 332 of file PGFimage.cpp.
void CPGFImage::ResetStreamPos | ( | ) |
Reset stream position to start of PGF pre-header.
Definition at line 645 of file PGFimage.cpp.
|
private |
Definition at line 1331 of file PGFimage.cpp.
|
inline |
Return true if the pgf image supports Region Of Interest (ROI).
Definition at line 465 of file PGFimage.h.
|
inline |
Set internal PGF image buffer channel.
channel | A YUV data channel |
c | A channel index |
Definition at line 276 of file PGFimage.h.
void CPGFImage::SetColorTable | ( | UINT32 | iFirstColor, |
UINT32 | nColors, | ||
const RGBQUAD * | prgbColors | ||
) |
Sets the red, green, blue (RGB) color values for a range of entries in the palette (clut). It might throw an IOException.
iFirstColor | The color table index of the first entry to set. |
nColors | The number of color table entries to set. |
prgbColors | A pointer to the array of RGBQUAD structures to set the color table entries. |
Definition at line 1306 of file PGFimage.cpp.
void CPGFImage::SetHeader | ( | const PGFHeader & | header, |
BYTE | flags = 0 , |
||
UINT8 * | userData = 0 , |
||
UINT32 | userDataLength = 0 |
||
) |
Set PGF header and user data. Precondition: The PGF image has been closed with Close(...) or never opened with Open(...). It might throw an IOException.
header | A valid and already filled in PGF header structure |
flags | A combination of additional version flags. In case you use level-wise encoding then set flag = PGFROI. |
userData | A user-defined memory block containing any kind of cached metadata. |
userDataLength | The size of user-defined memory block in bytes |
Definition at line 844 of file PGFimage.cpp.
void CPGFImage::SetMaxValue | ( | UINT32 | maxValue | ) |
Set maximum intensity value for image modes with more than eight bits per channel. Call this method after SetHeader, but before ImportBitmap.
maxValue | The maximum intensity value. |
Definition at line 690 of file PGFimage.cpp.
|
inline |
Set progress mode used in Read and Write. Default mode is PM_Relative. This method must be called before Open() or SetHeader(). PM_Relative: 100% = level difference between current level and target level of Read/Write PM_Absolute: 100% = number of levels
Definition at line 300 of file PGFimage.h.
|
inline |
Set refresh callback procedure and its parameter. The refresh callback is called during Read(...) after each level read.
callback | A refresh callback procedure |
arg | A parameter of the refresh callback procedure |
Definition at line 307 of file PGFimage.h.
|
private |
|
private |
Definition at line 1067 of file PGFimage.cpp.
BYTE CPGFImage::UsedBitsPerChannel | ( | ) | const |
Returns number of used bits per input/output image channel. Precondition: header must be initialized.
Definition at line 708 of file PGFimage.cpp.
|
inline |
Returns images' PGF version
Definition at line 476 of file PGFimage.h.
|
inline |
Return image width of channel 0 at given level in pixels. The returned width is independent of any Read-operations and ROI.
level | A level |
Definition at line 416 of file PGFimage.h.
void CPGFImage::Write | ( | CPGFStream * | stream, |
UINT32 * | nWrittenBytes = NULL , |
||
CallbackPtr | cb = NULL , |
||
void * | data = NULL |
||
) |
Encode and write a entire PGF image (header and image) at current stream position. A PGF image is structered in levels, numbered between 0 and Levels() - 1. Each level can be seen as a single image, containing the same content as all other levels, but in a different size (width, height). The image size at level i is double the size (width, height) of the image at level i+1. The image at level 0 contains the original size. Precondition: the PGF image contains a valid header (see also SetHeader(...)). It might throw an IOException.
stream | A PGF stream |
nWrittenBytes | [in-out] The number of bytes written into stream are added to the input value. |
cb | A pointer to a callback procedure. The procedure is called after writing a single level. If cb returns true, then it stops proceeding. |
data | Data Pointer to C++ class container to host callback procedure. |
Definition at line 1163 of file PGFimage.cpp.
UINT32 CPGFImage::Write | ( | int | level, |
CallbackPtr | cb = NULL , |
||
void * | data = NULL |
||
) |
Encode and write down to given level at current stream position. A PGF image is structered in levels, numbered between 0 and Levels() - 1. Each level can be seen as a single image, containing the same content as all other levels, but in a different size (width, height). The image size at level i is double the size (width, height) of the image at level i+1. The image at level 0 contains the original size. Preconditions: the PGF image contains a valid header (see also SetHeader(...)) and WriteHeader() has been called before. Levels() > 0. The ROI encoding scheme must be used (see also SetHeader(...)). It might throw an IOException.
level | [0, nLevels) The image level of the resulting image in the internal image buffer. |
cb | A pointer to a callback procedure. The procedure is called after writing a single level. If cb returns true, then it stops proceeding. |
data | Data Pointer to C++ class container to host callback procedure. |
UINT32 CPGFImage::WriteHeader | ( | CPGFStream * | stream | ) |
Create wavelet transform channels and encoder. Write header at current stream position. Call this method before your first call of Write(int level) or WriteImage(), but after SetHeader(). This method is called inside of Write(stream, ...). It might throw an IOException.
stream | A PGF stream |
Definition at line 923 of file PGFimage.cpp.
UINT32 CPGFImage::WriteImage | ( | CPGFStream * | stream, |
CallbackPtr | cb = NULL , |
||
void * | data = NULL |
||
) |
Encode and write the one and only image at current stream position. Call this method after WriteHeader(). In case you want to write uncached metadata, then do that after WriteHeader() and before WriteImage(). This method is called inside of Write(stream, ...). It might throw an IOException.
stream | A PGF stream |
cb | A pointer to a callback procedure. The procedure is called after writing a single level. If cb returns true, then it stops proceeding. |
data | Data Pointer to C++ class container to host callback procedure. |
Definition at line 1092 of file PGFimage.cpp.
|
private |
Definition at line 1012 of file PGFimage.cpp.
|
private |
pointer to refresh callback procedure
Definition at line 535 of file PGFimage.h.
|
private |
refresh callback argument
Definition at line 536 of file PGFimage.h.
|
protected |
untransformed channels in YUV format
Definition at line 512 of file PGFimage.h.
|
protected |
transform level of current image
Definition at line 522 of file PGFimage.h.
|
protected |
PGF decoder.
Definition at line 513 of file PGFimage.h.
|
protected |
chrominance channels are downsampled
Definition at line 524 of file PGFimage.h.
|
protected |
PGF encoder.
Definition at line 514 of file PGFimage.h.
|
protected |
favor encoding speed over compression ratio
Definition at line 525 of file PGFimage.h.
|
protected |
PGF file header.
Definition at line 519 of file PGFimage.h.
|
protected |
height of each channel at current level
Definition at line 517 of file PGFimage.h.
|
protected |
length of each level in bytes; first level starts immediately after this array
Definition at line 515 of file PGFimage.h.
|
private |
progress [0..1]
Definition at line 537 of file PGFimage.h.
|
protected |
PGF post-header.
Definition at line 520 of file PGFimage.h.
|
protected |
PGF pre-header.
Definition at line 518 of file PGFimage.h.
|
private |
progress mode used in Read and Write; PM_Relative is default mode
Definition at line 538 of file PGFimage.h.
|
protected |
quantization parameter
Definition at line 523 of file PGFimage.h.
|
protected |
region of interest
Definition at line 531 of file PGFimage.h.
|
protected |
skip user data (metadata) during open
Definition at line 528 of file PGFimage.h.
|
protected |
stream has been reinitialized
Definition at line 530 of file PGFimage.h.
|
protected |
use Open MP in decoder
Definition at line 527 of file PGFimage.h.
|
protected |
use Open MP in encoder
Definition at line 526 of file PGFimage.h.
|
protected |
stream position of user data
Definition at line 521 of file PGFimage.h.
|
protected |
width of each channel at current level
Definition at line 516 of file PGFimage.h.
|
protected |
wavelet transformed color channels
Definition at line 511 of file PGFimage.h.