Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_crop.cc
| Show All 19 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* **************** Crop ******************** */ | /* **************** Crop ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_crop_in[] = { | namespace blender::nodes { | ||||
| {SOCK_RGBA, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, | |||||
| {-1, ""}, | static void cmp_node_crop_declare(NodeDeclarationBuilder &b) | ||||
| }; | { | ||||
| static bNodeSocketTemplate cmp_node_crop_out[] = { | b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f}); | ||||
| {SOCK_RGBA, N_("Image")}, | b.add_output<decl::Color>(N_("Image")); | ||||
| {-1, ""}, | } | ||||
| }; | |||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_crop(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_crop(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeTwoXYs *nxy = (NodeTwoXYs *)MEM_callocN(sizeof(NodeTwoXYs), "node xy data"); | NodeTwoXYs *nxy = (NodeTwoXYs *)MEM_callocN(sizeof(NodeTwoXYs), "node xy data"); | ||||
| node->storage = nxy; | node->storage = nxy; | ||||
| nxy->x1 = 0; | nxy->x1 = 0; | ||||
| nxy->x2 = 0; | nxy->x2 = 0; | ||||
| nxy->y1 = 0; | nxy->y1 = 0; | ||||
| nxy->y2 = 0; | nxy->y2 = 0; | ||||
| } | } | ||||
| void register_node_type_cmp_crop(void) | void register_node_type_cmp_crop() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_CROP, "Crop", NODE_CLASS_DISTORT, 0); | cmp_node_type_base(&ntype, CMP_NODE_CROP, "Crop", NODE_CLASS_DISTORT, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_crop_in, cmp_node_crop_out); | ntype.declare = blender::nodes::cmp_node_crop_declare; | ||||
| node_type_init(&ntype, node_composit_init_crop); | node_type_init(&ntype, node_composit_init_crop); | ||||
| node_type_storage(&ntype, "NodeTwoXYs", node_free_standard_storage, node_copy_standard_storage); | node_type_storage(&ntype, "NodeTwoXYs", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||