From 60fe45813b480f8264ddd78972ead7af359ecee8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 27 Jan 2016 22:14:17 -0500 Subject: color: Make trivial helpers constexpr --- src/common/color.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/color.h b/src/common/color.h index eb199e308..908879ea6 100644 --- a/src/common/color.h +++ b/src/common/color.h @@ -11,42 +11,42 @@ namespace Color { /// Convert a 1-bit color component to 8 bit -inline u8 Convert1To8(u8 value) { +constexpr u8 Convert1To8(u8 value) { return value * 255; } /// Convert a 4-bit color component to 8 bit -inline u8 Convert4To8(u8 value) { +constexpr u8 Convert4To8(u8 value) { return (value << 4) | value; } /// Convert a 5-bit color component to 8 bit -inline u8 Convert5To8(u8 value) { +constexpr u8 Convert5To8(u8 value) { return (value << 3) | (value >> 2); } /// Convert a 6-bit color component to 8 bit -inline u8 Convert6To8(u8 value) { +constexpr u8 Convert6To8(u8 value) { return (value << 2) | (value >> 4); } /// Convert a 8-bit color component to 1 bit -inline u8 Convert8To1(u8 value) { +constexpr u8 Convert8To1(u8 value) { return value >> 7; } /// Convert a 8-bit color component to 4 bit -inline u8 Convert8To4(u8 value) { +constexpr u8 Convert8To4(u8 value) { return value >> 4; } /// Convert a 8-bit color component to 5 bit -inline u8 Convert8To5(u8 value) { +constexpr u8 Convert8To5(u8 value) { return value >> 3; } /// Convert a 8-bit color component to 6 bit -inline u8 Convert8To6(u8 value) { +constexpr u8 Convert8To6(u8 value) { return value >> 2; } -- cgit v1.2.3