diff options
author | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-10-01 21:44:49 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-10-01 21:44:49 +0300 |
commit | 093b77fc295d1bc4694b32fed95da0fab78c4097 (patch) | |
tree | bc9a2430aea3a33604defb00a4e62295c3cf03f2 /libkmstest/color.h | |
parent | f1f87468e2cf1cc3e934efb37db902a62f1fc8dc (diff) |
move test utils to libkmstest library
Diffstat (limited to 'libkmstest/color.h')
-rw-r--r-- | libkmstest/color.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libkmstest/color.h b/libkmstest/color.h new file mode 100644 index 0000000..1db47e8 --- /dev/null +++ b/libkmstest/color.h @@ -0,0 +1,48 @@ +#pragma once + +#include <cstdint> + +namespace kms +{ +struct YUV; + +struct RGB +{ + RGB(); + RGB(uint8_t r, uint8_t g, uint8_t b); + + uint16_t rgb565() const; + YUV yuv() const; + + union { + struct + { + uint8_t b; + uint8_t g; + uint8_t r; + uint8_t a; + }; + + uint32_t raw; + }; +}; + +struct YUV +{ + YUV(); + YUV(uint8_t y, uint8_t u, uint8_t v); + YUV(const RGB& rgb); + + union { + struct + { + uint8_t v; + uint8_t u; + uint8_t y; + uint8_t a; + }; + + uint32_t raw; + }; +}; +} |