1 #include <map> 2 3 #include <kms++/pixelformats.h> 4 5 using namespace std; 6 7 namespace kms 8 { 9 static const map<PixelFormat, PixelFormatInfo> format_info_array = { 10 /* YUV packed */ 11 { PixelFormat::UYVY, { 1, { { 16, 2, 1 } }, } }, 12 { PixelFormat::YUYV, { 1, { { 16, 2, 1 } }, } }, 13 { PixelFormat::YVYU, { 1, { { 16, 2, 1 } }, } }, 14 { PixelFormat::VYUY, { 1, { { 16, 2, 1 } }, } }, 15 /* YUV semi-planar */ 16 { PixelFormat::NV12, { 2, { { 8, 1, 1, }, { 8, 2, 2 } }, } }, 17 { PixelFormat::NV21, { 2, { { 8, 1, 1, }, { 8, 2, 2 } }, } }, 18 /* RGB16 */ 19 { PixelFormat::RGB565, { 1, { { 16, 1, 1 } }, } }, 20 { PixelFormat::BGR565, { 1, { { 16, 1, 1 } }, } }, 21 /* RGB24 */ 22 { PixelFormat::RGB888, { 1, { { 24, 1, 1 } }, } }, 23 { PixelFormat::BGR888, { 1, { { 24, 1, 1 } }, } }, 24 /* RGB32 */ 25 { PixelFormat::XRGB8888, { 1, { { 32, 1, 1 } }, } }, 26 { PixelFormat::XBGR8888, { 1, { { 32, 1, 1 } }, } }, 27 { PixelFormat::ARGB8888, { 1, { { 32, 1, 1 } }, } }, 28 { PixelFormat::ABGR8888, { 1, { { 32, 1, 1 } }, } }, 29 }; 30 31 const struct PixelFormatInfo& get_pixel_format_info(PixelFormat format) 32 { 33 return format_info_array.at(format); 34 } 35 36 } 37