From cdcf658d8926ac7f740da06cfe01098b7b5a081f Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 6 Aug 2020 03:32:42 +0300 Subject: kms++: Add support for semiplanar YUV422 formats (NV16 and NV61) Add support for the NV16 and NV61 pixel formats to the PixelFormat class, the Python API, and the drawing utilities. Signed-off-by: Laurent Pinchart --- kms++util/src/testpat.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'kms++util/src/testpat.cpp') diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp index f9a3c8a..c120de3 100644 --- a/kms++util/src/testpat.cpp +++ b/kms++util/src/testpat.cpp @@ -106,6 +106,7 @@ static void draw_test_pattern_part(IFramebuffer& fb, unsigned start_y, unsigned unsigned w = fb.width(); const PixelFormatInfo& format_info = get_pixel_format_info(fb.format()); + const PixelFormatPlaneInfo& plane_info = format_info.planes[format_info.num_planes - 1]; switch (format_info.type) { case PixelColorType::RGB: @@ -118,8 +119,8 @@ static void draw_test_pattern_part(IFramebuffer& fb, unsigned start_y, unsigned break; case PixelColorType::YUV: - switch (format_info.num_planes) { - case 1: + switch (plane_info.xsub + plane_info.ysub) { + case 3: for (y = start_y; y < end_y; y++) { for (x = 0; x < w; x += 2) { RGB pixel1 = get_test_pattern_pixel(fb, x, y); @@ -129,7 +130,7 @@ static void draw_test_pattern_part(IFramebuffer& fb, unsigned start_y, unsigned } break; - case 2: + case 4: for (y = start_y; y < end_y; y += 2) { for (x = 0; x < w; x += 2) { RGB pixel00 = get_test_pattern_pixel(fb, x, y); -- cgit v1.2.3