-
Notifications
You must be signed in to change notification settings - Fork 0
/
bmp_header.h
37 lines (33 loc) · 1.33 KB
/
bmp_header.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//------------------------------------------------------------------------
// bmp_header.h
// Smadu Razvan-Alexandru 315CB
//------------------------------------------------------------------------
/* Tells the compiler not to add padding for these structs. This may
be useful when reading/writing to binary files.
http://stackoverflow.com/questions/3318410/pragma-pack-effect
*/
#pragma pack(1)
struct bmp_fileheader
{
unsigned char fileMarker1; /* 'B' */
unsigned char fileMarker2; /* 'M' */
unsigned int bfSize; /* File's size */
unsigned short unused1; /* Aplication specific */
unsigned short unused2; /* Aplication specific */
unsigned int imageDataOffset; /* Offset to the start of image data */
};
struct bmp_infoheader
{
unsigned int biSize; /* Size of the info header - 40 bytes */
signed int width; /* Width of the image */
signed int height; /* Height of the image */
unsigned short planes;
unsigned short bitPix; /* Number of bits per pixel = 3 * 8 (for each channel R, G, B we need 8 bits */
unsigned int biCompression; /* Type of compression */
unsigned int biSizeImage; /* Size of the image data */
int biXPelsPerMeter;
int biYPelsPerMeter;
unsigned int biClrUsed;
unsigned int biClrImportant;
};
#pragma pack()