diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-26 13:12:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-26 13:12:10 +0400 |
commit | 77b7ba0bfb6c5fd479a93118b681d6649796ea02 (patch) | |
tree | 62c657b59b1c8e0a3fc9522a533832256e197ed7 /source/blender/blenlib/intern/math_color.c | |
parent | f647ba1ce59e33dc6b7e1604ee6a34d6802b3742 (diff) |
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.
Diffstat (limited to 'source/blender/blenlib/intern/math_color.c')
-rw-r--r-- | source/blender/blenlib/intern/math_color.c | 34 |
1 files changed, 34 insertions, 0 deletions
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[]) { |