summaryrefslogtreecommitdiff
path: root/kms++util/src/drawing.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-10-03 12:32:52 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-10-03 12:33:11 +0300
commitfab9bb700372008130e5026fa9fe5fd22ac6ec4e (patch)
tree1e83b437762697ab833bd8c22896b8733593ca5f /kms++util/src/drawing.cpp
parent33f343d18d5d1886dd04314bded1781c3e46f7e7 (diff)
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.
Diffstat (limited to 'kms++util/src/drawing.cpp')
-rw-r--r--kms++util/src/drawing.cpp12
1 files changed, 6 insertions, 6 deletions
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);