libpgf 7.21.2
PGF - Progressive Graphics File
|
PGF main class. More...
#include <PGFimage.h>
Public Member Functions | |
CPGFImage () | |
Standard constructor. | |
virtual | ~CPGFImage () |
Destructor. | |
void | Destroy () |
void | Open (CPGFStream *stream) |
bool | IsOpen () const |
Returns true if the PGF has been opened for reading. | |
void | Read (int level=0, CallbackPtr cb=nullptr, void *data=nullptr) |
void | Read (PGFRect &rect, int level=0, CallbackPtr cb=nullptr, void *data=nullptr) |
void | ReadPreview () |
void | Reconstruct (int level=0) |
void | GetBitmap (int pitch, UINT8 *buff, BYTE bpp, int channelMap[]=nullptr, CallbackPtr cb=nullptr, void *data=nullptr) const |
void | GetYUV (int pitch, DataT *buff, BYTE bpp, int channelMap[]=nullptr, CallbackPtr cb=nullptr, void *data=nullptr) const |
void | ImportBitmap (int pitch, UINT8 *buff, BYTE bpp, int channelMap[]=nullptr, CallbackPtr cb=nullptr, void *data=nullptr) |
void | ImportYUV (int pitch, DataT *buff, BYTE bpp, int channelMap[]=nullptr, CallbackPtr cb=nullptr, void *data=nullptr) |
void | Write (CPGFStream *stream, UINT32 *nWrittenBytes=nullptr, CallbackPtr cb=nullptr, void *data=nullptr) |
UINT32 | WriteHeader (CPGFStream *stream) |
UINT32 | WriteImage (CPGFStream *stream, CallbackPtr cb=nullptr, void *data=nullptr) |
UINT32 | Write (int level, CallbackPtr cb=nullptr, void *data=nullptr) |
void | ConfigureEncoder (bool useOMP=true, bool favorSpeedOverSize=false) |
void | ConfigureDecoder (bool useOMP=true, UserdataPolicy policy=UP_CacheAll, UINT32 prefixSize=0) |
void | ResetStreamPos (bool startOfData) |
void | SetChannel (DataT *channel, int c=0) |
void | SetHeader (const PGFHeader &header, BYTE flags=0, const UINT8 *userData=0, UINT32 userDataLength=0) |
void | SetMaxValue (UINT32 maxValue) |
void | SetProgressMode (ProgressMode pm) |
void | SetRefreshCallback (RefreshCB callback, void *arg) |
void | SetColorTable (UINT32 iFirstColor, UINT32 nColors, const RGBQUAD *prgbColors) |
DataT * | GetChannel (int c=0) |
void | GetColorTable (UINT32 iFirstColor, UINT32 nColors, RGBQUAD *prgbColors) const |
const RGBQUAD * | GetColorTable () const |
const PGFHeader * | GetHeader () const |
UINT32 | GetMaxValue () const |
UINT64 | GetUserDataPos () const |
const UINT8 * | GetUserData (UINT32 &cachedSize, UINT32 *pTotalSize=nullptr) const |
UINT32 | GetEncodedHeaderLength () const |
UINT32 | GetEncodedLevelLength (int level) const |
UINT32 | ReadEncodedHeader (UINT8 *target, UINT32 targetLen) const |
UINT32 | ReadEncodedData (int level, UINT8 *target, UINT32 targetLen) const |
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 |
bool | IsFullyRead () const |
Return true if all levels have been read. | |
BYTE | Quality () const |
BYTE | Channels () const |
BYTE | Mode () const |
BYTE | BPP () const |
bool | ROIisSupported () const |
PGFRect | ComputeLevelROI () const |
BYTE | UsedBitsPerChannel () const |
BYTE | Version () const |
Static Public Member Functions | |
static bool | ImportIsSupported (BYTE mode) |
static UINT32 | LevelSizeL (UINT32 size, int level) |
static UINT32 | LevelSizeH (UINT32 size, int level) |
static BYTE | CodecMajorVersion (BYTE version=PGFVersion) |
Return major version. | |
static BYTE | MaxChannelDepth (BYTE version=PGFVersion) |
Protected Attributes | |
CWaveletTransform * | m_wtChannel [MaxChannels] |
wavelet transformed color channels | |
DataT * | m_channel [MaxChannels] |
untransformed channels in YUV format | |
CDecoder * | m_decoder |
PGF decoder. | |
CEncoder * | m_encoder |
PGF encoder. | |
UINT32 * | m_levelLength |
length of each level in bytes; first level starts immediately after this array | |
UINT32 | m_width [MaxChannels] |
width of each channel at current level | |
UINT32 | m_height [MaxChannels] |
height of each channel at current level | |
PGFPreHeader | m_preHeader |
PGF pre-header. | |
PGFHeader | m_header |
PGF file header. | |
PGFPostHeader | m_postHeader |
PGF post-header. | |
UINT64 | m_userDataPos |
stream position of user data | |
int | m_currentLevel |
transform level of current image | |
UINT32 | m_userDataPolicy |
user data (metadata) policy during open | |
BYTE | m_quant |
quantization parameter | |
bool | m_downsample |
chrominance channels are downsampled | |
bool | m_favorSpeedOverSize |
favor encoding speed over compression ratio | |
bool | m_useOMPinEncoder |
use Open MP in encoder | |
bool | m_useOMPinDecoder |
use Open MP in decoder | |
bool | m_streamReinitialized |
stream has been reinitialized | |
PGFRect | m_roi |
region of interest | |
Private Member Functions | |
void | Init () |
void | ComputeLevels () |
bool | CompleteHeader () |
void | RgbToYuv (int pitch, UINT8 *rgbBuff, BYTE bpp, int channelMap[], CallbackPtr cb, void *data) |
void | Downsample (int nChannel) |
UINT32 | UpdatePostHeaderSize () |
void | WriteLevel () |
PGFRect | GetAlignedROI (int c=0) const |
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 | |
void * | m_cbArg |
refresh callback argument | |
double | m_percent |
progress [0..1] | |
ProgressMode | m_progressMode |
progress mode used in Read and Write; PM_Relative is default mode | |
PGF main class.
PGF image class is the main class. You always need a PGF object for encoding or decoding image data. Decoding: Open() Read() GetBitmap() Encoding: SetHeader() ImportBitmap() Write()
Definition at line 53 of file PGFimage.h.
CPGFImage::CPGFImage | ( | ) |
Standard constructor.
Definition at line 64 of file PGFimage.cpp.
|
virtual |
Destructor.
Definition at line 117 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 461 of file PGFimage.h.
|
inline |
Return bits per channel of the image's encoder.
Definition at line 406 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 401 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 448 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 394 of file PGFimage.h.
|
inlineprivate |
Definition at line 573 of file PGFimage.h.
|
inlineprivate |
Definition at line 576 of file PGFimage.h.
|
inlineprivate |
Definition at line 563 of file PGFimage.h.
|
inlineprivate |
Definition at line 566 of file PGFimage.h.
|
inlineprivate |
Definition at line 569 of file PGFimage.h.
|
static |
Return major version.
Return codec major version.
version | pgf pre-header version number |
Definition at line 768 of file PGFimage.cpp.
|
private |
Definition at line 218 of file PGFimage.cpp.
PGFRect CPGFImage::ComputeLevelROI | ( | ) | const |
Return ROI of channel 0 at current level in pixels. The returned rect is only valid after reading a ROI.
|
private |
Definition at line 854 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. |
policy | The file might contain user data (e.g. metadata). The policy defines the behaviour during Open(). UP_CacheAll: User data is read and stored completely in a new allocated memory block. It can be accessed by GetUserData(). UP_CachePrefix: Only prefixSize bytes at the beginning of the user data are stored in a new allocated memory block. It can be accessed by GetUserData(). UP_Skip: User data is skipped and nothing is cached. |
prefixSize | Is only used in combination with UP_CachePrefix. It defines the number of bytes cached. |
Definition at line 260 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 250 of file PGFimage.h.
void CPGFImage::Destroy | ( | ) |
Definition at line 124 of file PGFimage.cpp.
|
private |
Definition at line 810 of file PGFimage.cpp.
|
private |
void CPGFImage::GetBitmap | ( | int | pitch, |
UINT8 * | buff, | ||
BYTE | bpp, | ||
int | channelMap[] = nullptr , |
||
CallbackPtr | cb = nullptr , |
||
void * | data = nullptr |
||
) | 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 1789 of file PGFimage.cpp.
|
inline |
Return an internal YUV image channel.
c | A channel index |
Definition at line 317 of file PGFimage.h.
|
inline |
Definition at line 330 of file PGFimage.h.
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 1350 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 648 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 367 of file PGFimage.h.
|
inline |
Return the PGF header structure.
Definition at line 335 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 341 of file PGFimage.h.
const UINT8 * CPGFImage::GetUserData | ( | UINT32 & | cachedSize, |
UINT32 * | pTotalSize = nullptr |
||
) | const |
Return user data and size of user data. Precondition: The PGF image has been opened with a call of Open(...).
cachedSize | [out] Size of returned user data in bytes. |
pTotalSize | [optional out] Pointer to return the size of user data stored in image header in bytes. |
Return user data and size of user data. Precondition: The PGF image has been opened with a call of Open(...). In an encoder scenario don't call this method before WriteHeader().
cachedSize | [out] Size of returned user data in bytes. |
pTotalSize | [optional out] Pointer to return the size of user data stored in image header in bytes. |
Definition at line 337 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 346 of file PGFimage.h.
void CPGFImage::GetYUV | ( | int | pitch, |
DataT * | buff, | ||
BYTE | bpp, | ||
int | channelMap[] = nullptr , |
||
CallbackPtr | cb = nullptr , |
||
void * | data = nullptr |
||
) | 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 2550 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 420 of file PGFimage.h.
void CPGFImage::ImportBitmap | ( | int | pitch, |
UINT8 * | buff, | ||
BYTE | bpp, | ||
int | channelMap[] = nullptr , |
||
CallbackPtr | cb = nullptr , |
||
void * | data = nullptr |
||
) |
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 792 of file PGFimage.cpp.
|
static |
Check for valid import image mode.
mode | Image mode |
Definition at line 1305 of file PGFimage.cpp.
void CPGFImage::ImportYUV | ( | int | pitch, |
DataT * | buff, | ||
BYTE | bpp, | ||
int | channelMap[] = nullptr , |
||
CallbackPtr | cb = nullptr , |
||
void * | data = nullptr |
||
) |
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 2661 of file PGFimage.cpp.
|
private |
Definition at line 69 of file PGFimage.cpp.
|
inline |
|
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 427 of file PGFimage.h.
|
inline |
Return the number of image levels.
Definition at line 432 of file PGFimage.h.
|
inlinestatic |
Compute and return image width/height of HH subband at given level.
size | Original image size (e.g. width or height at level 0) |
level | An image level |
Definition at line 506 of file PGFimage.h.
|
inlinestatic |
Compute and return image width/height of LL subband at given level.
size | Original image size (e.g. width or height at level 0) |
level | An image level |
Definition at line 499 of file PGFimage.h.
|
inlinestatic |
Return maximum channel depth.
version | pgf pre-header version number |
Definition at line 518 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 455 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 141 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 442 of file PGFimage.h.
void CPGFImage::Read | ( | int | level = 0 , |
CallbackPtr | cb = nullptr , |
||
void * | data = nullptr |
||
) |
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 402 of file PGFimage.cpp.
void CPGFImage::Read | ( | PGFRect & | rect, |
int | level = 0 , |
||
CallbackPtr | cb = nullptr , |
||
void * | data = nullptr |
||
) |
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) at level 0. 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 707 of file PGFimage.cpp.
UINT32 CPGFImage::ReadEncodedHeader | ( | UINT8 * | target, |
UINT32 | targetLen | ||
) | const |
Reads the encoded PGF header 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 660 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 111 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 348 of file PGFimage.cpp.
void CPGFImage::ResetStreamPos | ( | bool | startOfData | ) |
Reset stream position to start of PGF pre-header or start of data. Must not be called before Open() or before Write(). Use this method after Read() if you want to read the same image several times, e.g. reading different ROIs.
startOfData | true: you want to read the same image several times. false: resets stream position to the initial position |
Definition at line 682 of file PGFimage.cpp.
|
private |
Definition at line 1389 of file PGFimage.cpp.
|
inline |
Return true if the pgf image supports Region Of Interest (ROI).
Definition at line 466 of file PGFimage.h.
|
inline |
Set internal PGF image buffer channel.
channel | A YUV data channel |
c | A channel index |
Definition at line 272 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 1364 of file PGFimage.cpp.
void CPGFImage::SetHeader | ( | const PGFHeader & | header, |
BYTE | flags = 0 , |
||
const UINT8 * | userData = 0 , |
||
UINT32 | userDataLength = 0 |
||
) |
Set PGF header and user data. Precondition: The PGF image has been 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 894 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 738 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 296 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 303 of file PGFimage.h.
|
private |
|
private |
Definition at line 1124 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 756 of file PGFimage.cpp.
|
inline |
Returns the used codec major version of a pgf image
Definition at line 484 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 413 of file PGFimage.h.
void CPGFImage::Write | ( | CPGFStream * | stream, |
UINT32 * | nWrittenBytes = nullptr , |
||
CallbackPtr | cb = nullptr , |
||
void * | data = nullptr |
||
) |
Encode and write an 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 1221 of file PGFimage.cpp.
UINT32 CPGFImage::Write | ( | int | level, |
CallbackPtr | cb = nullptr , |
||
void * | data = nullptr |
||
) |
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 |
Create wavelet transform channels and encoder. Write header at current stream position. Performs forward FWT. 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 979 of file PGFimage.cpp.
UINT32 CPGFImage::WriteImage | ( | CPGFStream * | stream, |
CallbackPtr | cb = nullptr , |
||
void * | data = nullptr |
||
) |
Encode and write an 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 1150 of file PGFimage.cpp.
|
private |
Definition at line 1068 of file PGFimage.cpp.
|
private |
pointer to refresh callback procedure
Definition at line 545 of file PGFimage.h.
|
private |
refresh callback argument
Definition at line 546 of file PGFimage.h.
|
protected |
untransformed channels in YUV format
Definition at line 522 of file PGFimage.h.
|
protected |
transform level of current image
Definition at line 532 of file PGFimage.h.
|
protected |
PGF decoder.
Definition at line 523 of file PGFimage.h.
|
protected |
chrominance channels are downsampled
Definition at line 535 of file PGFimage.h.
|
protected |
PGF encoder.
Definition at line 524 of file PGFimage.h.
|
protected |
favor encoding speed over compression ratio
Definition at line 536 of file PGFimage.h.
|
protected |
PGF file header.
Definition at line 529 of file PGFimage.h.
|
protected |
height of each channel at current level
Definition at line 527 of file PGFimage.h.
|
protected |
length of each level in bytes; first level starts immediately after this array
Definition at line 525 of file PGFimage.h.
|
private |
progress [0..1]
Definition at line 547 of file PGFimage.h.
|
protected |
PGF post-header.
Definition at line 530 of file PGFimage.h.
|
protected |
PGF pre-header.
Definition at line 528 of file PGFimage.h.
|
private |
progress mode used in Read and Write; PM_Relative is default mode
Definition at line 548 of file PGFimage.h.
|
protected |
quantization parameter
Definition at line 534 of file PGFimage.h.
|
protected |
region of interest
Definition at line 541 of file PGFimage.h.
|
protected |
stream has been reinitialized
Definition at line 540 of file PGFimage.h.
|
protected |
use Open MP in decoder
Definition at line 538 of file PGFimage.h.
|
protected |
use Open MP in encoder
Definition at line 537 of file PGFimage.h.
|
protected |
user data (metadata) policy during open
Definition at line 533 of file PGFimage.h.
|
protected |
stream position of user data
Definition at line 531 of file PGFimage.h.
|
protected |
width of each channel at current level
Definition at line 526 of file PGFimage.h.
|
protected |
wavelet transformed color channels
Definition at line 521 of file PGFimage.h.