[Bf-blender-cvs] [42946c3] master: Fix T38606: C curve in the curve mapping compositing node not extrapolating correct.

Brecht Van Lommel noreply at git.blender.org
Fri Feb 14 16:17:52 CET 2014


Commit: 42946c37c789b5a57c45ff2637c79d194beb33d0
Author: Brecht Van Lommel
Date:   Fri Feb 14 16:00:28 2014 +0100
https://developer.blender.org/rB42946c37c789b5a57c45ff2637c79d194beb33d0

Fix T38606: C curve in the curve mapping compositing node not extrapolating correct.

The "premultiply" optimization here did not take the extrapolation into account.

===================================================================

M	source/blender/blenkernel/intern/colortools.c
M	source/blender/makesdna/DNA_color_types.h

===================================================================

diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 76f610c..e2cb011 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -637,6 +637,11 @@ void curvemapping_premultiply(CurveMapping *cumap, int restore)
 				MEM_freeN(cumap->cm[a].table);
 				cumap->cm[a].table = cumap->cm[a].premultable;
 				cumap->cm[a].premultable = NULL;
+
+				copy_v2_v2(cumap->cm[a].ext_in, cumap->cm[a].premul_ext_in);
+				copy_v2_v2(cumap->cm[a].ext_out, cumap->cm[a].premul_ext_out);
+				zero_v2(cumap->cm[a].premul_ext_in);
+				zero_v2(cumap->cm[a].premul_ext_out);
 			}
 			
 			cumap->flag &= ~CUMA_PREMULLED;
@@ -662,6 +667,11 @@ void curvemapping_premultiply(CurveMapping *cumap, int restore)
 				for (b = 0; b <= CM_TABLE; b++) {
 					cumap->cm[a].table[b].y = curvemap_evaluateF(cumap->cm + 3, cumap->cm[a].table[b].y);
 				}
+
+				copy_v2_v2(cumap->cm[a].premul_ext_in, cumap->cm[a].ext_in);
+				copy_v2_v2(cumap->cm[a].premul_ext_out, cumap->cm[a].ext_out);
+				mul_v2_v2(cumap->cm[a].ext_in, cumap->cm[3].ext_in);
+				mul_v2_v2(cumap->cm[a].ext_out, cumap->cm[3].ext_out);
 			}
 			
 			cumap->flag |= CUMA_PREMULLED;
diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h
index 50bbc04..e373112 100644
--- a/source/blender/makesdna/DNA_color_types.h
+++ b/source/blender/makesdna/DNA_color_types.h
@@ -60,7 +60,10 @@ typedef struct CurveMap {
 	float ext_in[2], ext_out[2];	/* for extrapolated curves, the direction vector */
 	CurveMapPoint *curve;			/* actual curve */
 	CurveMapPoint *table;			/* display and evaluate table */
+
 	CurveMapPoint *premultable;		/* for RGB curves, premulled table */
+	float premul_ext_in[2];			/* for RGB curves, premulled extrapolation vector */
+	float premul_ext_out[2];
 } CurveMap;
 
 /* cuma->flag */




More information about the Bf-blender-cvs mailing list