Blender  V3.3
COM_AntiAliasingNode.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2017 Blender Foundation. */
3 
4 #include "COM_AntiAliasingNode.h"
5 #include "COM_SMAAOperation.h"
6 
7 namespace blender::compositor {
8 
10  const CompositorContext & /*context*/) const
11 {
12  bNode *node = this->get_bnode();
14 
15  /* Edge Detection (First Pass) */
16  SMAAEdgeDetectionOperation *operation1 = nullptr;
17 
18  operation1 = new SMAAEdgeDetectionOperation();
19  operation1->set_threshold(data->threshold);
20  operation1->set_local_contrast_adaptation_factor(data->contrast_limit);
21  converter.add_operation(operation1);
22 
23  converter.map_input_socket(get_input_socket(0), operation1->get_input_socket(0));
24 
25  /* Blending Weight Calculation Pixel Shader (Second Pass) */
28  operation2->set_corner_rounding(data->corner_rounding);
29  converter.add_operation(operation2);
30 
31  converter.add_link(operation1->get_output_socket(), operation2->get_input_socket(0));
32 
33  /* Neighborhood Blending Pixel Shader (Third Pass) */
35  converter.add_operation(operation3);
36 
37  converter.map_input_socket(get_input_socket(0), operation3->get_input_socket(0));
38  converter.add_link(operation2->get_output_socket(), operation3->get_input_socket(1));
39  converter.map_output_socket(get_output_socket(0), operation3->get_output_socket());
40 }
41 
42 } // namespace blender::compositor
void convert_to_operations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
Overall context of the compositor.
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)
NodeOperationOutput * get_output_socket(unsigned int index=0)
NodeOperationInput * get_input_socket(unsigned int index)
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
OperationNode * node