From 47e808023f98f74673906ef7de34e774cd26f52b Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 16 Oct 2018 11:35:44 +0300 Subject: Add AR12 & AR15 support Signed-off-by: Tomi Valkeinen --- kms++util/src/drawing.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'kms++util/src/drawing.cpp') diff --git a/kms++util/src/drawing.cpp b/kms++util/src/drawing.cpp index 8885112..9da7a77 100644 --- a/kms++util/src/drawing.cpp +++ b/kms++util/src/drawing.cpp @@ -56,6 +56,18 @@ void draw_rgb_pixel(IFramebuffer& buf, unsigned x, unsigned y, RGB color) *p = color.bgr565(); break; } + case PixelFormat::ARGB4444: + { + uint16_t *p = (uint16_t*)(buf.map(0) + buf.stride(0) * y + x * 2); + *p = color.argb4444(); + break; + } + case PixelFormat::ARGB1555: + { + uint16_t *p = (uint16_t*)(buf.map(0) + buf.stride(0) * y + x * 2); + *p = color.argb1555(); + break; + } default: throw std::invalid_argument("invalid pixelformat"); } @@ -168,6 +180,8 @@ void draw_rect(IFramebuffer &fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, case PixelFormat::BGR888: case PixelFormat::RGB565: case PixelFormat::BGR565: + case PixelFormat::ARGB4444: + case PixelFormat::ARGB1555: for (j = 0; j < h; j++) { for (i = 0; i < w; i++) { draw_rgb_pixel(fb, x + i, y + j, color); @@ -240,6 +254,8 @@ static void draw_char(IFramebuffer& buf, uint32_t xpos, uint32_t ypos, char c, R case PixelFormat::BGR888: case PixelFormat::RGB565: case PixelFormat::BGR565: + case PixelFormat::ARGB4444: + case PixelFormat::ARGB1555: for (y = 0; y < 8; y++) { for (x = 0; x < 8; x++) { bool b = get_char_pixel(c, x, y); -- cgit v1.2.3