Initial 800x480 cabbiev2 port, based on 480x800x16 one
[kugel-rb.git] / utils / wpseditor / screenshot / bmp.h
blob71d5a4a5bcac5d0917422ff16c88a8b10655cd5d
1 /* $Id$ */
2 #ifdef __cplusplus
3 extern "C" {
4 #endif
6 /*
7 gd_bmp.c
9 Bitmap format support for libgd
11 * Written 2007, Scott MacVicar
12 ---------------------------------------------------------------------------
14 Todo:
16 RLE4, RLE8 and Bitfield encoding
17 Add full support for Windows v4 and Windows v5 header formats
19 ----------------------------------------------------------------------------
22 #ifndef BMP_H
23 #define BMP_H 1
25 #define BMP_PALETTE_3 1
26 #define BMP_PALETTE_4 2
28 #define BMP_WINDOWS_V3 40
29 #define BMP_OS2_V1 12
30 #define BMP_OS2_V2 64
31 #define BMP_WINDOWS_V4 108
32 #define BMP_WINDOWS_V5 124
34 #define BMP_BI_RGB 0
35 #define BMP_BI_RLE8 1
36 #define BMP_BI_RLE4 2
37 #define BMP_BI_BITFIELDS 3
38 #define BMP_BI_JPEG 4
39 #define BMP_BI_PNG 5
41 #define BMP_RLE_COMMAND 0
42 #define BMP_RLE_ENDOFLINE 0
43 #define BMP_RLE_ENDOFBITMAP 1
44 #define BMP_RLE_DELTA 2
46 #define BMP_RLE_TYPE_RAW 0
47 #define BMP_RLE_TYPE_RLE 1
49 /* BMP header. */
50 typedef struct
52 /* 16 bit - header identifying the type */
53 signed short int magic;
55 /* 32bit - size of the file */
56 int size;
58 /* 16bit - these two are in the spec but "reserved" */
59 signed short int reserved1;
60 signed short int reserved2;
62 /* 32 bit - offset of the bitmap header from data in bytes */
63 signed int off;
65 } bmp_hdr_t;
67 /* BMP info. */
68 typedef struct
70 /* 16bit - Type, ie Windows or OS/2 for the palette info */
71 signed short int type;
72 /* 32bit - The length of the bitmap information header in bytes. */
73 signed int len;
75 /* 32bit - The width of the bitmap in pixels. */
76 signed int width;
78 /* 32bit - The height of the bitmap in pixels. */
79 signed int height;
81 /* 8 bit - The bitmap data is specified in top-down order. */
82 signed char topdown;
84 /* 16 bit - The number of planes. This must be set to a value of one. */
85 signed short int numplanes;
87 /* 16 bit - The number of bits per pixel. */
88 signed short int depth;
90 /* 32bit - The type of compression used. */
91 signed int enctype;
93 /* 32bit - The size of the image in bytes. */
94 signed int size;
96 /* 32bit - The horizontal resolution in pixels/metre. */
97 signed int hres;
99 /* 32bit - The vertical resolution in pixels/metre. */
100 signed int vres;
102 /* 32bit - The number of color indices used by the bitmap. */
103 signed int numcolors;
105 /* 32bit - The number of color indices important for displaying the bitmap. */
106 signed int mincolors;
108 } bmp_info_t;
110 #endif
112 #ifdef __cplusplus
114 #endif