diff options
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c index 653e3f4211b..87c4ed1dac0 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombHSVA.c @@ -129,46 +129,46 @@ static bNodeSocketType cmp_node_combhsva_out[]= { static void do_comb_hsva(bNode *UNUSED(node), float *out, float *in1, float *in2, float *in3, float *in4) { - float r,g,b; - hsv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b); + float r,g,b; + hsv_to_rgb(in1[0], in2[0], in3[0], &r, &g, &b); - out[0] = r; - out[1] = g; - out[2] = b; - out[3] = in4[0]; + out[0] = r; + out[1] = g; + out[2] = b; + out[3] = in4[0]; } static void node_composit_exec_combhsva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) { - /* stack order out: 1 rgba channels */ - /* stack order in: 4 value channels */ - - /* input no image? then only color operation */ - if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) { - out[0]->vec[0] = in[0]->vec[0]; - out[0]->vec[1] = in[1]->vec[0]; - out[0]->vec[2] = in[2]->vec[0]; - out[0]->vec[3] = in[3]->vec[0]; - } - else { - /* make output size of first available input image */ - CompBuf *cbuf; - CompBuf *stackbuf; - - /* allocate a CompBuf the size of the first available input */ - if (in[0]->data) cbuf = in[0]->data; - else if (in[1]->data) cbuf = in[1]->data; - else if (in[2]->data) cbuf = in[2]->data; - else cbuf = in[3]->data; - - stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */ - - composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, - in[2]->data, in[2]->vec, in[3]->data, in[3]->vec, - do_comb_hsva, CB_VAL, CB_VAL, CB_VAL, CB_VAL); - - out[0]->data= stackbuf; - } + /* stack order out: 1 rgba channels */ + /* stack order in: 4 value channels */ + + /* input no image? then only color operation */ + if((in[0]->data==NULL) && (in[1]->data==NULL) && (in[2]->data==NULL) && (in[3]->data==NULL)) { + out[0]->vec[0] = in[0]->vec[0]; + out[0]->vec[1] = in[1]->vec[0]; + out[0]->vec[2] = in[2]->vec[0]; + out[0]->vec[3] = in[3]->vec[0]; + } + else { + /* make output size of first available input image */ + CompBuf *cbuf; + CompBuf *stackbuf; + + /* allocate a CompBuf the size of the first available input */ + if (in[0]->data) cbuf = in[0]->data; + else if (in[1]->data) cbuf = in[1]->data; + else if (in[2]->data) cbuf = in[2]->data; + else cbuf = in[3]->data; + + stackbuf = alloc_compbuf(cbuf->x, cbuf->y, CB_RGBA, 1); /* allocs */ + + composit4_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, + in[2]->data, in[2]->vec, in[3]->data, in[3]->vec, + do_comb_hsva, CB_VAL, CB_VAL, CB_VAL, CB_VAL); + + out[0]->data= stackbuf; + } } void register_node_type_cmp_combhsva(ListBase *lb) |