Blender  V3.3
node_composite_color_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 "UI_interface.h"
9 #include "UI_resources.h"
10 
11 #include "node_composite_util.hh"
12 
13 /* ******************* Color Matte ********************************************************** */
14 
16 
18 {
19  b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
20  b.add_input<decl::Color>(N_("Key Color")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
21  b.add_output<decl::Color>(N_("Image"));
22  b.add_output<decl::Float>(N_("Matte"));
23 }
24 
26 {
27  NodeChroma *c = MEM_cnew<NodeChroma>(__func__);
28  node->storage = c;
29  c->t1 = 0.01f;
30  c->t2 = 0.1f;
31  c->t3 = 0.1f;
32  c->fsize = 0.0f;
33  c->fstrength = 1.0f;
34 }
35 
37 {
38  uiLayout *col;
39 
40  col = uiLayoutColumn(layout, true);
41  uiItemR(
42  col, ptr, "color_hue", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
43  uiItemR(col,
44  ptr,
45  "color_saturation",
47  nullptr,
48  ICON_NONE);
49  uiItemR(
50  col, ptr, "color_value", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
51 }
52 
53 } // namespace blender::nodes::node_composite_color_matte_cc
54 
56 {
58 
59  static bNodeType ntype;
60 
64  ntype.flag |= NODE_PREVIEW;
67 
68  nodeRegisterType(&ntype);
69 }
#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
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
#define CMP_NODE_COLOR_MATTE
Definition: BKE_node.h:1254
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#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 node_composit_init_color_matte(bNodeTree *UNUSED(ntree), bNode *node)
static void node_composit_buts_color_matte(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void cmp_node_color_matte_declare(NodeDeclarationBuilder &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_cmp_color_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