Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc
| Show All 18 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* **************** BILATERALBLUR ******************** */ | /* **************** BILATERALBLUR ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_bilateralblur_in[] = { | |||||
| {SOCK_RGBA, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, | namespace blender::nodes { | ||||
| {SOCK_RGBA, N_("Determinator"), 1.0f, 1.0f, 1.0f, 1.0f}, | |||||
| {-1, ""}}; | static void cmp_node_bilateralblur_declare(NodeDeclarationBuilder &b) | ||||
| { | |||||
| static bNodeSocketTemplate cmp_node_bilateralblur_out[] = { | b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f}); | ||||
| {SOCK_RGBA, N_("Image")}, | b.add_input<decl::Color>(N_("Determinator")).default_value({1.0f, 1.0f, 1.0f, 1.0f}); | ||||
| {-1, ""}, | b.add_output<decl::Color>(N_("Image")); | ||||
| }; | } | ||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_bilateralblur(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_bilateralblur(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeBilateralBlurData *nbbd = (NodeBilateralBlurData *)MEM_callocN(sizeof(NodeBilateralBlurData), | NodeBilateralBlurData *nbbd = (NodeBilateralBlurData *)MEM_callocN(sizeof(NodeBilateralBlurData), | ||||
| "node bilateral blur data"); | "node bilateral blur data"); | ||||
| node->storage = nbbd; | node->storage = nbbd; | ||||
| nbbd->iter = 1; | nbbd->iter = 1; | ||||
| nbbd->sigma_color = 0.3; | nbbd->sigma_color = 0.3; | ||||
| nbbd->sigma_space = 5.0; | nbbd->sigma_space = 5.0; | ||||
| } | } | ||||
| void register_node_type_cmp_bilateralblur(void) | void register_node_type_cmp_bilateralblur() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_BILATERALBLUR, "Bilateral Blur", NODE_CLASS_OP_FILTER, 0); | cmp_node_type_base(&ntype, CMP_NODE_BILATERALBLUR, "Bilateral Blur", NODE_CLASS_OP_FILTER, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_bilateralblur_in, cmp_node_bilateralblur_out); | ntype.declare = blender::nodes::cmp_node_bilateralblur_declare; | ||||
| node_type_init(&ntype, node_composit_init_bilateralblur); | node_type_init(&ntype, node_composit_init_bilateralblur); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeBilateralBlurData", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeBilateralBlurData", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||