summaryrefslogtreecommitdiff
path: root/libkmstest
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2015-10-10 22:04:56 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-10-10 22:04:56 +0300
commit6f11b260ec7da40cf6301a830d56bc4030097e7e (patch)
tree2b113615e57ef62524d860326f1ecd46b5c7e30e /libkmstest
parent558fe916cbf327f3f4f4d65974048d4dff3e4cd4 (diff)
add CMY and WB to test pattern
Diffstat (limited to 'libkmstest')
-rw-r--r--libkmstest/testpat.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/libkmstest/testpat.cpp b/libkmstest/testpat.cpp
index f9cf907..1618855 100644
--- a/libkmstest/testpat.cpp
+++ b/libkmstest/testpat.cpp
@@ -131,8 +131,8 @@ static void draw_yuv420_macropixel(DumbFramebuffer& buf, unsigned x, unsigned y,
static RGB get_test_pattern_pixel(DumbFramebuffer& fb, unsigned x, unsigned y)
{
- unsigned w = fb.width();
- unsigned h = fb.height();
+ const unsigned w = fb.width();
+ const unsigned h = fb.height();
const unsigned mw = 20;
@@ -171,7 +171,7 @@ static RGB get_test_pattern_pixel(DumbFramebuffer& fb, unsigned x, unsigned y)
else if (w - x == y || x == h - y)
return RGB(255, 255, 255);
else {
- int t = (x - xm1 - 1) * 3 / (xm2 - xm1 - 1);
+ int t = (x - xm1 - 1) * 8 / (xm2 - xm1 - 1);
unsigned r = 0, g = 0, b = 0;
unsigned c = (y - ym1 - 1) % 256;
@@ -186,6 +186,20 @@ static RGB get_test_pattern_pixel(DumbFramebuffer& fb, unsigned x, unsigned y)
case 2:
b = c;
break;
+ case 3:
+ g = b = c;
+ break;
+ case 4:
+ r = b = c;
+ break;
+ case 5:
+ r = g = c;
+ break;
+ case 6:
+ r = g = b = c;
+ break;
+ case 7:
+ break;
}
return RGB(r, g, b);