Blender V4.3
node_composite_gamma.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
9#include "GPU_material.hh"
10
11#include "COM_shader_node.hh"
12
14
15/* **************** Gamma Tools ******************** */
16
18
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>("Gamma")
25 .default_value(1.0f)
26 .min(0.001f)
27 .max(10.0f)
29 .compositor_domain_priority(1);
30 b.add_output<decl::Color>("Image");
31}
32
33using namespace blender::realtime_compositor;
34
36 public:
38
39 void compile(GPUMaterial *material) override
40 {
43
44 GPU_stack_link(material, &bnode(), "node_composite_gamma", inputs, outputs);
45 }
46};
47
49{
50 return new GammaShaderNode(node);
51}
52
53} // namespace blender::nodes::node_composite_gamma_cc
54
56{
58
59 static blender::bke::bNodeType ntype;
60
61 cmp_node_type_base(&ntype, CMP_NODE_GAMMA, "Gamma", NODE_CLASS_OP_COLOR);
62 ntype.declare = file_ns::cmp_node_gamma_declare;
63 ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
64
66}
#define NODE_CLASS_OP_COLOR
Definition BKE_node.hh:406
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ PROP_UNSIGNED
Definition RNA_types.hh:152
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void cmp_node_gamma_declare(NodeDeclarationBuilder &b)
static ShaderNode * get_compositor_shader_node(DNode node)
void register_node_type_cmp_gamma()
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition BKE_node.hh:218
NodeDeclareFunction declare
Definition BKE_node.hh:347
NodeGetCompositorShaderNodeFunction get_compositor_shader_node
Definition BKE_node.hh:328