diff --git a/libkmstest/conv.cpp b/libkmstest/conv.cpp
index d4392536ef85f1fa6b0d211fcbf55e1a39b0b407..45f4a757de7928caa2d6ed016f1f66cfe71eb7b4 100644 (file)
--- a/libkmstest/conv.cpp
+++ b/libkmstest/conv.cpp
#include <drm_fourcc.h>
#include <stdexcept>
-#include "framebuffer.h"
+#include "kms++.h"
#include "color.h"
-#include "conv.h"
namespace kms
{
-static RGB read_rgb(const Framebuffer& fb, int x, int y)
+static RGB read_rgb(const DumbFramebuffer& fb, int x, int y)
{
uint32_t *pc = (uint32_t *)(fb.map(0) + fb.stride(0) * y);
return RGB((c >> 16) & 0xff, (c >> 8) & 0xff, c & 0xff);
}
-static YUV read_rgb_as_yuv(const Framebuffer& fb, int x, int y)
+static YUV read_rgb_as_yuv(const DumbFramebuffer& fb, int x, int y)
{
RGB rgb = read_rgb(fb, x, y);
return YUV(rgb);
}
-static void fb_rgb_to_packed_yuv(Framebuffer& dst_fb, const Framebuffer& src_fb)
+static void fb_rgb_to_packed_yuv(DumbFramebuffer& dst_fb, const DumbFramebuffer& src_fb)
{
unsigned w = src_fb.width();
unsigned h = src_fb.height();
@@ -35,13 +34,13 @@ static void fb_rgb_to_packed_yuv(Framebuffer& dst_fb, const Framebuffer& src_fb)
YUV yuv2 = read_rgb_as_yuv(src_fb, x + 1, y);
switch (dst_fb.format()) {
- case DRM_FORMAT_UYVY:
+ case PixelFormat::UYVY:
dst[x * 2 + 0] = (yuv1.u + yuv2.u) / 2;
dst[x * 2 + 1] = yuv1.y;
dst[x * 2 + 2] = (yuv1.v + yuv2.v) / 2;
dst[x * 2 + 3] = yuv2.y;
break;
- case DRM_FORMAT_YUYV:
+ case PixelFormat::YUYV:
dst[x * 2 + 0] = yuv1.y;
dst[x * 2 + 1] = (yuv1.u + yuv2.u) / 2;
dst[x * 2 + 2] = yuv2.y;
}
}
-static void fb_rgb_to_semiplanar_yuv(Framebuffer& dst_fb, const Framebuffer& src_fb)
+static void fb_rgb_to_semiplanar_yuv(DumbFramebuffer& dst_fb, const DumbFramebuffer& src_fb)
{
unsigned w = src_fb.width();
unsigned h = src_fb.height();
}
}
-static void fb_rgb_to_rgb565(Framebuffer& dst_fb, const Framebuffer& src_fb)
+static void fb_rgb_to_rgb565(DumbFramebuffer& dst_fb, const DumbFramebuffer& src_fb)
{
unsigned w = src_fb.width();
unsigned h = src_fb.height();
}
}
-void color_convert(Framebuffer& dst, const Framebuffer &src)
+void color_convert(DumbFramebuffer& dst, const DumbFramebuffer &src)
{
switch (dst.format()) {
- case DRM_FORMAT_NV12:
- case DRM_FORMAT_NV21:
+ case PixelFormat::NV12:
+ case PixelFormat::NV21:
fb_rgb_to_semiplanar_yuv(dst, src);
break;
- case DRM_FORMAT_YUYV:
- case DRM_FORMAT_UYVY:
+ case PixelFormat::YUYV:
+ case PixelFormat::UYVY:
fb_rgb_to_packed_yuv(dst, src);
break;
- case DRM_FORMAT_RGB565:
+ case PixelFormat::RGB565:
fb_rgb_to_rgb565(dst, src);
break;