summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-03-17 18:47:31 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-03-17 18:47:31 +0200
commit6f6fe27ac6a49d7570a11ceccaa122dd01c27828 (patch)
tree05f3b527ad3d06a15bf850e2d95c44807a2da332
parentd57d98583dd4bd7b03dbb79eea294ccb236d59a4 (diff)
Add RGB::rgb888()
-rw-r--r--libkmstest/color.cpp5
-rw-r--r--libkmstest/color.h1
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;