"L. Spiro Engine"
|
00001 00016 #ifndef __LSI_BMP_H__ 00017 #define __LSI_BMP_H__ 00018 00019 #include "../LSIImageLib.h" 00020 00021 namespace lsi { 00022 00029 class CBmp { 00030 public : 00031 // == Functions. 00043 static LSBOOL LSE_CALL LoadBmp( const LSUINT8 * _pui8FileData, LSUINT32 _ui32DataLen, 00044 LSUINT32 &_ui32Width, LSUINT32 &_ui32Height, LSI_PIXEL_FORMAT &_pfFormat, 00045 CImageLib::CTexelBuffer &_tbReturn ); 00046 00057 static LSBOOL LSE_CALL LoadBmp( 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_BITMAPFILEHEADER { 00069 LSUINT16 ui16Header; 00070 LSUINT32 ui32Size; 00071 LSUINT16 ui16Reserved1; 00072 LSUINT16 ui16Reserved2; 00073 LSUINT32 ui32Offset; 00074 } * LPLSI_BITMAPFILEHEADER, * const LPCLSI_BITMAPFILEHEADER; 00075 00079 typedef struct LSI_BITMAPINFOHEADER { 00080 LSUINT32 ui32InfoSize; 00081 LSUINT32 ui32Width; 00082 LSUINT32 ui32Height; 00083 LSUINT16 ui16Planes; 00084 LSUINT16 ui16BitsPerPixel; 00085 LSUINT32 ui32Compression; 00086 LSUINT32 ui32ImageSize; 00087 LSUINT32 ui32PixelsPerMeterX; 00088 LSUINT32 ui32PixelsPerMeterY; 00089 LSUINT32 ui32ColorsInPalette; 00090 LSUINT32 ui32ImportantColors; 00091 } * LPLSI_BITMAPINFOHEADER, * const LPCLSI_BITMAPINFOHEADER; 00092 00096 typedef struct LSI_BITMAPCOLORMASK { 00097 LSUINT32 ui32Red, 00098 ui32Green, 00099 ui32Blue, 00100 ui32Alpha; 00101 } * LPLSI_BITMAPCOLORMASK, * const LPCLSI_BITMAPCOLORMASK; 00102 00106 typedef union LSI_BITMAPPALETTE { 00107 struct LSI_BM_COLOR { 00108 LSUINT8 ui8Red, 00109 ui8Green, 00110 ui8Blue, 00111 ui8Alpha; 00112 }; 00113 LSUINT32 ui32Color; 00114 } * LPLSI_BITMAPPALETTE, * const LPCLSI_BITMAPPALETTE; 00115 #pragma pack( pop ) 00116 }; 00117 00118 } // namespace lsi 00119 00120 #endif // __LSI_BMP_H__