Blender V4.3
COM_HueSaturationValueCorrectNode.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6
9#include "COM_MixOperation.h"
10
11namespace blender::compositor {
12
14 : Node(editor_node)
15{
16 /* pass */
17}
18
20 NodeConverter &converter, const CompositorContext & /*context*/) const
21{
22 NodeInput *value_socket = this->get_input_socket(0);
23 NodeInput *color_socket = this->get_input_socket(1);
24 NodeOutput *output_socket = this->get_output_socket(0);
25 const bNode *editorsnode = get_bnode();
26 CurveMapping *storage = (CurveMapping *)editorsnode->storage;
27
29 converter.add_operation(rgbToHSV);
30
32 converter.add_operation(hsvToRGB);
33
35 changeHSV->set_curve_mapping(storage);
36 converter.add_operation(changeHSV);
37
39 blend->set_canvas_input_index(1);
40 converter.add_operation(blend);
41
42 converter.map_input_socket(color_socket, rgbToHSV->get_input_socket(0));
43 converter.add_link(rgbToHSV->get_output_socket(), changeHSV->get_input_socket(0));
44 converter.add_link(changeHSV->get_output_socket(), hsvToRGB->get_input_socket(0));
45 converter.add_link(hsvToRGB->get_output_socket(), blend->get_input_socket(2));
46 converter.map_input_socket(color_socket, blend->get_input_socket(1));
47 converter.map_input_socket(value_socket, blend->get_input_socket(0));
48 converter.map_output_socket(output_socket, blend->get_output_socket());
49}
50
51} // namespace blender::compositor
Overall context of the compositor.
void set_curve_mapping(const CurveMapping *mapping)
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:191
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:239
NodeOutput * get_output_socket(unsigned int index=0) const
Definition COM_Node.cc:85
NodeInput * get_input_socket(unsigned int index) const
Definition COM_Node.cc:90
const bNode * get_bnode() const
get the reference to the SDNA bNode struct
Definition COM_Node.h:65
void * storage