29 #ifndef PGF_PGFTYPES_H
30 #define PGF_PGFTYPES_H
44 #define PGFMajorNumber 7
45 #define PGFYear 21 // leading zeros are possible
46 #define PGFWeek 07 // leading zeros are possible
48 #define PPCAT_NX(A, B) A ## B
49 #define PPCAT(A, B) PPCAT_NX(A, B)
50 #define STRINGIZE_NX(A) #A
51 #define STRINGIZE(A) STRINGIZE_NX(A)
54 #define PGFCodecVersionID PPCAT(PPCAT(PPCAT(0x0, PGFMajorNumber), PGFYear), PGFWeek)
56 #define PGFCodecVersion STRINGIZE(PPCAT(PPCAT(PPCAT(PPCAT(PGFMajorNumber, .), PGFYear), .), PGFWeek))
61 #define PGFMagic "PGF"
65 #define DownsampleThreshold 3
66 #define ColorTableLen 256
75 #ifdef __PGF32SUPPORT__
76 #define PGFVersion (Version2 | PGF32 | Version5 | Version6 | Version7)
78 #define PGFVersion (Version2 | Version5 | Version6 | Version7)
84 #define BufferSize 16384
85 #define RLblockSizeLen 15
86 #define LinBlockSize 8
87 #define InterBlockSize 4
88 #ifdef __PGF32SUPPORT__
89 #define MaxBitPlanes 31
91 #define MaxBitPlanes 15
93 #define MaxBitPlanesLog 5
94 #define MaxQuality MaxBitPlanes
135 #ifdef PGF_USE_BIG_ENDIAN
143 #endif // PGF_USE_BIG_ENDIAN
152 PGFHeader() :
width(0),
height(0),
nLevels(0),
quality(0),
bpp(0),
channels(0),
mode(
ImageModeUnknown),
usedBitsPerChannel(0),
version(0, 0, 0) {}
184 #ifdef PGF_USE_BIG_ENDIAN
190 #endif // PGF_USE_BIG_ENDIAN
229 PGFRect() : left(0), top(0), right(0), bottom(0) {}
236 PGFRect(UINT32 x, UINT32 y, UINT32 width, UINT32 height) : left(x), top(y), right(x + width), bottom(y + height) {}
239 PGFRect(
const RECT& rect) : left(rect.left), top(rect.top), right(rect.right), bottom(rect.bottom) {
240 ASSERT(rect.left >= 0 && rect.right >= 0 && rect.left <= rect.right);
241 ASSERT(rect.top >= 0 && rect.bottom >= 0 && rect.top <= rect.bottom);
244 PGFRect& operator=(
const RECT& rect) {
245 left = rect.
left; top = rect.top; right = rect.right; bottom = rect.bottom;
250 RECT rect = { (LONG)left, (LONG)
top, (LONG)right, (LONG)bottom };
265 bool IsInside(UINT32 x, UINT32 y)
const {
return (x >= left && x < right && y >= top && y < bottom); }
268 #ifdef __PGF32SUPPORT__
279 #define MagicVersionSize sizeof(PGFMagicVersion)
280 #define PreHeaderSize sizeof(PGFPreHeader)
281 #define HeaderSize sizeof(PGFHeader)
282 #define ColorTableSize (ColorTableLen*sizeof(RGBQUAD))
283 #define DataTSize sizeof(DataT)
284 #define MaxUserDataSize 0x7FFFFFFF
286 #endif //PGF_PGFTYPES_H
UINT8 version
PGF version.
void(* RefreshCB)(void *p)
PGF identification and version.
#define RLblockSizeLen
block size length (< 16): ld(BufferSize) < RLblockSizeLen <= 2*ld(BufferSize)
IOException()
Standard constructor.
#define ColorTableLen
size of color lookup table (clut)
PGFVersionNumber(UINT8 _major, UINT8 _year, UINT8 _week)
char magic[3]
PGF identification = "PGF".
UINT16 week
week number in a year
UINT16 year
year since 2000 (year 2001 = 1)
PGFRect(UINT32 x, UINT32 y, UINT32 width, UINT32 height)
bool IsInside(UINT32 x, UINT32 y) const
PGFRect()
Standard constructor.
OSError error
operating system error code
UINT16 major
major version number
version number stored in header since major version 7