]>
Commit | Line | Data |
---|---|---|
059ae173 WD |
1 | /* (C) Copyright 2002 |
2 | * Detlev Zundel, DENX Software Engineering, [email protected]. | |
3 | * | |
1a459660 | 4 | * SPDX-License-Identifier: GPL-2.0+ |
059ae173 WD |
5 | */ |
6 | ||
7 | /************************************************************************/ | |
8 | /* ** Layout of a bmp file */ | |
9 | /************************************************************************/ | |
10 | ||
11 | #ifndef _BMP_H_ | |
12 | #define _BMP_H_ | |
13 | ||
1c3dbe56 | 14 | struct __packed bmp_color_table_entry { |
27b207fd WD |
15 | __u8 blue; |
16 | __u8 green; | |
17 | __u8 red; | |
18 | __u8 reserved; | |
1c3dbe56 | 19 | }; |
059ae173 WD |
20 | |
21 | /* When accessing these fields, remember that they are stored in little | |
22 | endian format, so use linux macros, e.g. le32_to_cpu(width) */ | |
23 | ||
1c3dbe56 | 24 | struct __packed bmp_header { |
27b207fd WD |
25 | /* Header */ |
26 | char signature[2]; | |
27 | __u32 file_size; | |
28 | __u32 reserved; | |
29 | __u32 data_offset; | |
30 | /* InfoHeader */ | |
31 | __u32 size; | |
32 | __u32 width; | |
33 | __u32 height; | |
34 | __u16 planes; | |
35 | __u16 bit_count; | |
36 | __u32 compression; | |
37 | __u32 image_size; | |
38 | __u32 x_pixels_per_m; | |
39 | __u32 y_pixels_per_m; | |
40 | __u32 colors_used; | |
41 | __u32 colors_important; | |
42 | /* ColorTable */ | |
1c3dbe56 | 43 | }; |
8bde7f77 | 44 | |
1c3dbe56 SG |
45 | struct bmp_image { |
46 | struct bmp_header header; | |
27b207fd WD |
47 | /* We use a zero sized array just as a placeholder for variable |
48 | sized array */ | |
1c3dbe56 SG |
49 | struct bmp_color_table_entry color_table[0]; |
50 | }; | |
059ae173 WD |
51 | |
52 | /* Data in the bmp_image is aligned to this length */ | |
27b207fd | 53 | #define BMP_DATA_ALIGN 4 |
059ae173 WD |
54 | |
55 | /* Constants for the compression field */ | |
27b207fd WD |
56 | #define BMP_BI_RGB 0 |
57 | #define BMP_BI_RLE8 1 | |
58 | #define BMP_BI_RLE4 2 | |
059ae173 | 59 | |
27b207fd | 60 | #endif /* _BMP_H_ */ |