Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: firmware/include/bmpblk_header.h

Issue 6307007: Implement bmpblk_utility tool that creates bmp block from image files. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: ready for review Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | scripts/bitmaps/screen_layouts.yaml » ('j') | utility/bmpblk_utility.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 *
5 * Data structure definitions for firmware screen block (BMPBLOCK).
6 *
7 * The BmpBlock structure looks like:
8 * +----------------------------------------+
9 * | BmpBlock Header |
10 * +----------------------------------------+
11 * | ScrenLayout[0] | \
12 * +----------------------------------------+ |
13 * | ScrenLayout[1] | |
14 * +----------------------------------------+ Localization[0]
15 * | ... | |
16 * +----------------------------------------+ |
17 * | ScrenLayout[number_of_screenlayouts-1] | /
18 * +----------------------------------------+
19 * | ScrenLayout[0] | \
20 * +----------------------------------------+ Localization[1]
21 * | ... | /
22 * +----------------------------------------+ ...
23 * | ScrenLayout[0] | \
24 * +----------------------------------------+ Localization[
25 * | ... | / number_of_localizations-1]
26 * +----------------------------------------+
27 * | ImageInfo[0] |
28 * +----------------------------------------+
29 * | Image Content |
30 * +----------------------------------------+
31 * | ImageInfo[2] | ImageInfo is 4-byte aligned.
32 * +----------------------------------------+
33 * | Image Content |
34 * +----------------------------------------+
35 * | ... |
36 * +----------------------------------------+
37 * | ImageInfo[number_fo_images-1] |
38 * +----------------------------------------+
39 * | Image Content |
40 * +----------------------------------------+
41 *
42 */
43
44 #ifndef VBOOT_REFERENCE_BMPBLK_HEADER_H_
45 #define VBOOT_REFERENCE_BMPBLK_HEADER_H_
46
47 #include "sysincludes.h"
48
49 __pragma(pack(push, 1)) /* Support packing for MSVC. */
50
51 #define BMPBLOCK_SIGNATURE "$BMP"
52 #define BMPBLOCK_SIGNATURE_SIZE (4)
53
54 #define BMPBLOCK_MAJOR_VER (0x01)
55 #define BMPBLOCK_MINOR_VER (0x00)
56
57 #define MAX_IMAGE_IN_LAYOUT (8)
58
59 /* BMPBLOCK header, describing how many screen layouts and image infos */
60 typedef struct BmpBlockHeader {
61 uint8_t signature[BMPBLOCK_SIGNATURE_SIZE]; /* BMPBLOCK_SIGNATURE $BMP */
62 uint16_t major_version; /* see BMPBLOCK_MAJOR_VER */
63 uint16_t minor_version; /* see BMPBLOCK_MINOR_VER */
64 uint32_t number_of_localizations; /* Number of localizations */
65 uint32_t number_of_screenlayouts; /* Number of screen layouts */
Hung-Te 2011/01/21 07:45:41 adding "in each localization" in comments?
Tom Wai-Hong Tam 2011/01/21 08:32:09 Done.
66 uint32_t number_of_imageinfos; /* Number of image infos */
67 uint32_t reserved[3];
68 } __attribute__((packed)) BmpBlockHeader;
69
70 /* Screen layout, describing how to stack multiple images on screen */
71 typedef struct ScreenLayout {
72 struct {
73 uint32_t x; /* X-offset of the image to be rendered */
74 uint32_t y; /* Y-offset of the image to be rendered */
75 uint32_t image_info_offset; /* Offset of image info from start of
76 * BMPBLOCK. 0 means end of it. */
77 } images[MAX_IMAGE_IN_LAYOUT]; /* Images contained in the screen. Will be
78 * rendered from 0 to (number_of_images-1). */
79 } __attribute__((packed)) ScreenLayout;
80
81 /* Constants for screen index */
82 typedef enum ScreenIndex {
83 SCREEN_DEVELOPER_MODE = 0,
84 SCREEN_RECOVERY_MODE,
85 SCREEN_RECOVERY_NO_OS,
86 SCREEN_RECOVERY_MISSING_OS,
87 MAX_SCREEN_INDEX,
88 } ScreenIndex;
89
90 /* Image info, describing the information of the image block */
91 typedef struct ImageInfo {
92 uint32_t tag; /* Tag it as a special image, like HWID */
93 uint32_t width; /* Width of the image */
94 uint32_t height; /* Height of the image */
95 uint32_t format; /* File format of the image */
96 uint32_t compression; /* Compression method to the image file */
97 uint32_t original_size; /* Size of the original uncompressed image */
98 uint32_t compressed_size; /* Size of the compressed image */
99 uint32_t reserved;
100 /* NOTE: actual image content follows immediately */
101 } __attribute__((packed)) ImageInfo;
102
103 /* Constants for ImageInfo.tag */
104 typedef enum ImageTag {
105 TAG_NONE = 0,
106 TAG_HWID,
107 } ImageTag;
108
109 /* Constants for ImageInfo.format */
110 typedef enum ImageFormat {
111 FORMAT_INVALID = 0,
112 FORMAT_BMP,
113 } ImageFormat;
114
115 /* Constants for ImageInfo.compression */
116 typedef enum Compression {
117 COMPRESS_NONE = 0,
118 COMPRESS_LZMA,
119 } Compression;
120
121 #endif /* VBOOT_REFERENCE_BMPBLK_HEADER_H_ */
OLDNEW
« no previous file with comments | « no previous file | scripts/bitmaps/screen_layouts.yaml » ('j') | utility/bmpblk_utility.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698