summaryrefslogtreecommitdiff
path: root/kms++util/inc
diff options
context:
space:
mode:
authorJyri Sarha <jsarha@ti.com>2017-05-09 17:37:15 +0300
committerJyri Sarha <jsarha@ti.com>2017-05-31 18:49:29 +0300
commit7adbef59143af49fb153812d1d0368522e70dcaf (patch)
tree4fc5381fa03dfb0b60f01f2b34341a3431fe1a37 /kms++util/inc
parentb39260b2775cfc101fae418810c46cec7aa6cf9f (diff)
Add different YCbCr encodings.
Diffstat (limited to 'kms++util/inc')
-rw-r--r--kms++util/inc/kms++util/color.h12
-rw-r--r--kms++util/inc/kms++util/kms++util.h2
2 files changed, 11 insertions, 3 deletions
diff --git a/kms++util/inc/kms++util/color.h b/kms++util/inc/kms++util/color.h
index ba2ed25..f378433 100644
--- a/kms++util/inc/kms++util/color.h
+++ b/kms++util/inc/kms++util/color.h
@@ -6,6 +6,14 @@ namespace kms
{
struct YUV;
+enum class YUVType {
+ BT601_Lim = 0,
+ BT601_Full,
+ BT709_Lim,
+ BT709_Full,
+ MAX,
+};
+
struct RGB
{
RGB();
@@ -19,7 +27,7 @@ struct RGB
uint32_t abgr8888() const;
uint16_t rgb565() const;
uint16_t bgr565() const;
- YUV yuv() const;
+ YUV yuv(YUVType type = YUVType::BT601_Lim) const;
uint8_t b;
uint8_t g;
@@ -31,7 +39,7 @@ struct YUV
{
YUV();
YUV(uint8_t y, uint8_t u, uint8_t v);
- YUV(const RGB& rgb);
+ YUV(const RGB& rgb, YUVType type = YUVType::BT601_Lim);
uint8_t v;
uint8_t u;
diff --git a/kms++util/inc/kms++util/kms++util.h b/kms++util/inc/kms++util/kms++util.h
index c1e3c8c..d45497e 100644
--- a/kms++util/inc/kms++util/kms++util.h
+++ b/kms++util/inc/kms++util/kms++util.h
@@ -26,7 +26,7 @@ void draw_text(IMappedFramebuffer& buf, uint32_t x, uint32_t y, const std::strin
void draw_color_bar(IMappedFramebuffer& buf, int old_xpos, int xpos, int width);
-void draw_test_pattern(IMappedFramebuffer &fb);
+void draw_test_pattern(IMappedFramebuffer &fb, YUVType yuvt = YUVType::BT601_Lim);
}
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))