diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-03-17 18:47:31 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-03-17 18:47:31 +0200 |
commit | 6f6fe27ac6a49d7570a11ceccaa122dd01c27828 (patch) | |
tree | 05f3b527ad3d06a15bf850e2d95c44807a2da332 | |
parent | d57d98583dd4bd7b03dbb79eea294ccb236d59a4 (diff) |
Add RGB::rgb888()
-rw-r--r-- | libkmstest/color.cpp | 5 | ||||
-rw-r--r-- | libkmstest/color.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libkmstest/color.cpp b/libkmstest/color.cpp index 3ad8203..490ff64 100644 --- a/libkmstest/color.cpp +++ b/libkmstest/color.cpp @@ -29,6 +29,11 @@ RGB::RGB(uint32_t argb) this->a = (argb >> 24) & 0xff; } +uint32_t RGB::rgb888() const +{ + return (r << 16) | (g << 8) | (b << 0); +} + uint32_t RGB::argb8888() const { return (a << 24) | (r << 16) | (g << 8) | (b << 0); diff --git a/libkmstest/color.h b/libkmstest/color.h index f99a951..ef85a67 100644 --- a/libkmstest/color.h +++ b/libkmstest/color.h @@ -13,6 +13,7 @@ struct RGB 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; |