aboutsummaryrefslogtreecommitdiff
path: root/graphics/conversion.h
diff options
context:
space:
mode:
authorMatthew Hoops2009-12-30 15:29:52 +0000
committerMatthew Hoops2009-12-30 15:29:52 +0000
commitb775c03c29f6b256e9e01c5481949bb11300ce3a (patch)
tree5c8fad1a486d21ff03f5b52bf378e463b71158fa /graphics/conversion.h
parented41d797efc641c660247bc09d055ce8adbcbda4 (diff)
downloadscummvm-rg350-b775c03c29f6b256e9e01c5481949bb11300ce3a.tar.gz
scummvm-rg350-b775c03c29f6b256e9e01c5481949bb11300ce3a.tar.bz2
scummvm-rg350-b775c03c29f6b256e9e01c5481949bb11300ce3a.zip
Use the special Cinepak YUV2RGB function in the Cinepak decoder. This makes the Riven videos match up with the backgrounds better. Thanks, Torbjorn\!
svn-id: r46750
Diffstat (limited to 'graphics/conversion.h')
-rw-r--r--graphics/conversion.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/graphics/conversion.h b/graphics/conversion.h
index 0c47574117..262dcd6f5a 100644
--- a/graphics/conversion.h
+++ b/graphics/conversion.h
@@ -45,6 +45,13 @@ inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
v = CLIP<int>( ((r * 512) >> 10) - ((g * 429) >> 10) - ((b * 83) >> 10) + 128, 0, 255);
}
+/** Converting a color from YUV to RGB colorspace, Cinepak style. */
+inline static void CPYUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
+ r = CLIP<int>(y + 2 * (v - 128), 0, 255);
+ g = CLIP<int>(y - (u - 128) / 2 - (v - 128), 0, 255);
+ b = CLIP<int>(y + 2 * (u - 128), 0, 255);
+}
+
// TODO: generic YUV to RGB blit
/**