cbgfx: add draw_bitmap
draw_bitmap renders a bitmap image on screen with position and sizes
scaled relative to the screen. images are scaled up or down by nearest
neighbor interpolation.
BUG=chrome-os-partner:43444
BRANCH=tot
TEST=drew bitmap images on Samus
Change-Id: Ib599acc85b25626a6aed1fa9884ecd8e169bb860
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: c910c9cdb7efc53aace067bd081aeefc07556811
Original-Reviewed-on: https://chromium-review.googlesource.com/290302
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Change-Id: Ib599acc85b25626a6aed1fa9884ecd8e169bb860
Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/295532
Reviewed-on: http://review.coreboot.org/11584
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
diff --git a/payloads/libpayload/drivers/video/bitmap.h b/payloads/libpayload/drivers/video/bitmap.h
new file mode 100644
index 0000000..10d60a3
--- /dev/null
+++ b/payloads/libpayload/drivers/video/bitmap.h
@@ -0,0 +1,36 @@
+#ifndef __BITMAP_H__
+#define __BITMAP_H__
+
+#include <stdint.h>
+
+struct bitmap_file_header {
+ uint8_t signature[2];
+ uint32_t file_size;
+ uint16_t reserved[2];
+ uint32_t bitmap_offset;
+} __attribute__ ((__packed__));
+
+/* Bitmap version 3 */
+
+struct bitmap_header_v3 {
+ uint32_t header_size;
+ int32_t width;
+ int32_t height;
+ uint16_t planes;
+ uint16_t bits_per_pixel;
+ uint32_t compression;
+ uint32_t size;
+ int32_t h_res;
+ int32_t v_res;
+ uint32_t colors_used;
+ uint32_t colors_important;
+} __attribute__ ((__packed__));
+
+struct bitmap_palette_element_v3 {
+ uint8_t blue;
+ uint8_t green;
+ uint8_t red;
+ uint8_t reserved;
+} __attribute__ ((__packed__));
+
+#endif /* __BITMAP_H__ */