[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13154] trunk/blender/source/blender/nodes /intern/CMP_nodes/CMP_curves.c: Black and White level inputs to RGB Curves compositing node

Juho Vepsalainen bebraw at gmail.com
Mon Jan 7 14:55:48 CET 2008


Revision: 13154
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13154
Author:   bebraw
Date:     2008-01-07 14:55:48 +0100 (Mon, 07 Jan 2008)

Log Message:
-----------
Black and White level inputs to RGB Curves compositing node
This commit adds possibility to define black and white level of the
mapping curve of the RGB Curves node. This functionality is exactly
the same found in the Curves tool of the UV/Image Editor. It can be
used to extract wanted color ranges out of the input easily.

Thanks to Bj?\195?\182rn C. Schaefer for contribution!

Modified Paths:
--------------
    trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_curves.c

Modified: trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_curves.c
===================================================================
--- trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_curves.c	2008-01-07 12:55:37 UTC (rev 13153)
+++ trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_curves.c	2008-01-07 13:55:48 UTC (rev 13154)
@@ -22,7 +22,7 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s): none yet.
+ * Contributor(s): Björn C. Schaefer
  *
  * ***** END GPL LICENSE BLOCK *****
  */
@@ -123,6 +123,8 @@
 static bNodeSocketType cmp_node_curve_rgb_in[]= {
 	{	SOCK_VALUE, 1, "Fac",	1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f},
 	{	SOCK_RGBA, 1, "Image",	0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f},
+	{	SOCK_RGBA, 1, "Black Level",	0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f},
+	{	SOCK_RGBA, 1, "White Level",	1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f},
 	{	-1, 0, ""	}
 };
 
@@ -157,7 +159,7 @@
 
 static void node_composit_exec_curve_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
 {
-	/* stack order input:  fac, image */
+	/* stack order input:  fac, image, black level, white level */
 	/* stack order output: image */
 	
 	if(out[0]->hasoutput==0)
@@ -172,6 +174,8 @@
 		CompBuf *cbuf= in[1]->data;
 		CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */
 		
+		curvemapping_set_black_white(node->storage, in[2]->vec, in[3]->vec);
+		
 		if(in[0]->vec[0] == 1.0)
 			composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_curves, CB_RGBA);
 		else





More information about the Bf-blender-cvs mailing list