2
* (C) Copyright 2003-2004
3
* Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
5
* SPDX-License-Identifier: GPL-2.0+
9
* Neutralize little endians.
11
#define SWAP_LONG(data) ((unsigned long) \
12
(((unsigned long)(data) >> 24) | \
13
((unsigned long)(data) << 24) | \
14
(((unsigned long)(data) >> 8) & 0x0000ff00 ) | \
15
(((unsigned long)(data) << 8) & 0x00ff0000 )))
16
#define SWAP_SHORT(data) ((unsigned short) \
17
(((unsigned short)(data) >> 8 ) | \
18
((unsigned short)(data) << 8 )))
19
#define LOAD_LONG(data) SWAP_LONG(data)
20
#define LOAD_SHORT(data) SWAP_SHORT(data)
22
#define S1D_WRITE_PALETTE(p,i,r,g,b) \
24
out_8(&((uchar*)(p))[palette_index], (uchar)(i)); \
25
out_8(&((uchar*)(p))[palette_index], (uchar)(r)); \
26
out_8(&((uchar*)(p))[palette_index], (uchar)(g)); \
27
out_8(&((uchar*)(p))[palette_index], (uchar)(b)); \
36
typedef struct /**** BMP file info structure ****/
38
unsigned int biSize; /* Size of info header */
39
int biWidth; /* Width of image */
40
int biHeight; /* Height of image */
41
unsigned short biPlanes; /* Number of color planes */
42
unsigned short biBitCount; /* Number of bits per pixel */
43
unsigned int biCompression; /* Type of compression to use */
44
unsigned int biSizeImage; /* Size of image data */
45
int biXPelsPerMeter; /* X pixels per meter */
46
int biYPelsPerMeter; /* Y pixels per meter */
47
unsigned int biClrUsed; /* Number of colors used */
48
unsigned int biClrImportant; /* Number of important colors */