29 #ifndef PGF_PGFTYPES_H
30 #define PGF_PGFTYPES_H
44 #define PGFMajorNumber 7
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
151 PGFHeader() :
width(0),
height(0),
nLevels(0),
quality(0),
bpp(0),
channels(0),
mode(
ImageModeUnknown),
usedBitsPerChannel(0),
version(0, 0, 0) {}
183 #ifdef PGF_USE_BIG_ENDIAN
189 #endif // PGF_USE_BIG_ENDIAN
228 PGFRect() : left(0), top(0), right(0), bottom(0) {}
235 PGFRect(UINT32 x, UINT32 y, UINT32 width, UINT32 height) : left(x), top(y), right(x + width), bottom(y + height) {}
238 PGFRect(
const RECT& rect) : left(rect.left), top(rect.top), right(rect.right), bottom(rect.bottom) {
239 ASSERT(rect.left >= 0 && rect.right >= 0 && rect.left <= rect.right);
240 ASSERT(rect.top >= 0 && rect.bottom >= 0 && rect.top <= rect.bottom);
243 PGFRect& operator=(
const RECT& rect) {
244 left = rect.
left; top = rect.top; right = rect.right; bottom = rect.bottom;
249 RECT rect = { (LONG)left, (LONG)
top, (LONG)right, (LONG)bottom };
264 bool IsInside(UINT32 x, UINT32 y)
const {
return (x >= left && x < right && y >= top && y < bottom); }
267 #ifdef __PGF32SUPPORT__
278 #define MagicVersionSize sizeof(PGFMagicVersion)
279 #define PreHeaderSize sizeof(PGFPreHeader)
280 #define HeaderSize sizeof(PGFHeader)
281 #define ColorTableSize (ColorTableLen*sizeof(RGBQUAD))
282 #define DataTSize sizeof(DataT)
283 #define MaxUserDataSize 0x7FFFFFFF
285 #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