#ifndef _GIF_HPP_ #define _GIF_HPP_ #include #include #include #include #ifdef _EXPAND_GIFDECODER_TEMPLATES_ #pragma option -Jgd #endif template class GIFDecoder : public LZWDecompression { public: GIFDecoder(const char *pathFileName); virtual ~GIFDecoder(); WORD unpackImage(void); void setPaletteHandler(T *object,void (T::*method)(const UCHAR FAR *lpPaletteData,USHORT numColors)); void setBackgroundHandler(T *object,void (T::*method)(USHORT backgroundColor)); void setImageHandler(T *object,void (T::*method)(void)); void setShowHandler(T *object,void (T::*method)(USHORT imageWide,USHORT imageDeep,const UCHAR FAR *lpRowData,USHORT yLocation)); void setErrorHandler(T *object,void (T::*method)(const char FAR *message)); private: void showHandler(UCHAR FAR *lpOutRow,USHORT yLocation); WORD readPaletteData(void); WORD processImage(void); T FAR *mPaletteObject; T *mBackgroundObject; T *mImageObject; T *mShowObject; T *mErrorObject; void(T::*mPaletteMethod)(const UCHAR FAR *lpPaletteData,USHORT numColors); void(T::*mBackgroundMethod)(USHORT backgroundColor); void(T::*mImageMethod)(void); void(T::*mShowMethod)(USHORT imageWide,USHORT imageDeep,const UCHAR FAR *lpRowData,USHORT yLocation); void(T::*mErrorMethod)(const char FAR *message); HGLOBAL mhGlobalPalette; UCHAR FAR *mlpPaletteData; USHORT mScreenWidth; USHORT mScreenHeight; UCHAR mGlobalFlagByte; USHORT mColors; USHORT mBackgroundColor; USHORT mImageStartLeft; USHORT mImageStartTop; USHORT mImageWide; USHORT mImageDeep; USHORT mIsInterlaced; USHORT mBufferCount; USHORT mPixelSize; }; #include #endif