Blender  V3.3
node_composite_val_to_rgb.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 "node_composite_util.hh"
9 
10 #include "BKE_colorband.h"
11 
12 /* **************** VALTORGB ******************** */
13 
15 
17 {
18  b.add_input<decl::Float>(N_("Fac")).default_value(0.5f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
19  b.add_output<decl::Color>(N_("Image"));
20  b.add_output<decl::Float>(N_("Alpha"));
21 }
22 
24 {
25  node->storage = BKE_colorband_add(true);
26 }
27 
28 } // namespace blender::nodes::node_composite_val_to_rgb_cc
29 
31 {
33 
34  static bNodeType ntype;
35 
38  node_type_size(&ntype, 240, 200, 320);
41 
42  nodeRegisterType(&ntype);
43 }
44 
45 /* **************** RGBTOBW ******************** */
46 
48 
50 {
51  b.add_input<decl::Color>(N_("Image")).default_value({0.8f, 0.8f, 0.8f, 1.0f});
52  b.add_output<decl::Float>(N_("Val"));
53 }
54 
55 } // namespace blender::nodes::node_composite_val_to_rgb_cc
56 
58 {
60 
61  static bNodeType ntype;
62 
66 
67  nodeRegisterType(&ntype);
68 }
struct ColorBand * BKE_colorband_add(bool rangetype)
Definition: colorband.c:296
#define CMP_NODE_VALTORGB
Definition: BKE_node.h:1200
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
Definition: node.cc:4396
#define CMP_NODE_RGBTOBW
Definition: BKE_node.h:1201
#define NODE_CLASS_CONVERTER
Definition: BKE_node.h:351
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4390
void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size)
Definition: node.cc:4408
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
@ NODE_SIZE_SMALL
Definition: BKE_node.h:365
#define UNUSED(x)
@ PROP_FACTOR
Definition: RNA_types.h:144
OperationNode * node
bNodeTree * ntree
static void node_composit_init_valtorgb(bNodeTree *UNUSED(ntree), bNode *node)
static void cmp_node_valtorgb_declare(NodeDeclarationBuilder &b)
static void cmp_node_rgbtobw_declare(NodeDeclarationBuilder &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void register_node_type_cmp_valtorgb()
void register_node_type_cmp_rgbtobw()
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
NodeDeclareFunction declare
Definition: BKE_node.h:324
#define N_(msgid)