From 9916712a62169606d845510028a3ea6f84bd442f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Sat, 11 Jun 2016 21:46:24 +0300 Subject: kms++: organize into subdirs --- kms++/src/pixelformats.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 kms++/src/pixelformats.cpp (limited to 'kms++/src/pixelformats.cpp') diff --git a/kms++/src/pixelformats.cpp b/kms++/src/pixelformats.cpp new file mode 100644 index 0000000..f2b1137 --- /dev/null +++ b/kms++/src/pixelformats.cpp @@ -0,0 +1,32 @@ +#include + +#include + +using namespace std; + +namespace kms +{ +static const map format_info_array = { + /* YUV packed */ + { PixelFormat::UYVY, { 1, { { 16, 2, 1 } }, } }, + { PixelFormat::YUYV, { 1, { { 16, 2, 1 } }, } }, + { PixelFormat::YVYU, { 1, { { 16, 2, 1 } }, } }, + { PixelFormat::VYUY, { 1, { { 16, 2, 1 } }, } }, + /* YUV semi-planar */ + { PixelFormat::NV12, { 2, { { 8, 1, 1, }, { 8, 2, 2 } }, } }, + { PixelFormat::NV21, { 2, { { 8, 1, 1, }, { 8, 2, 2 } }, } }, + /* RGB16 */ + { PixelFormat::RGB565, { 1, { { 16, 1, 1 } }, } }, + /* RGB32 */ + { PixelFormat::XRGB8888, { 1, { { 32, 1, 1 } }, } }, + { PixelFormat::XBGR8888, { 1, { { 32, 1, 1 } }, } }, + { PixelFormat::ARGB8888, { 1, { { 32, 1, 1 } }, } }, + { PixelFormat::ABGR8888, { 1, { { 32, 1, 1 } }, } }, +}; + +const struct PixelFormatInfo& get_pixel_format_info(PixelFormat format) +{ + return format_info_array.at(format); +} + +} -- cgit v1.2.3