29 #ifndef PGF_PGFIMAGE_H
30 #define PGF_PGFIMAGE_H
101 void Read(
int level = 0, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
103 #ifdef __PGFROISUPPORT__
113 void Read(
PGFRect& rect,
int level = 0, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
147 void GetBitmap(
int pitch, UINT8* buff, BYTE bpp,
int channelMap[] = NULL, CallbackPtr cb = NULL,
void *data = NULL) const THROW_;
164 void GetYUV(
int pitch,
DataT* buff, BYTE bpp,
int channelMap[] = NULL, CallbackPtr cb = NULL,
void *data = NULL) const THROW_;
182 void ImportBitmap(
int pitch, UINT8 *buff, BYTE bpp,
int channelMap[] = NULL, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
199 void ImportYUV(
int pitch,
DataT *buff, BYTE bpp,
int channelMap[] = NULL, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
214 void Write(
CPGFStream* stream, UINT32* nWrittenBytes = NULL, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
237 #ifdef __PGFROISUPPORT__
253 UINT32
Write(
int level, CallbackPtr cb = NULL,
void *data = NULL) THROW_;
286 void SetHeader(
const PGFHeader& header, BYTE flags = 0, UINT8* userData = 0, UINT32 userDataLength = 0) THROW_;
315 void SetColorTable(UINT32 iFirstColor, UINT32 nColors,
const RGBQUAD* prgbColors) THROW_;
329 void GetColorTable(UINT32 iFirstColor, UINT32 nColors, RGBQUAD* prgbColors)
const THROW_;
390 UINT32
ReadEncodedData(
int level, UINT8* target, UINT32 targetLen)
const THROW_;
491 static UINT32
LevelWidth(UINT32 width,
int level) { ASSERT(level >= 0); UINT32 w = (width >> level);
return ((w << level) == width) ? w : w + 1; }
498 static UINT32
LevelHeight(UINT32 height,
int level) { ASSERT(level >= 0); UINT32 h = (height >> level);
return ((h << level) == height) ? h : h + 1; }
529 #ifdef __PGFROISUPPORT__
542 void RgbToYuv(
int pitch, UINT8* rgbBuff, BYTE bpp,
int channelMap[], CallbackPtr cb,
void *data) THROW_;
547 #ifdef __PGFROISUPPORT__
552 if (v & 0xFFFFFFF0)
return (v < 0) ? (UINT8)0: (UINT8)15;
else return (UINT8)v;
555 if (v & 0xFFFFFFC0)
return (v < 0) ? (UINT16)0: (UINT16)63;
else return (UINT16)v;
559 if (v & 0xFFFFFF00)
return (v < 0) ? (UINT8)0 : (UINT8)255;
else return (UINT8)v;
562 if (v & 0xFFFF0000)
return (v < 0) ? (UINT16)0: (UINT16)65535;
else return (UINT16)v;
565 return (v < 0) ? 0 : (UINT32)v;
569 #endif //PGF_PGFIMAGE_H