Changed Brightness/Contrast node to use also buffer inputs for the B/C inputs. These were only working with single values.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user