Blender
V4.3
source
blender
nodes
composite
nodes
node_composite_hue_sat_val.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2006 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#include "
GPU_material.hh
"
10
11
#include "
COM_shader_node.hh
"
12
13
#include "
node_composite_util.hh
"
14
15
/* **************** Hue/Saturation/Value ******************** */
16
17
namespace
blender::nodes::node_composite_hue_sat_val_cc
{
18
19
static
void
cmp_node_huesatval_declare
(
NodeDeclarationBuilder
&
b
)
20
{
21
b
.add_input<
decl::Color
>(
"Image"
)
22
.default_value({1.0f, 1.0f, 1.0f, 1.0f})
23
.compositor_domain_priority(0);
24
b
.add_input<
decl::Float
>(
"Hue"
)
25
.default_value(0.5f)
26
.min(0.0f)
27
.max(1.0f)
28
.
subtype
(
PROP_FACTOR
)
29
.compositor_domain_priority(1);
30
b
.add_input<
decl::Float
>(
"Saturation"
)
31
.default_value(1.0f)
32
.min(0.0f)
33
.max(2.0f)
34
.
subtype
(
PROP_FACTOR
)
35
.compositor_domain_priority(2);
36
b
.add_input<
decl::Float
>(
"Value"
)
37
.default_value(1.0f)
38
.min(0.0f)
39
.max(2.0f)
40
.
subtype
(
PROP_FACTOR
)
41
.translation_context(
BLT_I18NCONTEXT_COLOR
)
42
.compositor_domain_priority(3);
43
b
.add_input<
decl::Float
>(
"Fac"
)
44
.default_value(1.0f)
45
.min(0.0f)
46
.max(1.0f)
47
.
subtype
(
PROP_FACTOR
)
48
.compositor_domain_priority(4);
49
b
.add_output<
decl::Color
>(
"Image"
);
50
}
51
52
using namespace
blender::realtime_compositor
;
53
54
class
HueSaturationValueShaderNode
:
public
ShaderNode
{
55
public
:
56
using
ShaderNode::ShaderNode
;
57
58
void
compile
(
GPUMaterial
*material)
override
59
{
60
GPUNodeStack
*
inputs
=
get_inputs_array
();
61
GPUNodeStack
*
outputs
=
get_outputs_array
();
62
63
GPU_stack_link
(material, &
bnode
(),
"node_composite_hue_saturation_value"
,
inputs
,
outputs
);
64
}
65
};
66
67
static
ShaderNode
*
get_compositor_shader_node
(
DNode
node)
68
{
69
return
new
HueSaturationValueShaderNode
(node);
70
}
71
72
}
// namespace blender::nodes::node_composite_hue_sat_val_cc
73
74
void
register_node_type_cmp_hue_sat
()
75
{
76
namespace
file_ns =
blender::nodes::node_composite_hue_sat_val_cc
;
77
78
static
blender::bke::bNodeType
ntype;
79
80
cmp_node_type_base
(&ntype,
CMP_NODE_HUE_SAT
,
"Hue/Saturation/Value"
,
NODE_CLASS_OP_COLOR
);
81
ntype.
declare
= file_ns::cmp_node_huesatval_declare;
82
ntype.
get_compositor_shader_node
= file_ns::get_compositor_shader_node;
83
84
blender::bke::node_register_type
(&ntype);
85
}
CMP_NODE_HUE_SAT
#define CMP_NODE_HUE_SAT
Definition
BKE_node.hh:1030
NODE_CLASS_OP_COLOR
#define NODE_CLASS_OP_COLOR
Definition
BKE_node.hh:406
BLT_I18NCONTEXT_COLOR
#define BLT_I18NCONTEXT_COLOR
Definition
BLT_translation.hh:140
COM_shader_node.hh
GPU_material.hh
GPU_stack_link
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
Definition
gpu_node_graph.cc:821
PROP_FACTOR
@ PROP_FACTOR
Definition
RNA_types.hh:154
blender::nodes::DNode
Definition
NOD_derived_node_tree.hh:71
blender::nodes::NodeDeclarationBuilder
Definition
NOD_node_declaration.hh:525
blender::nodes::decl::Color
Definition
NOD_socket_declarations.hh:129
blender::nodes::decl::Float
Definition
NOD_socket_declarations.hh:19
blender::nodes::decl::Float::subtype
PropertySubType subtype
Definition
NOD_socket_declarations.hh:26
blender::nodes::node_composite_hue_sat_val_cc::HueSaturationValueShaderNode
Definition
node_composite_hue_sat_val.cc:54
blender::nodes::node_composite_hue_sat_val_cc::HueSaturationValueShaderNode::ShaderNode
ShaderNode(DNode node)
Definition
shader_node.cc:22
blender::nodes::node_composite_hue_sat_val_cc::HueSaturationValueShaderNode::compile
void compile(GPUMaterial *material) override
Definition
node_composite_hue_sat_val.cc:58
blender::realtime_compositor::ShaderNode
Definition
COM_shader_node.hh:31
blender::realtime_compositor::ShaderNode::get_inputs_array
GPUNodeStack * get_inputs_array()
Definition
shader_node.cc:28
blender::realtime_compositor::ShaderNode::get_outputs_array
GPUNodeStack * get_outputs_array()
Definition
shader_node.cc:33
blender::realtime_compositor::ShaderNode::ShaderNode
ShaderNode(DNode node)
Definition
shader_node.cc:22
blender::realtime_compositor::ShaderNode::bnode
const bNode & bnode() const
Definition
shader_node.cc:62
b
local_group_size(16, 16) .push_constant(Type b
Definition
compositor_morphological_distance_info.hh:16
blender::bke::node_register_type
void node_register_type(bNodeType *ntype)
Definition
node.cc:1708
blender::nodes::node_composite_hue_sat_val_cc
Definition
node_composite_hue_sat_val.cc:17
blender::nodes::node_composite_hue_sat_val_cc::cmp_node_huesatval_declare
static void cmp_node_huesatval_declare(NodeDeclarationBuilder &b)
Definition
node_composite_hue_sat_val.cc:19
blender::nodes::node_composite_hue_sat_val_cc::get_compositor_shader_node
static ShaderNode * get_compositor_shader_node(DNode node)
Definition
node_composite_hue_sat_val.cc:67
blender::realtime_compositor
Definition
BKE_node.hh:80
register_node_type_cmp_hue_sat
void register_node_type_cmp_hue_sat()
Definition
node_composite_hue_sat_val.cc:74
cmp_node_type_base
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Definition
node_composite_util.cc:31
node_composite_util.hh
outputs
static blender::bke::bNodeSocketTemplate outputs[]
Definition
node_texture_at.cc:16
inputs
static blender::bke::bNodeSocketTemplate inputs[]
Definition
node_texture_at.cc:11
GPUMaterial
Definition
gpu_material.cc:71
GPUNodeStack
Definition
GPU_material.hh:96
blender::bke::bNodeType
Defines a node type.
Definition
BKE_node.hh:218
blender::bke::bNodeType::declare
NodeDeclareFunction declare
Definition
BKE_node.hh:347
blender::bke::bNodeType::get_compositor_shader_node
NodeGetCompositorShaderNodeFunction get_compositor_shader_node
Definition
BKE_node.hh:328
Generated on Sat Oct 4 2025 05:32:23 for Blender by
doxygen
1.14.0