summaryrefslogtreecommitdiff
path: root/kms++util/src/testpat.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-08-06 03:42:12 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-08-06 05:09:16 +0300
commitd29a12e5d9473d9b37b817db57d29ee2b886aac8 (patch)
tree71c8748fb660e6e083a2f78e68fb2aa718f8f821 /kms++util/src/testpat.cpp
parentcdcf658d8926ac7f740da06cfe01098b7b5a081f (diff)
kms++: Add support for the planar YUV formats
Add support for the 6 planar YUV formats (YUV and YVU, combined with 420, 422 or 444 subsampling) to the PixelFormat class, the Python API, and the drawing utilities. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'kms++util/src/testpat.cpp')
-rw-r--r--kms++util/src/testpat.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp
index c120de3..ac38673 100644
--- a/kms++util/src/testpat.cpp
+++ b/kms++util/src/testpat.cpp
@@ -120,6 +120,15 @@ static void draw_test_pattern_part(IFramebuffer& fb, unsigned start_y, unsigned
case PixelColorType::YUV:
switch (plane_info.xsub + plane_info.ysub) {
+ case 2:
+ for (y = start_y; y < end_y; y++) {
+ for (x = 0; x < w; x++) {
+ RGB pixel = get_test_pattern_pixel(fb, x, y);
+ draw_yuv444_pixel(fb, x, y, pixel.yuv(yuvt));
+ }
+ }
+ break;
+
case 3:
for (y = start_y; y < end_y; y++) {
for (x = 0; x < w; x += 2) {