Blender  V3.3
node_composite_chroma_matte.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2006 Blender Foundation. All rights reserved. */
3 
8 #include "BLI_math_rotation.h"
9 
10 #include "UI_interface.h"
11 #include "UI_resources.h"
12 
13 #include "node_composite_util.hh"
14 
15 /* ******************* Chroma Key ********************************************************** */
16 
18 
20 {
21  b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
22  b.add_input<decl::Color>(N_("Key Color")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
23  b.add_output<decl::Color>(N_("Image"));
24  b.add_output<decl::Float>(N_("Matte"));
25 }
26 
28 {
29  NodeChroma *c = MEM_cnew<NodeChroma>(__func__);
30  node->storage = c;
31  c->t1 = DEG2RADF(30.0f);
32  c->t2 = DEG2RADF(10.0f);
33  c->t3 = 0.0f;
34  c->fsize = 0.0f;
35  c->fstrength = 1.0f;
36 }
37 
39 {
40  uiLayout *col;
41 
42  col = uiLayoutColumn(layout, false);
43  uiItemR(col, ptr, "tolerance", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
44  uiItemR(col, ptr, "threshold", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
45 
46  col = uiLayoutColumn(layout, true);
47  /* Removed for now. */
48  // uiItemR(col, ptr, "lift", UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
49  uiItemR(col, ptr, "gain", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
50  /* Removed for now. */
51  // uiItemR(col, ptr, "shadow_adjust", UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
52 }
53 
54 } // namespace blender::nodes::node_composite_chroma_matte_cc
55 
57 {
59 
60  static bNodeType ntype;
61 
65  ntype.flag |= NODE_PREVIEW;
68 
69  nodeRegisterType(&ntype);
70 }
#define NODE_CLASS_MATTE
Definition: BKE_node.h:352
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4390
#define CMP_NODE_CHROMA_MATTE
Definition: BKE_node.h:1232
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
Definition: node.cc:4426
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define DEG2RADF(_deg)
#define UNUSED(x)
#define NODE_PREVIEW
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
@ UI_ITEM_R_SLIDER
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
OperationNode * node
bNodeTree * ntree
uint col
static unsigned c
Definition: RandGen.cpp:83
static void cmp_node_chroma_matte_declare(NodeDeclarationBuilder &b)
static void node_composit_init_chroma_matte(bNodeTree *UNUSED(ntree), bNode *node)
static void node_composit_buts_chroma_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_cmp_chroma_matte()
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
Definition: node_util.c:55
void node_free_standard_storage(bNode *node)
Definition: node_util.c:43
Defines a node type.
Definition: BKE_node.h:226
short flag
Definition: BKE_node.h:236
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:244
NodeDeclareFunction declare
Definition: BKE_node.h:324
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480