diff options
Diffstat (limited to 'src/video_core/color.h')
-rw-r--r-- | src/video_core/color.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/video_core/color.h b/src/video_core/color.h index e86ac1265..f095d8ac5 100644 --- a/src/video_core/color.h +++ b/src/video_core/color.h @@ -28,5 +28,24 @@ static inline u8 Convert6To8(u8 value) { return (value << 2) | (value >> 4); } +/// Convert a 8-bit color component to 1 bit +static inline u8 Convert8To1(u8 value) { + return value >> 7; +} + +/// Convert a 8-bit color component to 4 bit +static inline u8 Convert8To4(u8 value) { + return value >> 4; +} + +/// Convert a 8-bit color component to 5 bit +static inline u8 Convert8To5(u8 value) { + return value >> 3; +} + +/// Convert a 8-bit color component to 6 bit +static inline u8 Convert8To6(u8 value) { + return value >> 2; +} } // namespace |