1 #include <map>
3 #include "pixelformats.h"
5 using namespace std;
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 /* RGB32 */
21 { PixelFormat::XRGB8888, { 1, { { 32, 1, 1 } }, } },
22 { PixelFormat::XBGR8888, { 1, { { 32, 1, 1 } }, } },
23 { PixelFormat::ARGB8888, { 1, { { 32, 1, 1 } }, } },
24 { PixelFormat::ABGR8888, { 1, { { 32, 1, 1 } }, } },
25 };
27 const struct PixelFormatInfo& get_pixel_format_info(PixelFormat format)
28 {
29 return format_info_array.at(format);
30 }
32 }