From fab9bb700372008130e5026fa9fe5fd22ac6ec4e Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 3 Oct 2017 12:32:52 +0300 Subject: Rework framebuffer classes Drop (I)MappedFramebuffer, as it doesn't really provide any value, and have most of the methods be present in IFramebuffer with default exception throwing implementation. This gives us simpler way to use the framebuffers, as almost always we can just use a pointer to IFramebuffer. --- kms++util/src/drawing.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'kms++util/src/drawing.cpp') diff --git a/kms++util/src/drawing.cpp b/kms++util/src/drawing.cpp index ffb7feb..a187dc0 100644 --- a/kms++util/src/drawing.cpp +++ b/kms++util/src/drawing.cpp @@ -6,7 +6,7 @@ using namespace std; namespace kms { -void draw_rgb_pixel(IMappedFramebuffer& buf, unsigned x, unsigned y, RGB color) +void draw_rgb_pixel(IFramebuffer& buf, unsigned x, unsigned y, RGB color) { switch (buf.format()) { case PixelFormat::XRGB8888: @@ -56,7 +56,7 @@ void draw_rgb_pixel(IMappedFramebuffer& buf, unsigned x, unsigned y, RGB color) } } -void draw_yuv422_macropixel(IMappedFramebuffer& buf, unsigned x, unsigned y, YUV yuv1, YUV yuv2) +void draw_yuv422_macropixel(IFramebuffer& buf, unsigned x, unsigned y, YUV yuv1, YUV yuv2) { ASSERT((x & 1) == 0); @@ -101,7 +101,7 @@ void draw_yuv422_macropixel(IMappedFramebuffer& buf, unsigned x, unsigned y, YUV } } -void draw_yuv420_macropixel(IMappedFramebuffer& buf, unsigned x, unsigned y, +void draw_yuv420_macropixel(IFramebuffer& buf, unsigned x, unsigned y, YUV yuv1, YUV yuv2, YUV yuv3, YUV yuv4) { ASSERT((x & 1) == 0); @@ -143,7 +143,7 @@ void draw_yuv420_macropixel(IMappedFramebuffer& buf, unsigned x, unsigned y, } } -void draw_rect(IMappedFramebuffer &fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color) +void draw_rect(IFramebuffer &fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color) { unsigned i, j; YUV yuvcolor = color.yuv(); @@ -199,7 +199,7 @@ static bool get_char_pixel(char c, uint32_t x, uint32_t y) return bit; } -static void draw_char(IMappedFramebuffer& buf, uint32_t xpos, uint32_t ypos, char c, RGB color) +static void draw_char(IFramebuffer& buf, uint32_t xpos, uint32_t ypos, char c, RGB color) { unsigned x, y; YUV yuvcolor = color.yuv(); @@ -257,7 +257,7 @@ static void draw_char(IMappedFramebuffer& buf, uint32_t xpos, uint32_t ypos, cha } } -void draw_text(IMappedFramebuffer& buf, uint32_t x, uint32_t y, const string& str, RGB color) +void draw_text(IFramebuffer& buf, uint32_t x, uint32_t y, const string& str, RGB color) { for(unsigned i = 0; i < str.size(); i++) draw_char(buf, (x + 8 * i), y, str[i], color); -- cgit v1.2.3