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

Unified 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: rename config file 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/bitmaps/example_config.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/include/bmpblk_header.h
diff --git a/firmware/include/bmpblk_header.h b/firmware/include/bmpblk_header.h
new file mode 100644
index 0000000000000000000000000000000000000000..54a18e7ecd733fd3f98620750122a2b8f41f2549
--- /dev/null
+++ b/firmware/include/bmpblk_header.h
@@ -0,0 +1,122 @@
+/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Data structure definitions for firmware screen block (BMPBLOCK).
+ *
+ * The BmpBlock structure looks like:
+ * +----------------------------------------+
+ * | BmpBlock Header |
+ * +----------------------------------------+
+ * | ScrenLayout[0] | \
+ * +----------------------------------------+ |
+ * | ScrenLayout[1] | |
+ * +----------------------------------------+ Localization[0]
+ * | ... | |
+ * +----------------------------------------+ |
+ * | ScrenLayout[number_of_screenlayouts-1] | /
+ * +----------------------------------------+
+ * | ScrenLayout[0] | \
+ * +----------------------------------------+ Localization[1]
+ * | ... | /
+ * +----------------------------------------+ ...
+ * | ScrenLayout[0] | \
+ * +----------------------------------------+ Localization[
+ * | ... | / number_of_localizations-1]
+ * +----------------------------------------+
+ * | ImageInfo[0] |
+ * +----------------------------------------+
+ * | Image Content |
+ * +----------------------------------------+
+ * | ImageInfo[2] | ImageInfo is 4-byte aligned.
+ * +----------------------------------------+
+ * | Image Content |
+ * +----------------------------------------+
+ * | ... |
+ * +----------------------------------------+
+ * | ImageInfo[number_fo_images-1] |
+ * +----------------------------------------+
+ * | Image Content |
+ * +----------------------------------------+
+ *
+ */
+
+#ifndef VBOOT_REFERENCE_BMPBLK_HEADER_H_
+#define VBOOT_REFERENCE_BMPBLK_HEADER_H_
+
+#include "sysincludes.h"
+
+__pragma(pack(push, 1)) /* Support packing for MSVC. */
+
+#define BMPBLOCK_SIGNATURE "$BMP"
+#define BMPBLOCK_SIGNATURE_SIZE (4)
+
+#define BMPBLOCK_MAJOR_VER (0x01)
+#define BMPBLOCK_MINOR_VER (0x00)
+
+#define MAX_IMAGE_IN_LAYOUT (8)
+
+/* BMPBLOCK header, describing how many screen layouts and image infos */
+typedef struct BmpBlockHeader {
+ uint8_t signature[BMPBLOCK_SIGNATURE_SIZE]; /* BMPBLOCK_SIGNATURE $BMP */
+ uint16_t major_version; /* See BMPBLOCK_MAJOR_VER */
+ uint16_t minor_version; /* See BMPBLOCK_MINOR_VER */
+ uint32_t number_of_localizations; /* Number of localizations */
+ uint32_t number_of_screenlayouts; /* Number of screen layouts in each
+ * localization */
+ uint32_t number_of_imageinfos; /* Number of image infos */
+ uint32_t reserved[3];
+} __attribute__((packed)) BmpBlockHeader;
+
+/* Screen layout, describing how to stack multiple images on screen */
+typedef struct ScreenLayout {
+ struct {
+ uint32_t x; /* X-offset of the image to be rendered */
+ uint32_t y; /* Y-offset of the image to be rendered */
+ uint32_t image_info_offset; /* Offset of image info from start of
+ * BMPBLOCK. 0 means end of it. */
+ } images[MAX_IMAGE_IN_LAYOUT]; /* Images contained in the screen. Will be
+ * rendered from 0 to (number_of_images-1). */
+} __attribute__((packed)) ScreenLayout;
+
+/* Constants for screen index */
+typedef enum ScreenIndex {
+ SCREEN_DEVELOPER_MODE = 0,
+ SCREEN_RECOVERY_MODE,
+ SCREEN_RECOVERY_NO_OS,
+ SCREEN_RECOVERY_MISSING_OS,
+ MAX_SCREEN_INDEX,
+} ScreenIndex;
+
+/* Image info, describing the information of the image block */
+typedef struct ImageInfo {
+ uint32_t tag; /* Tag it as a special image, like HWID */
+ uint32_t width; /* Width of the image */
+ uint32_t height; /* Height of the image */
+ uint32_t format; /* File format of the image */
+ uint32_t compression; /* Compression method to the image file */
+ uint32_t original_size; /* Size of the original uncompressed image */
+ uint32_t compressed_size; /* Size of the compressed image */
+ uint32_t reserved;
+ /* NOTE: actual image content follows immediately */
+} __attribute__((packed)) ImageInfo;
+
+/* Constants for ImageInfo.tag */
+typedef enum ImageTag {
+ TAG_NONE = 0,
+ TAG_HWID,
+} ImageTag;
+
+/* Constants for ImageInfo.format */
+typedef enum ImageFormat {
+ FORMAT_INVALID = 0,
+ FORMAT_BMP,
+} ImageFormat;
+
+/* Constants for ImageInfo.compression */
+typedef enum Compression {
+ COMPRESS_NONE = 0,
+ COMPRESS_LZMA,
Bill Richardson 2011/01/28 19:23:19 "LZMA" isn't specific enough to identify the compr
+} Compression;
+
+#endif /* VBOOT_REFERENCE_BMPBLK_HEADER_H_ */
« no previous file with comments | « no previous file | scripts/bitmaps/example_config.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698