Files
Work/mdiwin/GIF.HPP
2024-08-07 09:16:27 -04:00

58 lines
1.7 KiB
C++

#ifndef _GIF_HPP_
#define _GIF_HPP_
#include <string.h>
#include <mdiwin/windows.hpp>
#include <mdiwin/types.hpp>
#include <mdiwin/lzw.hpp>
#ifdef _EXPAND_GIFDECODER_TEMPLATES_
#pragma option -Jgd
#endif
template <class T>
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 <mdiwin/gif.tpp>
#endif