From 450288999c74cbef4678e804bbb28d7ebf5752fb Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Wed, 19 Jan 2011 13:32:59 +0000 Subject: Changed Brightness/Contrast node to use also buffer inputs for the B/C inputs. These were only working with single values. --- source/blender/nodes/intern/CMP_nodes/CMP_brightness.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'source/blender/nodes/intern') diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c b/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c index 889d61fe4fa..ad73a33c13f 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_brightness.c @@ -44,15 +44,14 @@ static bNodeSocketType cmp_node_brightcontrast_out[]= { { -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 @@ static void node_composit_exec_brightcontrast(void *UNUSED(data), bNode *node, b 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); -- cgit v1.2.3