diff options
author | Matt Ebb <matt@mke3.net> | 2009-12-03 12:51:02 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-12-03 12:51:02 +0300 |
commit | 8c313fa931844057671c635b6e9cb270db1659fa (patch) | |
tree | 892798257d135f83aa5dd73b3e42841919978365 | |
parent | bd8e92904472b2cfaf49a71518be0502d517e682 (diff) |
Fix for color management not working with AVI output, patch by Damien Plisson, thanks!
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index b357a17e244..08440798826 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1065,12 +1065,25 @@ void RE_ResultGet32(Render *re, unsigned int *rect) int tot= rres.rectx*rres.recty; char *cp= (char *)rect; - for(;tot>0; tot--, cp+=4, fp+=4) { - cp[0] = FTOCHAR(fp[0]); - cp[1] = FTOCHAR(fp[1]); - cp[2] = FTOCHAR(fp[2]); - cp[3] = FTOCHAR(fp[3]); + if (re->r.color_mgt_flag & R_COLOR_MANAGEMENT) { + /* Finally convert back to sRGB rendered image */ + for(;tot>0; tot--, cp+=4, fp+=4) { + cp[0] = FTOCHAR(linearrgb_to_srgb(fp[0])); + cp[1] = FTOCHAR(linearrgb_to_srgb(fp[1])); + cp[2] = FTOCHAR(linearrgb_to_srgb(fp[2])); + cp[3] = FTOCHAR(fp[3]); + } } + else { + /* Color management is off : no conversion necessary */ + for(;tot>0; tot--, cp+=4, fp+=4) { + cp[0] = FTOCHAR(fp[0]); + cp[1] = FTOCHAR(fp[1]); + cp[2] = FTOCHAR(fp[2]); + cp[3] = FTOCHAR(fp[3]); + } + } + } else /* else fill with black */ |