diff options
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderBMP.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderBMP.h | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderBMP.h b/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderBMP.h index 9321ecc..7bef7d7 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderBMP.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CImageLoaderBMP.h | |||
@@ -1,100 +1,100 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __C_IMAGE_LOADER_BMP_H_INCLUDED__ | 5 | #ifndef __C_IMAGE_LOADER_BMP_H_INCLUDED__ |
6 | #define __C_IMAGE_LOADER_BMP_H_INCLUDED__ | 6 | #define __C_IMAGE_LOADER_BMP_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IrrCompileConfig.h" | 8 | #include "IrrCompileConfig.h" |
9 | 9 | ||
10 | #include "IImageLoader.h" | 10 | #include "IImageLoader.h" |
11 | 11 | ||
12 | 12 | ||
13 | namespace irr | 13 | namespace irr |
14 | { | 14 | { |
15 | namespace video | 15 | namespace video |
16 | { | 16 | { |
17 | 17 | ||
18 | #if defined(_IRR_COMPILE_WITH_BMP_LOADER_) || defined(_IRR_COMPILE_WITH_BMP_WRITER_) | 18 | #if defined(_IRR_COMPILE_WITH_BMP_LOADER_) || defined(_IRR_COMPILE_WITH_BMP_WRITER_) |
19 | 19 | ||
20 | 20 | ||
21 | // byte-align structures | 21 | // byte-align structures |
22 | #include "irrpack.h" | 22 | #include "irrpack.h" |
23 | 23 | ||
24 | struct SBMPHeader | 24 | struct SBMPHeader |
25 | { | 25 | { |
26 | u16 Id; // BM - Windows 3.1x, 95, NT, 98, 2000, ME, XP | 26 | u16 Id; // BM - Windows 3.1x, 95, NT, 98, 2000, ME, XP |
27 | // BA - OS/2 Bitmap Array | 27 | // BA - OS/2 Bitmap Array |
28 | // CI - OS/2 Color Icon | 28 | // CI - OS/2 Color Icon |
29 | // CP - OS/2 Color Pointer | 29 | // CP - OS/2 Color Pointer |
30 | // IC - OS/2 Icon | 30 | // IC - OS/2 Icon |
31 | // PT - OS/2 Pointer | 31 | // PT - OS/2 Pointer |
32 | u32 FileSize; | 32 | u32 FileSize; |
33 | u32 Reserved; | 33 | u32 Reserved; |
34 | u32 BitmapDataOffset; | 34 | u32 BitmapDataOffset; |
35 | u32 BitmapHeaderSize; // should be 28h for windows bitmaps or | 35 | u32 BitmapHeaderSize; // should be 28h for windows bitmaps or |
36 | // 0Ch for OS/2 1.x or F0h for OS/2 2.x | 36 | // 0Ch for OS/2 1.x or F0h for OS/2 2.x |
37 | u32 Width; | 37 | u32 Width; |
38 | u32 Height; | 38 | u32 Height; |
39 | u16 Planes; | 39 | u16 Planes; |
40 | u16 BPP; // 1: Monochrome bitmap | 40 | u16 BPP; // 1: Monochrome bitmap |
41 | // 4: 16 color bitmap | 41 | // 4: 16 color bitmap |
42 | // 8: 256 color bitmap | 42 | // 8: 256 color bitmap |
43 | // 16: 16bit (high color) bitmap | 43 | // 16: 16bit (high color) bitmap |
44 | // 24: 24bit (true color) bitmap | 44 | // 24: 24bit (true color) bitmap |
45 | // 32: 32bit (true color) bitmap | 45 | // 32: 32bit (true color) bitmap |
46 | 46 | ||
47 | u32 Compression; // 0: none (Also identified by BI_RGB) | 47 | u32 Compression; // 0: none (Also identified by BI_RGB) |
48 | // 1: RLE 8-bit / pixel (Also identified by BI_RLE4) | 48 | // 1: RLE 8-bit / pixel (Also identified by BI_RLE4) |
49 | // 2: RLE 4-bit / pixel (Also identified by BI_RLE8) | 49 | // 2: RLE 4-bit / pixel (Also identified by BI_RLE8) |
50 | // 3: Bitfields (Also identified by BI_BITFIELDS) | 50 | // 3: Bitfields (Also identified by BI_BITFIELDS) |
51 | 51 | ||
52 | u32 BitmapDataSize; // Size of the bitmap data in bytes. This number must be rounded to the next 4 byte boundary. | 52 | u32 BitmapDataSize; // Size of the bitmap data in bytes. This number must be rounded to the next 4 byte boundary. |
53 | u32 PixelPerMeterX; | 53 | u32 PixelPerMeterX; |
54 | u32 PixelPerMeterY; | 54 | u32 PixelPerMeterY; |
55 | u32 Colors; | 55 | u32 Colors; |
56 | u32 ImportantColors; | 56 | u32 ImportantColors; |
57 | } PACK_STRUCT; | 57 | } PACK_STRUCT; |
58 | 58 | ||
59 | // Default alignment | 59 | // Default alignment |
60 | #include "irrunpack.h" | 60 | #include "irrunpack.h" |
61 | 61 | ||
62 | #endif // defined with loader or writer | 62 | #endif // defined with loader or writer |
63 | 63 | ||
64 | #ifdef _IRR_COMPILE_WITH_BMP_LOADER_ | 64 | #ifdef _IRR_COMPILE_WITH_BMP_LOADER_ |
65 | 65 | ||
66 | /*! | 66 | /*! |
67 | Surface Loader for Windows bitmaps | 67 | Surface Loader for Windows bitmaps |
68 | */ | 68 | */ |
69 | class CImageLoaderBMP : public IImageLoader | 69 | class CImageLoaderBMP : public IImageLoader |
70 | { | 70 | { |
71 | public: | 71 | public: |
72 | 72 | ||
73 | //! constructor | 73 | //! constructor |
74 | CImageLoaderBMP(); | 74 | CImageLoaderBMP(); |
75 | 75 | ||
76 | //! returns true if the file maybe is able to be loaded by this class | 76 | //! returns true if the file maybe is able to be loaded by this class |
77 | //! based on the file extension (e.g. ".tga") | 77 | //! based on the file extension (e.g. ".tga") |
78 | virtual bool isALoadableFileExtension(const io::path& filename) const; | 78 | virtual bool isALoadableFileExtension(const io::path& filename) const; |
79 | 79 | ||
80 | //! returns true if the file maybe is able to be loaded by this class | 80 | //! returns true if the file maybe is able to be loaded by this class |
81 | virtual bool isALoadableFileFormat(io::IReadFile* file) const; | 81 | virtual bool isALoadableFileFormat(io::IReadFile* file) const; |
82 | 82 | ||
83 | //! creates a surface from the file | 83 | //! creates a surface from the file |
84 | virtual IImage* loadImage(io::IReadFile* file) const; | 84 | virtual IImage* loadImage(io::IReadFile* file) const; |
85 | 85 | ||
86 | private: | 86 | private: |
87 | 87 | ||
88 | void decompress8BitRLE(u8*& BmpData, s32 size, s32 width, s32 height, s32 pitch) const; | 88 | void decompress8BitRLE(u8*& BmpData, s32 size, s32 width, s32 height, s32 pitch) const; |
89 | 89 | ||
90 | void decompress4BitRLE(u8*& BmpData, s32 size, s32 width, s32 height, s32 pitch) const; | 90 | void decompress4BitRLE(u8*& BmpData, s32 size, s32 width, s32 height, s32 pitch) const; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | 93 | ||
94 | #endif // compiled with loader | 94 | #endif // compiled with loader |
95 | 95 | ||
96 | } // end namespace video | 96 | } // end namespace video |
97 | } // end namespace irr | 97 | } // end namespace irr |
98 | 98 | ||
99 | #endif | 99 | #endif |
100 | 100 | ||