From 77b7ba0bfb6c5fd479a93118b681d6649796ea02 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 26 Aug 2010 09:12:10 +0000 Subject: fix for dark images from the sequencer when color management is disabled. the render engine assumes the RenderResult's rectf is not in linear color space when color management is disabled so the sequencer and opengl render need to follow this else it results in dark images. --- source/blender/blenlib/intern/math_color.c | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'source/blender/blenlib/intern') diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 396f2c52058..693fd885b50 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -372,6 +372,40 @@ void linearrgb_to_srgb_v3_v3(float *col_to, float *col_from) col_to[2] = linearrgb_to_srgb(col_from[2]); } +/* todo, should these be moved elsewhere?, they dont belong in imbuf */ +void srgb_to_linearrgb_rgba_buf(float *col, int tot) +{ + while(tot--) { + srgb_to_linearrgb_v3_v3(col, col); + col += 4; + } +} + +void linearrgb_to_srgb_rgba_buf(float *col, int tot) +{ + while(tot--) { + linearrgb_to_srgb_v3_v3(col, col); + col += 4; + } +} + +void srgb_to_linearrgb_rgba_rgba_buf(float *col_to, float *col_from, int tot) +{ + while(tot--) { + srgb_to_linearrgb_v3_v3(col_to, col_from); + col_to += 4; + col_from += 4; + } +} + +void linearrgb_to_srgb_rgba_rgba_buf(float *col_to, float *col_from, int tot) +{ + while(tot--) { + linearrgb_to_srgb_v3_v3(col_to, col_from); + col_to += 4; + col_from += 4; + } +} void minmax_rgb(short c[]) { -- cgit v1.2.3