Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/compositor/nodes/COM_BlurNode.cc')
-rw-r--r--source/blender/compositor/nodes/COM_BlurNode.cc156
1 files changed, 77 insertions, 79 deletions
diff --git a/source/blender/compositor/nodes/COM_BlurNode.cc b/source/blender/compositor/nodes/COM_BlurNode.cc
index c10bc2a05f0..97a7159de67 100644
--- a/source/blender/compositor/nodes/COM_BlurNode.cc
+++ b/source/blender/compositor/nodes/COM_BlurNode.cc
@@ -17,7 +17,6 @@
*/
#include "COM_BlurNode.h"
-#include "COM_ExecutionSystem.h"
#include "COM_FastGaussianBlurOperation.h"
#include "COM_GammaCorrectOperation.h"
#include "COM_GaussianAlphaXBlurOperation.h"
@@ -27,107 +26,106 @@
#include "COM_GaussianYBlurOperation.h"
#include "COM_MathBaseOperation.h"
#include "COM_SetValueOperation.h"
-#include "DNA_node_types.h"
namespace blender::compositor {
-BlurNode::BlurNode(bNode *editorNode) : Node(editorNode)
+BlurNode::BlurNode(bNode *editor_node) : Node(editor_node)
{
/* pass */
}
-void BlurNode::convertToOperations(NodeConverter &converter,
- const CompositorContext &context) const
+void BlurNode::convert_to_operations(NodeConverter &converter,
+ const CompositorContext &context) const
{
- bNode *editorNode = this->getbNode();
- NodeBlurData *data = (NodeBlurData *)editorNode->storage;
- NodeInput *inputSizeSocket = this->getInputSocket(1);
- bool connectedSizeSocket = inputSizeSocket->isLinked();
+ bNode *editor_node = this->get_bnode();
+ NodeBlurData *data = (NodeBlurData *)editor_node->storage;
+ NodeInput *input_size_socket = this->get_input_socket(1);
+ bool connected_size_socket = input_size_socket->is_linked();
- const float size = this->getInputSocket(1)->getEditorValueFloat();
- const bool extend_bounds = (editorNode->custom1 & CMP_NODEFLAG_BLUR_EXTEND_BOUNDS) != 0;
+ const float size = this->get_input_socket(1)->get_editor_value_float();
+ const bool extend_bounds = (editor_node->custom1 & CMP_NODEFLAG_BLUR_EXTEND_BOUNDS) != 0;
- eCompositorQuality quality = context.getQuality();
+ eCompositorQuality quality = context.get_quality();
NodeOperation *input_operation = nullptr, *output_operation = nullptr;
if (data->filtertype == R_FILTER_FAST_GAUSS) {
FastGaussianBlurOperation *operationfgb = new FastGaussianBlurOperation();
- operationfgb->setData(data);
- operationfgb->setExtendBounds(extend_bounds);
- converter.addOperation(operationfgb);
+ operationfgb->set_data(data);
+ operationfgb->set_extend_bounds(extend_bounds);
+ converter.add_operation(operationfgb);
- converter.mapInputSocket(getInputSocket(1), operationfgb->getInputSocket(1));
+ converter.map_input_socket(get_input_socket(1), operationfgb->get_input_socket(1));
input_operation = operationfgb;
output_operation = operationfgb;
}
- else if (editorNode->custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE) {
+ else if (editor_node->custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE) {
MathAddOperation *clamp = new MathAddOperation();
SetValueOperation *zero = new SetValueOperation();
- zero->setValue(0.0f);
- clamp->setUseClamp(true);
+ zero->set_value(0.0f);
+ clamp->set_use_clamp(true);
- converter.addOperation(clamp);
- converter.addOperation(zero);
- converter.mapInputSocket(getInputSocket(1), clamp->getInputSocket(0));
- converter.addLink(zero->getOutputSocket(), clamp->getInputSocket(1));
+ converter.add_operation(clamp);
+ converter.add_operation(zero);
+ converter.map_input_socket(get_input_socket(1), clamp->get_input_socket(0));
+ converter.add_link(zero->get_output_socket(), clamp->get_input_socket(1));
GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation();
- operationx->setData(data);
- operationx->setQuality(quality);
- operationx->setSize(1.0f);
- operationx->setFalloff(PROP_SMOOTH);
- operationx->setSubtract(false);
- operationx->setExtendBounds(extend_bounds);
+ operationx->set_data(data);
+ operationx->set_quality(quality);
+ operationx->set_size(1.0f);
+ operationx->set_falloff(PROP_SMOOTH);
+ operationx->set_subtract(false);
+ operationx->set_extend_bounds(extend_bounds);
- converter.addOperation(operationx);
- converter.addLink(clamp->getOutputSocket(), operationx->getInputSocket(0));
+ converter.add_operation(operationx);
+ converter.add_link(clamp->get_output_socket(), operationx->get_input_socket(0));
GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
- operationy->setData(data);
- operationy->setQuality(quality);
- operationy->setSize(1.0f);
- operationy->setFalloff(PROP_SMOOTH);
- operationy->setSubtract(false);
- operationy->setExtendBounds(extend_bounds);
+ operationy->set_data(data);
+ operationy->set_quality(quality);
+ operationy->set_size(1.0f);
+ operationy->set_falloff(PROP_SMOOTH);
+ operationy->set_subtract(false);
+ operationy->set_extend_bounds(extend_bounds);
- converter.addOperation(operationy);
- converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0));
+ converter.add_operation(operationy);
+ converter.add_link(operationx->get_output_socket(), operationy->get_input_socket(0));
GaussianBlurReferenceOperation *operation = new GaussianBlurReferenceOperation();
- operation->setData(data);
- operation->setQuality(quality);
- operation->setExtendBounds(extend_bounds);
+ operation->set_data(data);
+ operation->set_quality(quality);
+ operation->set_extend_bounds(extend_bounds);
- converter.addOperation(operation);
- converter.addLink(operationy->getOutputSocket(), operation->getInputSocket(1));
+ converter.add_operation(operation);
+ converter.add_link(operationy->get_output_socket(), operation->get_input_socket(1));
output_operation = operation;
input_operation = operation;
}
else if (!data->bokeh) {
GaussianXBlurOperation *operationx = new GaussianXBlurOperation();
- operationx->setData(data);
- operationx->setQuality(quality);
- operationx->checkOpenCL();
- operationx->setExtendBounds(extend_bounds);
+ operationx->set_data(data);
+ operationx->set_quality(quality);
+ operationx->check_opencl();
+ operationx->set_extend_bounds(extend_bounds);
- converter.addOperation(operationx);
- converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1));
+ converter.add_operation(operationx);
+ converter.map_input_socket(get_input_socket(1), operationx->get_input_socket(1));
GaussianYBlurOperation *operationy = new GaussianYBlurOperation();
- operationy->setData(data);
- operationy->setQuality(quality);
- operationy->checkOpenCL();
- operationy->setExtendBounds(extend_bounds);
-
- converter.addOperation(operationy);
- converter.mapInputSocket(getInputSocket(1), operationy->getInputSocket(1));
- converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0));
-
- if (!connectedSizeSocket) {
- operationx->setSize(size);
- operationy->setSize(size);
+ operationy->set_data(data);
+ operationy->set_quality(quality);
+ operationy->check_opencl();
+ operationy->set_extend_bounds(extend_bounds);
+
+ converter.add_operation(operationy);
+ converter.map_input_socket(get_input_socket(1), operationy->get_input_socket(1));
+ converter.add_link(operationx->get_output_socket(), operationy->get_input_socket(0));
+
+ if (!connected_size_socket) {
+ operationx->set_size(size);
+ operationy->set_size(size);
}
input_operation = operationx;
@@ -135,15 +133,15 @@ void BlurNode::convertToOperations(NodeConverter &converter,
}
else {
GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation();
- operation->setData(data);
- operation->setQuality(quality);
- operation->setExtendBounds(extend_bounds);
+ operation->set_data(data);
+ operation->set_quality(quality);
+ operation->set_extend_bounds(extend_bounds);
- converter.addOperation(operation);
- converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1));
+ converter.add_operation(operation);
+ converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1));
- if (!connectedSizeSocket) {
- operation->setSize(size);
+ if (!connected_size_socket) {
+ operation->set_size(size);
}
input_operation = operation;
@@ -153,21 +151,21 @@ void BlurNode::convertToOperations(NodeConverter &converter,
if (data->gamma) {
GammaCorrectOperation *correct = new GammaCorrectOperation();
GammaUncorrectOperation *inverse = new GammaUncorrectOperation();
- converter.addOperation(correct);
- converter.addOperation(inverse);
+ converter.add_operation(correct);
+ converter.add_operation(inverse);
- converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0));
- converter.addLink(correct->getOutputSocket(), input_operation->getInputSocket(0));
- converter.addLink(output_operation->getOutputSocket(), inverse->getInputSocket(0));
- converter.mapOutputSocket(getOutputSocket(), inverse->getOutputSocket());
+ converter.map_input_socket(get_input_socket(0), correct->get_input_socket(0));
+ converter.add_link(correct->get_output_socket(), input_operation->get_input_socket(0));
+ converter.add_link(output_operation->get_output_socket(), inverse->get_input_socket(0));
+ converter.map_output_socket(get_output_socket(), inverse->get_output_socket());
- converter.addPreview(inverse->getOutputSocket());
+ converter.add_preview(inverse->get_output_socket());
}
else {
- converter.mapInputSocket(getInputSocket(0), input_operation->getInputSocket(0));
- converter.mapOutputSocket(getOutputSocket(), output_operation->getOutputSocket());
+ converter.map_input_socket(get_input_socket(0), input_operation->get_input_socket(0));
+ converter.map_output_socket(get_output_socket(), output_operation->get_output_socket());
- converter.addPreview(output_operation->getOutputSocket());
+ converter.add_preview(output_operation->get_output_socket());
}
}