diff options
| author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2025-02-12 16:46:51 +0200 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2025-03-26 15:52:08 +0200 |
| commit | 5bdc68ff90fecb13b8576bb208f73cfc0f949575 (patch) | |
| tree | baf7d66cb14079cc5344abd974cc21fb638ccaf8 /kms++util/inc | |
| parent | 51055ced0e0e849051f5aaf3620724e16ef25d6d (diff) | |
kms++util: Add SMPTE test pattern
Diffstat (limited to 'kms++util/inc')
| -rw-r--r-- | kms++util/inc/kms++util/color16.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/kms++util/inc/kms++util/color16.h b/kms++util/inc/kms++util/color16.h index 307b138..6d25c82 100644 --- a/kms++util/inc/kms++util/color16.h +++ b/kms++util/inc/kms++util/color16.h @@ -101,6 +101,25 @@ public: constexpr RGB16 to_rgb(RecStandard rec = RecStandard::BT709, ColorRange range = ColorRange::Limited) const noexcept; + + static constexpr YUV16 from_10(uint16_t r, uint16_t g, uint16_t b) + { + return YUV16 { + static_cast<uint16_t>((r << 6) | (r >> 4)), + static_cast<uint16_t>((g << 6) | (g >> 4)), + static_cast<uint16_t>((b << 6) | (b >> 4)), + }; + } + + static constexpr YUV16 from_12(uint16_t r, uint16_t g, uint16_t b) + { + return YUV16 { + static_cast<uint16_t>((r << 4) | (r >> 8)), + static_cast<uint16_t>((g << 4) | (g >> 8)), + static_cast<uint16_t>((b << 4) | (b >> 8)), + }; + } + static constexpr uint16_t max_value = 0xffff; }; |
