"L. Spiro Engine"
|
00001 00016 #ifndef __LSI_TGA_H__ 00017 #define __LSI_TGA_H__ 00018 00019 #include "../LSIImageLib.h" 00020 00021 namespace lsi { 00022 00029 class CTga { 00030 public : 00031 // == Functions. 00043 static LSBOOL LSE_CALL LoadTga( const LSUINT8 * _pui8FileData, LSUINT32 _ui32DataLen, 00044 LSUINT32 &_ui32Width, LSUINT32 &_ui32Height, LSI_PIXEL_FORMAT &_pfFormat, 00045 CImageLib::CTexelBuffer &_tbReturn ); 00046 00057 static LSBOOL LSE_CALL LoadTga( 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_TGAHEADER { 00069 LSUINT8 ui8IdentSize; 00070 LSUINT8 ui8ColorMapType; 00071 LSUINT8 ui8ImageType; 00072 00073 LSINT16 i16ColorMapStart; 00074 LSINT16 i16ColorMapLength; 00075 LSUINT8 ui8ColorMapBits; 00076 00077 LSINT16 i16XStart, 00078 i16YStart, 00079 i16Width, 00080 i16Height; 00081 00082 LSUINT8 ui8Bits; 00083 LSUINT8 ui8DescAlpha : 4; 00084 LSUINT8 ui8DescFlipX : 1; 00085 LSUINT8 ui8DescFlipY : 1; 00086 LSUINT8 ui8DescPad : 2; 00087 } * LPLSI_TGAHEADER, * const LPCLSI_TGAHEADER; 00088 00092 typedef struct LSI_TGAFOOTER { 00093 LSUINT32 ui32ExtOffset; 00094 LSUINT32 ui32DevDirOffset; 00095 LSUINT8 ui8Id[16]; 00096 LSUINT8 ui8Pad1[2]; 00097 } * LPLSI_TGAFOOTER, * const LPCLSI_TGAFOOTER; 00098 #pragma pack( pop ) 00099 00100 00101 // == Members. 00102 }; 00103 00104 } // namespace lsi 00105 00106 #endif // __LSI_TGA_H__