-
Notifications
You must be signed in to change notification settings - Fork 1
/
BMPFile.h
47 lines (34 loc) · 822 Bytes
/
BMPFile.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
38
39
40
41
42
43
44
45
46
47
# ifndef _BMPFILE_H
# define _BMPFILE_H
# include <fstream>
using namespace std;
# define BF_TYPE 0x4D42
typedef struct{
unsigned short bfType;
unsigned int bfSize;
unsigned short bfReserved1;
unsigned short bfReserved2;
unsigned int bfOffBits;
unsigned int biSize;
int biWidth;
int biHeight;
unsigned short biPlanes;
unsigned short biBitCount;
unsigned int biCompression;
unsigned int biSizeImage;
int biXPelsPerMeter;
int biYPelsPerMeter;
unsigned int biClrUsed;
unsigned int biClrImportant;
}stBitmapHeader;
class CBMPFile {
public :
CBMPFile();
CBMPFile(int width, int height);
void WriteHeader();
void DumpPixel(int red, int green, int blue);
void PadRow(int rowLength);
protected:
stBitmapHeader m_bitmapHeader;
};
# endif