Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-26 13:12:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-26 13:12:10 +0400
commit77b7ba0bfb6c5fd479a93118b681d6649796ea02 (patch)
tree62c657b59b1c8e0a3fc9522a533832256e197ed7 /source/blender/render/intern/source/pipeline.c
parentf647ba1ce59e33dc6b7e1604ee6a34d6802b3742 (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/render/intern/source/pipeline.c')
-rw-r--r--source/blender/render/intern/source/pipeline.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 502bd09c2de..44c6a6f008f 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -2473,20 +2473,21 @@ static void do_render_seq(Render * re)
if(ibuf->rect_float) {
if (!rr->rectf)
rr->rectf= MEM_mallocN(4*sizeof(float)*rr->rectx*rr->recty, "render_seq rectf");
-
- memcpy(rr->rectf, ibuf->rect_float, 4*sizeof(float)*rr->rectx*rr->recty);
-
- /* sequencer float buffer is not in linear color space, convert
- * should always be true, use a fake ibuf for the colorspace conversion */
- if(ibuf->profile != IB_PROFILE_LINEAR_RGB) {
- ImBuf ibuf_dummy;
- memset(&ibuf_dummy, 0, sizeof(ImBuf));
- ibuf_dummy.profile= ibuf->profile;
- ibuf_dummy.x= rr->rectx;
- ibuf_dummy.y= rr->recty;
- ibuf_dummy.rect_float= rr->rectf;
- /* only touch the rr->rectf */
- IMB_convert_profile(&ibuf_dummy, IB_PROFILE_LINEAR_RGB);
+
+ /* color management: when off ensure rectf is non-lin, since thats what the internal
+ * render engine delivers */
+ if(re->r.color_mgt_flag & R_COLOR_MANAGEMENT) {
+ if(ibuf->profile == IB_PROFILE_LINEAR_RGB)
+ memcpy(rr->rectf, ibuf->rect_float, 4*sizeof(float)*rr->rectx*rr->recty);
+ else
+ srgb_to_linearrgb_rgba_rgba_buf(rr->rectf, ibuf->rect_float, rr->rectx*rr->recty);
+
+ }
+ else {
+ if(ibuf->profile != IB_PROFILE_LINEAR_RGB)
+ memcpy(rr->rectf, ibuf->rect_float, 4*sizeof(float)*rr->rectx*rr->recty);
+ else
+ linearrgb_to_srgb_rgba_rgba_buf(rr->rectf, ibuf->rect_float, rr->rectx*rr->recty);
}
/* TSK! Since sequence render doesn't free the *rr render result, the old rect32