diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-10-14 00:01:15 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-10-14 00:41:14 +0300 |
commit | 1c42d4930a24d639b3aa561b9a8b4bbce05977e0 (patch) | |
tree | 68c2aae3fd5ae98b78708bea28c0b55d3f4fb5f0 /source/blender/compositor/nodes/COM_BlurNode.cc | |
parent | a2ee3c3a9f01f5cb2f05f1e84a1b6c1931d9d4a4 (diff) |
Cleanup: convert camelCase naming to snake_case in Compositor
To convert old code to the current convention and
use a single code style.
Diffstat (limited to 'source/blender/compositor/nodes/COM_BlurNode.cc')
-rw-r--r-- | source/blender/compositor/nodes/COM_BlurNode.cc | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/source/blender/compositor/nodes/COM_BlurNode.cc b/source/blender/compositor/nodes/COM_BlurNode.cc index 5dfd5c8d0bc..97a7159de67 100644 --- a/source/blender/compositor/nodes/COM_BlurNode.cc +++ b/source/blender/compositor/nodes/COM_BlurNode.cc @@ -29,103 +29,103 @@ 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; @@ -133,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; @@ -151,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()); } } |