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/inc/kms++util/cpuframebuffer.h | 2 +- kms++util/inc/kms++util/extcpuframebuffer.h | 2 +- kms++util/inc/kms++util/kms++util.h | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'kms++util/inc') diff --git a/kms++util/inc/kms++util/cpuframebuffer.h b/kms++util/inc/kms++util/cpuframebuffer.h index 1498528..4273e0d 100644 --- a/kms++util/inc/kms++util/cpuframebuffer.h +++ b/kms++util/inc/kms++util/cpuframebuffer.h @@ -5,7 +5,7 @@ namespace kms { -class CPUFramebuffer : public IMappedFramebuffer { +class CPUFramebuffer : public IFramebuffer { public: CPUFramebuffer(uint32_t width, uint32_t height, PixelFormat format); diff --git a/kms++util/inc/kms++util/extcpuframebuffer.h b/kms++util/inc/kms++util/extcpuframebuffer.h index 3652ec4..92ca43a 100644 --- a/kms++util/inc/kms++util/extcpuframebuffer.h +++ b/kms++util/inc/kms++util/extcpuframebuffer.h @@ -5,7 +5,7 @@ namespace kms { -class ExtCPUFramebuffer : public IMappedFramebuffer +class ExtCPUFramebuffer : public IFramebuffer { public: ExtCPUFramebuffer(uint32_t width, uint32_t height, PixelFormat format, diff --git a/kms++util/inc/kms++util/kms++util.h b/kms++util/inc/kms++util/kms++util.h index d45497e..8e45b0d 100644 --- a/kms++util/inc/kms++util/kms++util.h +++ b/kms++util/inc/kms++util/kms++util.h @@ -15,18 +15,18 @@ namespace kms { -class IMappedFramebuffer; +class IFramebuffer; -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_yuv420_macropixel(IMappedFramebuffer& buf, unsigned x, unsigned y, +void draw_rgb_pixel(IFramebuffer& buf, unsigned x, unsigned y, RGB color); +void draw_yuv422_macropixel(IFramebuffer& buf, unsigned x, unsigned y, YUV yuv1, YUV yuv2); +void draw_yuv420_macropixel(IFramebuffer& buf, unsigned x, unsigned y, YUV yuv1, YUV yuv2, YUV yuv3, YUV yuv4); -void draw_rect(IMappedFramebuffer &fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color); -void draw_text(IMappedFramebuffer& buf, uint32_t x, uint32_t y, const std::string& str, RGB color); +void draw_rect(IFramebuffer &fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color); +void draw_text(IFramebuffer& buf, uint32_t x, uint32_t y, const std::string& str, RGB color); -void draw_color_bar(IMappedFramebuffer& buf, int old_xpos, int xpos, int width); +void draw_color_bar(IFramebuffer& buf, int old_xpos, int xpos, int width); -void draw_test_pattern(IMappedFramebuffer &fb, YUVType yuvt = YUVType::BT601_Lim); +void draw_test_pattern(IFramebuffer &fb, YUVType yuvt = YUVType::BT601_Lim); } #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) -- cgit v1.2.3