Revision: 25089
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25089
Author:   broken
Date:     2009-12-03 10:51:02 +0100 (Thu, 03 Dec 2009)

Log Message:
-----------
Fix for color management not working with AVI output, patch by Damien Plisson, 
thanks!

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/pipeline.c

Modified: trunk/blender/source/blender/render/intern/source/pipeline.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/pipeline.c        
2009-12-03 09:49:21 UTC (rev 25088)
+++ trunk/blender/source/blender/render/intern/source/pipeline.c        
2009-12-03 09:51:02 UTC (rev 25089)
@@ -1065,12 +1065,25 @@
                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 */


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to