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 133 PGFVersionNumber(UINT8 _major, UINT8 _year, UINT8 _week) : major(_major), year(_year), week(_week) {}
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) {}
191 #ifdef PGF_USE_BIG_ENDIAN 197 #endif // PGF_USE_BIG_ENDIAN 224 PGFRect() : left(0), top(0), right(0), bottom(0) {}
230 PGFRect(UINT32 x, UINT32 y, UINT32 width, UINT32 height) : left(x), top(y), right(x + width), bottom(y + height) {}
233 PGFRect(
const RECT& rect) : left(rect.left), top(rect.top), right(rect.right), bottom(rect.bottom) {
234 ASSERT(rect.left >= 0 && rect.right >= 0 && rect.left <= rect.right);
235 ASSERT(rect.top >= 0 && rect.bottom >= 0 && rect.top <= rect.bottom);
237 PGFRect& operator=(
const RECT& rect) {
238 left = rect.
left; top = rect.top; right = rect.right; bottom = rect.bottom;
242 RECT rect = { left, top, right, bottom };
248 UINT32
Width()
const {
return right - left; }
250 UINT32
Height()
const {
return bottom - top; }
256 bool IsInside(UINT32 x, UINT32 y)
const {
return (x >= left && x < right && y >= top && y < bottom); }
258 UINT32 left,
top, right, bottom;
261 #ifdef __PGF32SUPPORT__ 272 #define MagicVersionSize sizeof(PGFMagicVersion) 273 #define PreHeaderSize sizeof(PGFPreHeader) 274 #define HeaderSize sizeof(PGFHeader) 275 #define ColorTableSize (ColorTableLen*sizeof(RGBQUAD)) 276 #define DataTSize sizeof(DataT) 277 #define MaxUserDataSize 0x7FFFFFFF 279 #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".
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
version number stored in header since major version 7