OpenClonk
Bitmap256.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 /* A structure for handling 256-color bitmap files */
19 
20 #ifndef BITMAP256_H_INC
21 #define BITMAP256_H_INC
22 
23 #ifdef _WIN32
25 #else
26 #pragma pack(push,2)
27 typedef struct tagBITMAPFILEHEADER
28 {
35 #pragma pack(pop)
36 typedef struct tagBITMAPINFOHEADER
37 {
39  int32_t biWidth;
40  int32_t biHeight;
45  int32_t biXPelsPerMeter;
46  int32_t biYPelsPerMeter;
50 typedef struct tagRGBQUAD
51 {
57 #endif
58 
59 #pragma pack( push, def_pack , 1)
60 
61 class C4BMPInfo
62 {
63 public:
64  void Default();
65 public:
68  void Set(int iWdt, int iHgt, int iBitDepth);
69 
70  int FileBitsOffset();
71 };
72 
73 class C4BMP256Info : public C4BMPInfo
74 {
75 public:
76  RGBQUAD Colors[256] = {};
77 public:
78  void Default();
79  void Set(int iWdt, int iHgt, CStdPalette *);
80  bool Valid();
81 
82  int FileBitsOffset();
83 };
84 
85 #pragma pack( pop, def_pack )
86 
87 #endif // BITMAP256_H_INC
struct tagBITMAPFILEHEADER BITMAPFILEHEADER
BYTE rgbReserved
Definition: Bitmap256.h:55
struct tagRGBQUAD * LPRGBQUAD
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
BYTE rgbGreen
Definition: Bitmap256.h:53
struct tagRGBQUAD RGBQUAD
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
int32_t biXPelsPerMeter
Definition: Bitmap256.h:45
BYTE rgbRed
Definition: Bitmap256.h:54
struct tagBITMAPINFOHEADER * LPBITMAPINFOHEADER
struct tagBITMAPFILEHEADER * LPBITMAPFILEHEADER
int32_t biYPelsPerMeter
Definition: Bitmap256.h:46
BYTE rgbBlue
Definition: Bitmap256.h:52
struct tagBITMAPFILEHEADER * PBITMAPFILEHEADER
uint8_t BYTE
uint16_t WORD
uint32_t DWORD
int FileBitsOffset()
Definition: Bitmap256.cpp:60
void Default()
Definition: Bitmap256.cpp:90
bool Valid()
Definition: Bitmap256.cpp:53
void Set(int iWdt, int iHgt, CStdPalette *)
Definition: Bitmap256.cpp:65
RGBQUAD Colors[256]
Definition: Bitmap256.h:76
BITMAPFILEHEADER Head
Definition: Bitmap256.h:66
BITMAPINFOHEADER Info
Definition: Bitmap256.h:67
void Default()
Definition: Bitmap256.cpp:24
int FileBitsOffset()
Definition: Bitmap256.cpp:29
void Set(int iWdt, int iHgt, int iBitDepth)
Definition: Bitmap256.cpp:34