29 #ifndef PGF_PGFIMAGE_H
30 #define PGF_PGFIMAGE_H
95 void Read(
int level = 0, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
97 #ifdef __PGFROISUPPORT__
107 void Read(
PGFRect& rect,
int level = 0, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
141 void GetBitmap(
int pitch, UINT8* buff, BYTE bpp,
int channelMap[] = NULL, CallbackPtr cb = NULL,
void *data = NULL) const THROW_;
158 void GetYUV(
int pitch,
DataT* buff, BYTE bpp,
int channelMap[] = NULL, CallbackPtr cb = NULL,
void *data = NULL) const THROW_;
176 void ImportBitmap(
int pitch, UINT8 *buff, BYTE bpp,
int channelMap[] = NULL, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
193 void ImportYUV(
int pitch,
DataT *buff, BYTE bpp,
int channelMap[] = NULL, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
210 void Write(
CPGFStream* stream, UINT32* nWrittenBytes = NULL, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
221 #ifdef __PGFROISUPPORT__
237 UINT32
Write(
int level, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
277 void SetHeader(
const PGFHeader& header, BYTE flags = 0, UINT8* userData = 0, UINT32 userDataLength = 0) THROW_;
304 void SetColorTable(UINT32 iFirstColor, UINT32 nColors,
const RGBQUAD* prgbColors) THROW_;
323 void GetColorTable(UINT32 iFirstColor, UINT32 nColors, RGBQUAD* prgbColors)
const THROW_;
382 UINT32
ReadEncodedData(
int level, UINT8* target, UINT32 targetLen) const THROW_;
477 static UINT32
LevelWidth(UINT32 width,
int level) { ASSERT(level >= 0); UINT32 w = (width >> level);
return ((w << level) == width) ? w : w + 1; }
484 static UINT32
LevelHeight(UINT32 height,
int level) { ASSERT(level >= 0); UINT32 h = (height >> level);
return ((h << level) == height) ? h : h + 1; }
513 #ifdef __PGFROISUPPORT__
525 void RgbToYuv(
int pitch, UINT8* rgbBuff, BYTE bpp,
int channelMap[], CallbackPtr cb,
void *data) THROW_;
529 #ifdef __PGFROISUPPORT__
534 if (v & 0xFFFFFFF0)
return (v < 0) ? (UINT8)0: (UINT8)15;
else return (UINT8)v;
537 if (v & 0xFFFFFFC0)
return (v < 0) ? (UINT16)0: (UINT16)63;
else return (UINT16)v;
541 if (v & 0xFFFFFF00)
return (v < 0) ? (UINT8)0 : (UINT8)255;
else return (UINT8)v;
544 if (v & 0xFFFF0000)
return (v < 0) ? (UINT16)0: (UINT16)65535;
else return (UINT16)v;
547 return (v < 0) ? 0 : (UINT32)v;
551 #endif //PGF_PGFIMAGE_H