Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_stabilize2d.cc
| Show All 20 Lines | |||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| /* **************** Translate ******************** */ | /* **************** Stabilize 2D ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_stabilize2d_in[] = { | namespace blender::nodes { | ||||
| {SOCK_RGBA, N_("Image"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, | |||||
| {-1, ""}, | static void cmp_node_stabilize2d_declare(NodeDeclarationBuilder &b) | ||||
| }; | { | ||||
| b.add_input<decl::Color>(N_("Image")).default_value({0.8f, 0.8f, 0.8f, 1.0f}); | |||||
| static bNodeSocketTemplate cmp_node_stabilize2d_out[] = { | b.add_output<decl::Color>(N_("Image")); | ||||
| {SOCK_RGBA, N_("Image")}, | } | ||||
| {-1, ""}, | |||||
| }; | } // namespace blender::nodes | ||||
| static void init(const bContext *C, PointerRNA *ptr) | static void init(const bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| bNode *node = (bNode *)ptr->data; | bNode *node = (bNode *)ptr->data; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| node->id = (ID *)scene->clip; | node->id = (ID *)scene->clip; | ||||
| id_us_plus(node->id); | id_us_plus(node->id); | ||||
| /* default to bilinear, see node_sampler_type_items in rna_nodetree.c */ | /* default to bilinear, see node_sampler_type_items in rna_nodetree.c */ | ||||
| node->custom1 = 1; | node->custom1 = 1; | ||||
| } | } | ||||
| void register_node_type_cmp_stabilize2d(void) | void register_node_type_cmp_stabilize2d() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT, 0); | cmp_node_type_base(&ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_stabilize2d_in, cmp_node_stabilize2d_out); | ntype.declare = blender::nodes::cmp_node_stabilize2d_declare; | ||||
| ntype.initfunc_api = init; | ntype.initfunc_api = init; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||