diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-08-06 05:18:05 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2020-08-10 09:44:48 +0300 |
commit | b397a5f6e035668a9d74f8af09c20cf947e811cf (patch) | |
tree | 22610c3d70b02598f381755282cbee6a1cbf4c9f /kms++ | |
parent | cc8771b7dbefa8a813e3afaae79d2eefd46dff51 (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>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'kms++')
-rw-r--r-- | kms++/inc/kms++/pixelformats.h | 7 | ||||
-rw-r--r-- | kms++/src/pixelformats.cpp | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/kms++/inc/kms++/pixelformats.h b/kms++/inc/kms++/pixelformats.h index f550f2f..746f9e2 100644 --- a/kms++/inc/kms++/pixelformats.h +++ b/kms++/inc/kms++/pixelformats.h @@ -20,6 +20,13 @@ enum class PixelFormat : uint32_t NV16 = MakeFourCC("NV16"), NV61 = MakeFourCC("NV61"), + YUV420 = MakeFourCC("YU12"), + YVU420 = MakeFourCC("YV12"), + YUV422 = MakeFourCC("YU16"), + YVU422 = MakeFourCC("YV16"), + YUV444 = MakeFourCC("YU24"), + YVU444 = MakeFourCC("YV24"), + UYVY = MakeFourCC("UYVY"), YUYV = MakeFourCC("YUYV"), YVYU = MakeFourCC("YVYU"), diff --git a/kms++/src/pixelformats.cpp b/kms++/src/pixelformats.cpp index d34df64..fe86fca 100644 --- a/kms++/src/pixelformats.cpp +++ b/kms++/src/pixelformats.cpp @@ -17,6 +17,13 @@ static const map<PixelFormat, PixelFormatInfo> format_info_array = { { PixelFormat::NV21, { PixelColorType::YUV, 2, { { 8, 1, 1, }, { 8, 2, 2 } }, } }, { PixelFormat::NV16, { PixelColorType::YUV, 2, { { 8, 1, 1, }, { 8, 2, 1 } }, } }, { PixelFormat::NV61, { PixelColorType::YUV, 2, { { 8, 1, 1, }, { 8, 2, 1 } }, } }, + /* YUV planar */ + { PixelFormat::YUV420, { PixelColorType::YUV, 3, { { 8, 1, 1, }, { 8, 2, 2 }, { 8, 2, 2 } }, } }, + { PixelFormat::YVU420, { PixelColorType::YUV, 3, { { 8, 1, 1, }, { 8, 2, 2 }, { 8, 2, 2 } }, } }, + { PixelFormat::YUV422, { PixelColorType::YUV, 3, { { 8, 1, 1, }, { 8, 2, 1 }, { 8, 2, 1 } }, } }, + { PixelFormat::YVU422, { PixelColorType::YUV, 3, { { 8, 1, 1, }, { 8, 2, 1 }, { 8, 2, 1 } }, } }, + { PixelFormat::YUV444, { PixelColorType::YUV, 3, { { 8, 1, 1, }, { 8, 1, 1 }, { 8, 1, 1 } }, } }, + { PixelFormat::YVU444, { PixelColorType::YUV, 3, { { 8, 1, 1, }, { 8, 1, 1 }, { 8, 1, 1 } }, } }, /* RGB16 */ { PixelFormat::RGB565, { PixelColorType::RGB, 1, { { 16, 1, 1 } }, } }, { PixelFormat::BGR565, { PixelColorType::RGB, 1, { { 16, 1, 1 } }, } }, |