Blender V4.3
node_composite_sepcomb_yuva.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/* **************** SEPARATE YUVA ******************** */
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_output<decl::Float>("Y").translation_context(BLT_I18NCONTEXT_COLOR);
25 b.add_output<decl::Float>("U").translation_context(BLT_I18NCONTEXT_COLOR);
26 b.add_output<decl::Float>("V").translation_context(BLT_I18NCONTEXT_COLOR);
27 b.add_output<decl::Float>("A").translation_context(BLT_I18NCONTEXT_COLOR);
28}
29
30using namespace blender::realtime_compositor;
31
33 public:
35
36 void compile(GPUMaterial *material) override
37 {
40
41 GPU_stack_link(material, &bnode(), "node_composite_separate_yuva_itu_709", inputs, outputs);
42 }
43};
44
46{
47 return new SeparateYUVAShaderNode(node);
48}
49
50} // namespace blender::nodes::node_composite_separate_yuva_cc
51
53{
55
56 static blender::bke::bNodeType ntype;
57
59 &ntype, CMP_NODE_SEPYUVA_LEGACY, "Separate YUVA (Legacy)", NODE_CLASS_CONVERTER);
60 ntype.declare = file_ns::cmp_node_sepyuva_declare;
61 ntype.gather_link_search_ops = nullptr;
62 ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
63
65}
66
67/* **************** COMBINE YUVA ******************** */
68
70
72{
73 b.add_input<decl::Float>("Y")
74 .min(0.0f)
75 .max(1.0f)
77 .translation_context(BLT_I18NCONTEXT_COLOR);
78 b.add_input<decl::Float>("U")
79 .min(0.0f)
80 .max(1.0f)
82 .translation_context(BLT_I18NCONTEXT_COLOR);
83 b.add_input<decl::Float>("V")
84 .min(0.0f)
85 .max(1.0f)
87 .translation_context(BLT_I18NCONTEXT_COLOR);
88 b.add_input<decl::Float>("A")
89 .default_value(1.0f)
90 .min(0.0f)
91 .max(1.0f)
93 .translation_context(BLT_I18NCONTEXT_COLOR);
94 b.add_output<decl::Color>("Image");
95}
96
97using namespace blender::realtime_compositor;
98
100 public:
102
103 void compile(GPUMaterial *material) override
104 {
105 GPUNodeStack *inputs = get_inputs_array();
106 GPUNodeStack *outputs = get_outputs_array();
107
108 GPU_stack_link(material, &bnode(), "node_composite_combine_yuva_itu_709", inputs, outputs);
109 }
110};
111
113{
114 return new CombineYUVAShaderNode(node);
115}
116
117} // namespace blender::nodes::node_composite_combine_yuva_cc
118
120{
122
123 static blender::bke::bNodeType ntype;
124
126 &ntype, CMP_NODE_COMBYUVA_LEGACY, "Combine YUVA (Legacy)", NODE_CLASS_CONVERTER);
127 ntype.declare = file_ns::cmp_node_combyuva_declare;
128 ntype.gather_link_search_ops = nullptr;
129 ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
130
132}
#define NODE_CLASS_CONVERTER
Definition BKE_node.hh:410
#define BLT_I18NCONTEXT_COLOR
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void cmp_node_combyuva_declare(NodeDeclarationBuilder &b)
static void cmp_node_sepyuva_declare(NodeDeclarationBuilder &b)
void register_node_type_cmp_sepyuva()
void register_node_type_cmp_combyuva()
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
#define min(a, b)
Definition sort.c:32
Defines a node type.
Definition BKE_node.hh:218
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition BKE_node.hh:363
NodeDeclareFunction declare
Definition BKE_node.hh:347
NodeGetCompositorShaderNodeFunction get_compositor_shader_node
Definition BKE_node.hh:328