From c811a9c44cc9685211494f2daa62c9272c96eb90 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 7 Oct 2015 10:30:23 +0300 Subject: libkmstest: cleanup colors and add xbgr8888 support --- libkmstest/color.h | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'libkmstest/color.h') diff --git a/libkmstest/color.h b/libkmstest/color.h index 1db47e8..f84fc68 100644 --- a/libkmstest/color.h +++ b/libkmstest/color.h @@ -11,19 +11,17 @@ struct RGB RGB(); RGB(uint8_t r, uint8_t g, uint8_t b); + uint32_t rgb888() const; + uint32_t bgr888() const; 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 + { + uint8_t b; + uint8_t g; + uint8_t r; + uint8_t a; }; }; @@ -33,16 +31,12 @@ struct 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; + struct + { + uint8_t v; + uint8_t u; + uint8_t y; + uint8_t a; }; }; } -- cgit v1.2.3