-
Notifications
You must be signed in to change notification settings - Fork 9
/
bmpconvert.h
74 lines (57 loc) · 1.48 KB
/
bmpconvert.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef BMPCONVERT_H
#define BMPCONVERT_H
#include "dxFileIO.h"
#define dxWORD dxUShort2
#define dxDWORD dxULong4
#define dxLONG dxLong4
#define dxBYTE char
#pragma pack (1)
typedef struct dxtagBITMAPFILEHEADER {
dxWORD bfType;
dxDWORD bfSize;
dxWORD bfReserved1;
dxWORD bfReserved2;
dxDWORD bfOffBits;
} dxBITMAPFILEHEADER, *dxPBITMAPFILEHEADER;
#pragma pack()
#pragma pack (1)
typedef struct dxtagBITMAPINFOHEADER{
dxDWORD biSize;
dxLONG biWidth;
dxLONG biHeight;
dxWORD biPlanes;
dxWORD biBitCount;
dxDWORD biCompression;
dxDWORD biSizeImage;
dxLONG biXPelsPerMeter;
dxLONG biYPelsPerMeter;
dxDWORD biClrUsed;
dxDWORD biClrImportant;
} dxBITMAPINFOHEADER, *dxPBITMAPINFOHEADER;
#pragma pack()
#pragma pack (1)
typedef struct {
dxDWORD biRedMask;
dxDWORD biGreenMask;
dxDWORD biBlueMask;
dxDWORD biAlphaMask;
dxDWORD biCSType;
} dxHEADERADD, *dxPHEADERADD;
#pragma pack()
#pragma pack (1)
typedef struct dxtagRGBQUAD {
dxBYTE rgbBlue;
dxBYTE rgbGreen;
dxBYTE rgbRed;
dxBYTE rgbReserved;
} dxRGBQUAD;
#pragma pack()
#define dxBM_CHARS_MAGIC 0x4D42
int isBmpExt(const char* bmpName);
char* getPngName(const char* bmpName, char* resName);
int bmp2png(const char* bmpName, const char* pngName);
const char* bmp2pngErrorText(int code);
dxFileSize tarGetSize(const char* path);
dxFileSize tarAppend(char* tar, const char* realPath, const char* filename);
int gzipToFile(char* tar, dxFileSize tarSize, const char* archiveName);
#endif