summaryrefslogtreecommitdiff
path: root/kms++util/color.h
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-11 20:17:35 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-11 20:17:35 +0300
commit17d180891f1e237ea5d25835999a8b23a6e7946d (patch)
tree5963fe4d338f6272daf55c76ed355effb47afc71 /kms++util/color.h
parent38a71ee72c47f3287c327113ce411f236cac05ef (diff)
rename dirs
Diffstat (limited to 'kms++util/color.h')
-rw-r--r--kms++util/color.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/kms++util/color.h b/kms++util/color.h
new file mode 100644
index 0000000..ef85a67
--- /dev/null
+++ b/kms++util/color.h
@@ -0,0 +1,39 @@
+#pragma once
+
+#include <cstdint>
+
+namespace kms
+{
+struct YUV;
+
+struct RGB
+{
+ RGB();
+ RGB(uint8_t r, uint8_t g, uint8_t b);
+ RGB(uint8_t a, uint8_t r, uint8_t g, uint8_t b);
+ RGB(uint32_t argb);
+
+ uint32_t rgb888() const;
+ uint32_t argb8888() const;
+ uint32_t abgr8888() const;
+ uint16_t rgb565() const;
+ YUV yuv() const;
+
+ uint8_t b;
+ uint8_t g;
+ uint8_t r;
+ uint8_t a;
+};
+
+struct YUV
+{
+ YUV();
+ YUV(uint8_t y, uint8_t u, uint8_t v);
+ YUV(const RGB& rgb);
+
+ uint8_t v;
+ uint8_t u;
+ uint8_t y;
+ uint8_t a;
+};
+}