summaryrefslogtreecommitdiff
path: root/libkms++/pixelformats.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-03-16 12:18:12 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-03-16 12:18:12 +0200
commit11d248214edcc489eacf5c76ba2027ec682394b6 (patch)
tree0e48bb9544f38bd6d6a4f211527a1c3817eba742 /libkms++/pixelformats.cpp
parent83d27aa30549194068fef320f735245a7735a5ea (diff)
add public PixelFormatInfo
Diffstat (limited to 'libkms++/pixelformats.cpp')
-rw-r--r--libkms++/pixelformats.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/libkms++/pixelformats.cpp b/libkms++/pixelformats.cpp
new file mode 100644
index 0000000..594bd6d
--- /dev/null
+++ b/libkms++/pixelformats.cpp
@@ -0,0 +1,32 @@
+#include <map>
+
+#include "pixelformats.h"
+
+using namespace std;
+
+namespace kms
+{
+static const map<PixelFormat, PixelFormatInfo> 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);
+}
+
+}