Blender  V3.3
COM_HueSaturationValueNode.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
5 
7 #include "COM_ConvertOperation.h"
8 #include "COM_MixOperation.h"
9 
10 namespace blender::compositor {
11 
13 {
14  /* pass */
15 }
16 
18  const CompositorContext & /*context*/) const
19 {
21  NodeInput *hue_socket = this->get_input_socket(1);
22  NodeInput *saturation_socket = this->get_input_socket(2);
23  NodeInput *value_socket = this->get_input_socket(3);
24  NodeInput *fac_socket = this->get_input_socket(4);
25  NodeOutput *output_socket = this->get_output_socket(0);
26 
28  converter.add_operation(rgbToHSV);
29 
31  converter.add_operation(hsvToRGB);
32 
33  ChangeHSVOperation *changeHSV = new ChangeHSVOperation();
34  converter.map_input_socket(hue_socket, changeHSV->get_input_socket(1));
35  converter.map_input_socket(saturation_socket, changeHSV->get_input_socket(2));
36  converter.map_input_socket(value_socket, changeHSV->get_input_socket(3));
37  converter.add_operation(changeHSV);
38 
40  blend->set_canvas_input_index(1);
41  converter.add_operation(blend);
42 
43  converter.map_input_socket(color_socket, rgbToHSV->get_input_socket(0));
44  converter.add_link(rgbToHSV->get_output_socket(), changeHSV->get_input_socket(0));
45  converter.add_link(changeHSV->get_output_socket(), hsvToRGB->get_input_socket(0));
46  converter.add_link(hsvToRGB->get_output_socket(), blend->get_input_socket(2));
47  converter.map_input_socket(color_socket, blend->get_input_socket(1));
48  converter.map_input_socket(fac_socket, blend->get_input_socket(0));
49  converter.map_output_socket(output_socket, blend->get_output_socket());
50 }
51 
52 } // 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
NodeInput * get_input_socket(unsigned int index) const
Definition: COM_Node.cc:89
bNodeSocketValueRGBA * color_socket
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)