diff options
author | Tony Wasserka <NeoBrainX@gmail.com> | 2014-12-31 15:17:07 +0100 |
---|---|---|
committer | Tony Wasserka <NeoBrainX@gmail.com> | 2014-12-31 16:32:55 +0100 |
commit | 47543d62cf9e982598f58438ad24769c2b36ec77 (patch) | |
tree | 856ccab2a9165d0a50def92f958851566bb93b2b /src/video_core/color.h | |
parent | VideoCore: Remove some unused functions. (diff) | |
download | yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.tar yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.tar.gz yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.tar.bz2 yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.tar.lz yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.tar.xz yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.tar.zst yuzu-47543d62cf9e982598f58438ad24769c2b36ec77.zip |
Diffstat (limited to 'src/video_core/color.h')
-rw-r--r-- | src/video_core/color.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/video_core/color.h b/src/video_core/color.h new file mode 100644 index 000000000..e86ac1265 --- /dev/null +++ b/src/video_core/color.h @@ -0,0 +1,32 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "common/common_types.h" + +namespace Color { + +/// Convert a 1-bit color component to 8 bit +static inline u8 Convert1To8(u8 value) { + return value * 255; +} + +/// Convert a 4-bit color component to 8 bit +static inline u8 Convert4To8(u8 value) { + return (value << 4) | value; +} + +/// Convert a 5-bit color component to 8 bit +static inline u8 Convert5To8(u8 value) { + return (value << 3) | (value >> 2); +} + +/// Convert a 6-bit color component to 8 bit +static inline u8 Convert6To8(u8 value) { + return (value << 2) | (value >> 4); +} + + +} // namespace |