Blender  V2.93
node_composite_stabilize2d.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2011 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include "node_composite_util.h"
25 
26 #include "BKE_context.h"
27 #include "BKE_lib_id.h"
28 
29 /* **************** Translate ******************** */
30 
32  {SOCK_RGBA, N_("Image"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
33  {-1, ""},
34 };
35 
37  {SOCK_RGBA, N_("Image")},
38  {-1, ""},
39 };
40 
41 static void init(const bContext *C, PointerRNA *ptr)
42 {
43  bNode *node = ptr->data;
45 
46  node->id = (ID *)scene->clip;
47  id_us_plus(node->id);
48 
49  /* default to bilinear, see node_sampler_type_items in rna_nodetree.c */
50  node->custom1 = 1;
51 }
52 
54 {
55  static bNodeType ntype;
56 
57  cmp_node_type_base(&ntype, CMP_NODE_STABILIZE2D, "Stabilize 2D", NODE_CLASS_DISTORT, 0);
59  ntype.initfunc_api = init;
60 
61  nodeRegisterType(&ntype);
62 }
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
void id_us_plus(struct ID *id)
Definition: lib_id.c:288
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
Definition: node.cc:4527
#define NODE_CLASS_DISTORT
Definition: BKE_node.h:343
#define CMP_NODE_STABILIZE2D
Definition: BKE_node.h:1194
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1298
#define N_(msgid)
@ SOCK_RGBA
#define C
Definition: RandGen.cpp:39
OperationNode * node
Scene scene
static void init(const bContext *C, PointerRNA *ptr)
void register_node_type_cmp_stabilize2d(void)
static bNodeSocketTemplate cmp_node_stabilize2d_out[]
static bNodeSocketTemplate cmp_node_stabilize2d_in[]
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
Definition: DNA_ID.h:273
void * data
Definition: RNA_types.h:52
struct MovieClip * clip
Compact definition of a node socket.
Definition: BKE_node.h:95
Defines a node type.
Definition: BKE_node.h:221
void(* initfunc_api)(const struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:288
PointerRNA * ptr
Definition: wm_files.c:3157