summaryrefslogtreecommitdiffstats
path: root/src/common/color.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-01-28 21:22:57 +0100
committerbunnei <bunneidev@gmail.com>2016-01-28 21:22:57 +0100
commit3ab6d77c206c33e5036fcde1de0663c2f72777ea (patch)
tree9a7a1f11dc7be8f530c9cb4a83561b3eaa4c03e9 /src/common/color.h
parentMerge pull request #1367 from yuriks/jit-jmp (diff)
parentcolor: Make trivial helpers constexpr (diff)
downloadyuzu-3ab6d77c206c33e5036fcde1de0663c2f72777ea.tar
yuzu-3ab6d77c206c33e5036fcde1de0663c2f72777ea.tar.gz
yuzu-3ab6d77c206c33e5036fcde1de0663c2f72777ea.tar.bz2
yuzu-3ab6d77c206c33e5036fcde1de0663c2f72777ea.tar.lz
yuzu-3ab6d77c206c33e5036fcde1de0663c2f72777ea.tar.xz
yuzu-3ab6d77c206c33e5036fcde1de0663c2f72777ea.tar.zst
yuzu-3ab6d77c206c33e5036fcde1de0663c2f72777ea.zip
Diffstat (limited to 'src/common/color.h')
-rw-r--r--src/common/color.h16
1 files 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;
}