]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/bmp_layout.h
Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging
[people/ms/u-boot.git] / include / bmp_layout.h
CommitLineData
059ae173
WD
1/* (C) Copyright 2002
2 * Detlev Zundel, DENX Software Engineering, dzu@denx.de.
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22
23/************************************************************************/
24/* ** Layout of a bmp file */
25/************************************************************************/
26
27#ifndef _BMP_H_
28#define _BMP_H_
29
30typedef struct bmp_color_table_entry {
27b207fd
WD
31 __u8 blue;
32 __u8 green;
33 __u8 red;
34 __u8 reserved;
35} __attribute__ ((packed)) bmp_color_table_entry_t;
059ae173
WD
36
37/* When accessing these fields, remember that they are stored in little
38 endian format, so use linux macros, e.g. le32_to_cpu(width) */
39
27b207fd
WD
40typedef struct bmp_header {
41 /* Header */
42 char signature[2];
43 __u32 file_size;
44 __u32 reserved;
45 __u32 data_offset;
46 /* InfoHeader */
47 __u32 size;
48 __u32 width;
49 __u32 height;
50 __u16 planes;
51 __u16 bit_count;
52 __u32 compression;
53 __u32 image_size;
54 __u32 x_pixels_per_m;
55 __u32 y_pixels_per_m;
56 __u32 colors_used;
57 __u32 colors_important;
58 /* ColorTable */
8bde7f77 59
27b207fd 60} __attribute__ ((packed)) bmp_header_t;
059ae173
WD
61
62typedef struct bmp_image {
27b207fd
WD
63 bmp_header_t header;
64 /* We use a zero sized array just as a placeholder for variable
65 sized array */
66 bmp_color_table_entry_t color_table[0];
059ae173
WD
67} bmp_image_t;
68
69/* Data in the bmp_image is aligned to this length */
27b207fd 70#define BMP_DATA_ALIGN 4
059ae173
WD
71
72/* Constants for the compression field */
27b207fd
WD
73#define BMP_BI_RGB 0
74#define BMP_BI_RLE8 1
75#define BMP_BI_RLE4 2
059ae173 76
27b207fd 77#endif /* _BMP_H_ */