[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34400] trunk/blender/source/blender/nodes /intern/CMP_nodes/CMP_brightness.c: Changed Brightness/ Contrast node to use also buffer inputs for the B/C inputs.
Lukas Toenne
lukas.toenne at googlemail.com
Wed Jan 19 14:33:00 CET 2011
Revision: 34400
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34400
Author: lukastoenne
Date: 2011-01-19 13:32:59 +0000 (Wed, 19 Jan 2011)
Log Message:
-----------
Changed Brightness/Contrast node to use also buffer inputs for the B/C inputs. These were only working with single values.
Modified Paths:
--------------
trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c
Modified: trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c
===================================================================
--- trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c 2011-01-19 10:54:34 UTC (rev 34399)
+++ trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c 2011-01-19 13:32:59 UTC (rev 34400)
@@ -44,15 +44,14 @@
{ -1, 0, "" }
};
-static void do_brightnesscontrast(bNode *node, float *out, float *in)
+static void do_brightnesscontrast(bNode *node, float *out, float *in, float *in_brightness, float *in_contrast)
{
float i;
int c;
- float a, b, contrast, brightness, delta, v;
- contrast = node->custom2;
- brightness = (float)(node->custom1);
- brightness = (brightness) / 100.0f;
- delta = contrast / 200.0f;
+ float a, b, v;
+ float brightness = (*in_brightness) / 100.0f;
+ float contrast = *in_contrast;
+ float delta = contrast / 200.0f;
a = 1.0f - delta * 2.0f;
/*
* The algorithm is by Werner D. Streidt
@@ -84,10 +83,8 @@
if(in[0]->data) {
CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA);
- node->custom1 = in[1]->vec[0];
- node->custom2 = in[2]->vec[0];
stackbuf= dupalloc_compbuf(cbuf);
- composit1_pixel_processor(node, stackbuf, cbuf, in[0]->vec, do_brightnesscontrast, CB_RGBA);
+ composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, do_brightnesscontrast, CB_RGBA, CB_VAL, CB_VAL);
out[0]->data = stackbuf;
if(cbuf != in[0]->data)
free_compbuf(cbuf);
More information about the Bf-blender-cvs
mailing list