Blender  V3.3
node_composite_despeckle.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 /* **************** FILTER ******************** */
14 
16 
18 {
19  b.add_input<decl::Float>(N_("Fac")).default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
20  b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
21  b.add_output<decl::Color>(N_("Image"));
22 }
23 
25 {
26  node->custom3 = 0.5f;
27  node->custom4 = 0.5f;
28 }
29 
31 {
32  uiLayout *col;
33 
34  col = uiLayoutColumn(layout, false);
35  uiItemR(col, ptr, "threshold", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
36  uiItemR(col, ptr, "threshold_neighbor", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
37 }
38 
39 } // namespace blender::nodes::node_composite_despeckle_cc
40 
42 {
44 
45  static bNodeType ntype;
46 
50  ntype.flag |= NODE_PREVIEW;
52 
53  nodeRegisterType(&ntype);
54 }
#define CMP_NODE_DESPECKLE
Definition: BKE_node.h:1269
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4390
#define NODE_CLASS_OP_FILTER
Definition: BKE_node.h:349
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
#define NODE_PREVIEW
@ PROP_FACTOR
Definition: RNA_types.h:144
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
OperationNode * node
bNodeTree * ntree
uint col
static void cmp_node_despeckle_declare(NodeDeclarationBuilder &b)
static void node_composit_buts_despeckle(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_composit_init_despeckle(bNodeTree *UNUSED(ntree), bNode *node)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_cmp_despeckle()
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
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