diff options
Diffstat (limited to 'source/blender/nodes/composite/nodes/node_composite_colorMatte.c')
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_colorMatte.c | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c index 07a6647d976..1642d9283c3 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c @@ -45,77 +45,6 @@ static bNodeSocketTemplate cmp_node_color_out[] = { {-1, 0, ""} }; -#ifdef WITH_COMPOSITOR_LEGACY - -static void do_color_key(bNode *node, float *out, float *in) -{ - float h_wrap; - NodeChroma *c; - c=node->storage; - - - copy_v3_v3(out, in); - - if ( - /* do hue last because it needs to wrap, and does some more checks */ - - /* sat */ (fabsf(in[1]-c->key[1]) < c->t2) && - /* val */ (fabsf(in[2]-c->key[2]) < c->t3) && - - /* multiply by 2 because it wraps on both sides of the hue, - * otherwise 0.5 would key all hue's */ - - /* hue */ ((h_wrap= 2.0f * fabsf(in[0]-c->key[0])) < c->t1 || (2.0f - h_wrap) < c->t1) - ) { - out[3]=0.0; /*make transparent*/ - } - - else { /*pixel is outside key color */ - out[3]=in[3]; /* make pixel just as transparent as it was before */ - } -} - -static void node_composit_exec_color_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out) -{ - CompBuf *cbuf; - CompBuf *colorbuf; - NodeChroma *c; - - if (in[0]->hasinput==0) return; - if (in[0]->data==NULL) return; - if (out[0]->hasoutput==0 && out[1]->hasoutput==0) return; - - cbuf= typecheck_compbuf(in[0]->data, CB_RGBA); - - colorbuf= dupalloc_compbuf(cbuf); - - c=node->storage; - - /*convert rgbbuf to hsv*/ - composit1_pixel_processor(node, colorbuf, cbuf, in[0]->vec, do_rgba_to_hsva, CB_RGBA); - - /*convert key to hsv*/ - do_rgba_to_hsva(node, c->key, in[1]->vec); - - - /*per pixel color key*/ - composit1_pixel_processor(node, colorbuf, colorbuf, in[0]->vec, do_color_key, CB_RGBA); - - /*convert back*/ - composit1_pixel_processor(node, colorbuf, colorbuf, in[0]->vec, do_hsva_to_rgba, CB_RGBA); - - out[0]->data= colorbuf; - if (out[1]->hasoutput) - out[1]->data= valbuf_from_rgbabuf(colorbuf, CHAN_A); - - generate_preview(data, node, colorbuf); - - if (cbuf!=in[0]->data) - free_compbuf(cbuf); -} - -#endif /* WITH_COMPOSITOR_LEGACY */ - static void node_composit_init_color_matte(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp)) { NodeChroma *c= MEM_callocN(sizeof(NodeChroma), "node color"); @@ -136,9 +65,6 @@ void register_node_type_cmp_color_matte(bNodeTreeType *ttype) node_type_size(&ntype, 200, 80, 300); node_type_init(&ntype, node_composit_init_color_matte); node_type_storage(&ntype, "NodeChroma", node_free_standard_storage, node_copy_standard_storage); -#ifdef WITH_COMPOSITOR_LEGACY - node_type_exec(&ntype, node_composit_exec_color_matte); -#endif nodeRegisterType(ttype, &ntype); } |