summaryrefslogtreecommitdiffstats
path: root/src/video_core/color.h
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2015-02-27 04:11:39 +0100
committerarchshift <admin@archshift.com>2015-02-28 04:15:08 +0100
commit7f9ee69a2bc769042433dba3970137b7be9afa03 (patch)
tree096b6debc487a7a87037808130484fe763bb4f6e /src/video_core/color.h
parentMerge pull request #599 from Subv/morton (diff)
downloadyuzu-7f9ee69a2bc769042433dba3970137b7be9afa03.tar
yuzu-7f9ee69a2bc769042433dba3970137b7be9afa03.tar.gz
yuzu-7f9ee69a2bc769042433dba3970137b7be9afa03.tar.bz2
yuzu-7f9ee69a2bc769042433dba3970137b7be9afa03.tar.lz
yuzu-7f9ee69a2bc769042433dba3970137b7be9afa03.tar.xz
yuzu-7f9ee69a2bc769042433dba3970137b7be9afa03.tar.zst
yuzu-7f9ee69a2bc769042433dba3970137b7be9afa03.zip
Diffstat (limited to 'src/video_core/color.h')
-rw-r--r--src/video_core/color.h19
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