9 Bitmap format support for libgd
11 * Written 2007, Scott MacVicar
12 ---------------------------------------------------------------------------
16 RLE4, RLE8 and Bitfield encoding
17 Add full support for Windows v4 and Windows v5 header formats
19 ----------------------------------------------------------------------------
25 #define BMP_PALETTE_3 1
26 #define BMP_PALETTE_4 2
28 #define BMP_WINDOWS_V3 40
31 #define BMP_WINDOWS_V4 108
32 #define BMP_WINDOWS_V5 124
37 #define BMP_BI_BITFIELDS 3
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
52 /* 16 bit - header identifying the type */
53 signed short int magic
;
55 /* 32bit - size of the file */
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 */
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. */
75 /* 32bit - The width of the bitmap in pixels. */
78 /* 32bit - The height of the bitmap in pixels. */
81 /* 8 bit - The bitmap data is specified in top-down order. */
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. */
93 /* 32bit - The size of the image in bytes. */
96 /* 32bit - The horizontal resolution in pixels/metre. */
99 /* 32bit - The vertical resolution in pixels/metre. */
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
;