"L. Spiro Engine"
|
00001 00016 #ifndef __LSI_GIF_H__ 00017 #define __LSI_GIF_H__ 00018 00019 #include "../LSIImageLib.h" 00020 00021 namespace lsi { 00022 00029 class CGif { 00030 public : 00031 // == Functions. 00043 static LSBOOL LSE_CALL LoadGif( const LSUINT8 * _pui8FileData, LSUINT32 _ui32DataLen, 00044 LSUINT32 &_ui32Width, LSUINT32 &_ui32Height, LSI_PIXEL_FORMAT &_pfFormat, 00045 CImageLib::CTexelBuffer &_tbReturn ); 00046 00057 static LSBOOL LSE_CALL LoadGif( const LSCHAR * _pcFile, 00058 LSUINT32 &_ui32Width, LSUINT32 &_ui32Height, LSI_PIXEL_FORMAT &_pfFormat, 00059 CImageLib::CTexelBuffer &_tbReturn ); 00060 00061 00062 protected : 00063 // == Types. 00064 #pragma pack( push, 1 ) 00065 00068 typedef struct LSI_GIFHEADER { 00069 LSUINT8 ui8Header[3]; 00070 LSUINT8 ui8Version[3]; 00071 LSUINT16 ui16Width; 00072 LSUINT16 ui16Height; 00073 LSUINT8 ui8SizeOfGct : 3; 00074 LSUINT8 ui8SortFlag : 1; 00075 LSUINT8 ui8ColorBits : 3; 00076 LSUINT8 ui8GctFlag : 1; 00077 LSUINT8 ui8BackGroundIndex; 00078 LSUINT8 ui8Aspect; 00079 } * LPLSI_GIFHEADER, * const LPCLSI_GIFHEADER; 00080 00084 typedef struct LSI_GIFCOLOR { 00085 LSUINT8 ui8R; 00086 LSUINT8 ui8G; 00087 LSUINT8 ui8B; 00088 } * LPLSI_GIFCOLOR, * const LPCLSI_GIFCOLOR; 00089 00093 typedef struct LSI_GIFIMGDESCRIPTOR { 00094 LSUINT8 ui8Separator; 00095 LSUINT16 ui16X; 00096 LSUINT16 ui16Y; 00097 LSUINT16 ui16W; 00098 LSUINT16 ui16H; 00099 LSUINT8 ui8LocalCt : 1; 00100 LSUINT8 ui8Interlaced : 1; 00101 LSUINT8 ui8Sorted : 1; 00102 LSUINT8 ui8Reserved : 2; 00103 LSUINT8 ui8SizeOfLct : 3; 00104 } * LPLSI_GIFIMGDESCRIPTOR, * const LPCLSI_GIFIMGDESCRIPTOR; 00105 00109 typedef struct LSI_GIFGRAPHICCONTROL { 00110 LSUINT8 ui8Separator; 00111 LSUINT8 ui8Label; 00112 LSUINT8 ui8Size; 00113 LSUINT8 ui8Reserved : 3; 00114 LSUINT8 ui8Disposal : 3; 00115 LSUINT8 ui8Input : 1; 00116 LSUINT8 ui8Trans : 1; 00117 LSUINT16 ui16Delay; 00118 LSUINT8 ui8TransColor; 00119 LSUINT8 ui8Terminator; 00120 } * LPLSI_GIFGRAPHICCONTROL, * const LPCLSI_GIFGRAPHICCONTROL; 00121 #pragma pack( pop ) 00122 }; 00123 00124 } // namespace lsi 00125 00126 #endif // __LSI_GIF_H__