Blender  V3.3
COM_HueSaturationValueCorrectNode.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
5 
6 #include "COM_ConvertOperation.h"
8 #include "COM_MixOperation.h"
9 
10 namespace blender::compositor {
11 
13  : Node(editor_node)
14 {
15  /* pass */
16 }
17 
19  NodeConverter &converter, const CompositorContext & /*context*/) const
20 {
21  NodeInput *value_socket = this->get_input_socket(0);
23  NodeOutput *output_socket = this->get_output_socket(0);
24  bNode *editorsnode = get_bnode();
25  CurveMapping *storage = (CurveMapping *)editorsnode->storage;
26 
28  converter.add_operation(rgbToHSV);
29 
31  converter.add_operation(hsvToRGB);
32 
34  changeHSV->set_curve_mapping(storage);
35  converter.add_operation(changeHSV);
36 
38  blend->set_canvas_input_index(1);
39  converter.add_operation(blend);
40 
41  converter.map_input_socket(color_socket, rgbToHSV->get_input_socket(0));
42  converter.add_link(rgbToHSV->get_output_socket(), changeHSV->get_input_socket(0));
43  converter.add_link(changeHSV->get_output_socket(), hsvToRGB->get_input_socket(0));
44  converter.add_link(hsvToRGB->get_output_socket(), blend->get_input_socket(2));
45  converter.map_input_socket(color_socket, blend->get_input_socket(1));
46  converter.map_input_socket(value_socket, blend->get_input_socket(0));
47  converter.map_output_socket(output_socket, blend->get_output_socket());
48 }
49 
50 } // namespace blender::compositor
Overall context of the compositor.
void convert_to_operations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
void add_link(NodeOperationOutput *from, NodeOperationInput *to)
void map_output_socket(NodeOutput *node_socket, NodeOperationOutput *operation_socket)
void add_operation(NodeOperation *operation)
void map_input_socket(NodeInput *node_socket, NodeOperationInput *operation_socket)
NodeInput are sockets that can receive data/input.
Definition: COM_Node.h:190
NodeOperationOutput * get_output_socket(unsigned int index=0)
NodeOperationInput * get_input_socket(unsigned int index)
NodeOutput are sockets that can send data/input.
Definition: COM_Node.h:238
NodeOutput * get_output_socket(unsigned int index=0) const
Definition: COM_Node.cc:84
bNode * get_bnode() const
get the reference to the SDNA bNode struct
Definition: COM_Node.h:64
NodeInput * get_input_socket(unsigned int index) const
Definition: COM_Node.cc:89
bNodeSocketValueRGBA * color_socket
void * storage
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)