Blender  V3.3
node_composite_invert.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 /* **************** INVERT ******************** */
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_("Color")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
21  b.add_output<decl::Color>(N_("Color"));
22 }
23 
25 {
26  node->custom1 |= CMP_CHAN_RGB;
27 }
28 
30 {
31  uiLayout *col;
32 
33  col = uiLayoutColumn(layout, false);
34  uiItemR(col, ptr, "invert_rgb", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
35  uiItemR(col, ptr, "invert_alpha", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
36 }
37 
38 } // namespace blender::nodes::node_composite_invert_cc
39 
41 {
42  namespace file_ns = blender::nodes::node_composite_invert_cc;
43 
44  static bNodeType ntype;
45 
50 
51  nodeRegisterType(&ntype);
52 }
#define CMP_CHAN_RGB
Definition: BKE_node.h:1302
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4390
#define NODE_CLASS_OP_COLOR
Definition: BKE_node.h:347
#define CMP_NODE_INVERT
Definition: BKE_node.h:1246
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
@ 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_invert_declare(NodeDeclarationBuilder &b)
static void node_composit_init_invert(bNodeTree *UNUSED(ntree), bNode *node)
static void node_composit_buts_invert(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_cmp_invert()
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition: BKE_node.h:226
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