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 | |
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')
172 files changed, 2505 insertions, 2464 deletions
diff --git a/source/blender/compositor/nodes/COM_AlphaOverNode.cc b/source/blender/compositor/nodes/COM_AlphaOverNode.cc index 603f713a43f..42836d0a575 100644 --- a/source/blender/compositor/nodes/COM_AlphaOverNode.cc +++ b/source/blender/compositor/nodes/COM_AlphaOverNode.cc @@ -24,43 +24,43 @@ namespace blender::compositor { -void AlphaOverNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void AlphaOverNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *color1Socket = this->getInputSocket(1); - NodeInput *color2Socket = this->getInputSocket(2); - bNode *editorNode = this->getbNode(); + NodeInput *color1Socket = this->get_input_socket(1); + NodeInput *color2Socket = this->get_input_socket(2); + bNode *editor_node = this->get_bnode(); - MixBaseOperation *convertProg; - NodeTwoFloats *ntf = (NodeTwoFloats *)editorNode->storage; + MixBaseOperation *convert_prog; + NodeTwoFloats *ntf = (NodeTwoFloats *)editor_node->storage; if (ntf->x != 0.0f) { - AlphaOverMixedOperation *mixOperation = new AlphaOverMixedOperation(); - mixOperation->setX(ntf->x); - convertProg = mixOperation; + AlphaOverMixedOperation *mix_operation = new AlphaOverMixedOperation(); + mix_operation->setX(ntf->x); + convert_prog = mix_operation; } - else if (editorNode->custom1) { - convertProg = new AlphaOverKeyOperation(); + else if (editor_node->custom1) { + convert_prog = new AlphaOverKeyOperation(); } else { - convertProg = new AlphaOverPremultiplyOperation(); + convert_prog = new AlphaOverPremultiplyOperation(); } - convertProg->setUseValueAlphaMultiply(false); - if (color1Socket->isLinked()) { - convertProg->set_canvas_input_index(1); + convert_prog->set_use_value_alpha_multiply(false); + if (color1Socket->is_linked()) { + convert_prog->set_canvas_input_index(1); } - else if (color2Socket->isLinked()) { - convertProg->set_canvas_input_index(2); + else if (color2Socket->is_linked()) { + convert_prog->set_canvas_input_index(2); } else { - convertProg->set_canvas_input_index(0); + convert_prog->set_canvas_input_index(0); } - converter.addOperation(convertProg); - converter.mapInputSocket(getInputSocket(0), convertProg->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), convertProg->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), convertProg->getInputSocket(2)); - converter.mapOutputSocket(getOutputSocket(0), convertProg->getOutputSocket(0)); + converter.add_operation(convert_prog); + converter.map_input_socket(get_input_socket(0), convert_prog->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), convert_prog->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), convert_prog->get_input_socket(2)); + converter.map_output_socket(get_output_socket(0), convert_prog->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_AlphaOverNode.h b/source/blender/compositor/nodes/COM_AlphaOverNode.h index 201c8ed5b6e..447570fe604 100644 --- a/source/blender/compositor/nodes/COM_AlphaOverNode.h +++ b/source/blender/compositor/nodes/COM_AlphaOverNode.h @@ -28,11 +28,11 @@ namespace blender::compositor { */ class AlphaOverNode : public Node { public: - AlphaOverNode(bNode *editorNode) : Node(editorNode) + AlphaOverNode(bNode *editor_node) : Node(editor_node) { } - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_AntiAliasingNode.cc b/source/blender/compositor/nodes/COM_AntiAliasingNode.cc index 8cbb3994939..b11c57041d9 100644 --- a/source/blender/compositor/nodes/COM_AntiAliasingNode.cc +++ b/source/blender/compositor/nodes/COM_AntiAliasingNode.cc @@ -23,37 +23,37 @@ namespace blender::compositor { -void AntiAliasingNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void AntiAliasingNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); NodeAntiAliasingData *data = (NodeAntiAliasingData *)node->storage; /* Edge Detection (First Pass) */ SMAAEdgeDetectionOperation *operation1 = nullptr; operation1 = new SMAAEdgeDetectionOperation(); - operation1->setThreshold(data->threshold); - operation1->setLocalContrastAdaptationFactor(data->contrast_limit); - converter.addOperation(operation1); + operation1->set_threshold(data->threshold); + operation1->set_local_contrast_adaptation_factor(data->contrast_limit); + converter.add_operation(operation1); - converter.mapInputSocket(getInputSocket(0), operation1->getInputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation1->get_input_socket(0)); /* Blending Weight Calculation Pixel Shader (Second Pass) */ SMAABlendingWeightCalculationOperation *operation2 = new SMAABlendingWeightCalculationOperation(); - operation2->setCornerRounding(data->corner_rounding); - converter.addOperation(operation2); + operation2->set_corner_rounding(data->corner_rounding); + converter.add_operation(operation2); - converter.addLink(operation1->getOutputSocket(), operation2->getInputSocket(0)); + converter.add_link(operation1->get_output_socket(), operation2->get_input_socket(0)); /* Neighborhood Blending Pixel Shader (Third Pass) */ SMAANeighborhoodBlendingOperation *operation3 = new SMAANeighborhoodBlendingOperation(); - converter.addOperation(operation3); + converter.add_operation(operation3); - converter.mapInputSocket(getInputSocket(0), operation3->getInputSocket(0)); - converter.addLink(operation2->getOutputSocket(), operation3->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation3->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation3->get_input_socket(0)); + converter.add_link(operation2->get_output_socket(), operation3->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation3->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_AntiAliasingNode.h b/source/blender/compositor/nodes/COM_AntiAliasingNode.h index 7d3dd750864..05c51d5856a 100644 --- a/source/blender/compositor/nodes/COM_AntiAliasingNode.h +++ b/source/blender/compositor/nodes/COM_AntiAliasingNode.h @@ -30,11 +30,11 @@ namespace blender::compositor { */ class AntiAliasingNode : public Node { public: - AntiAliasingNode(bNode *editorNode) : Node(editorNode) + AntiAliasingNode(bNode *editor_node) : Node(editor_node) { } - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_BilateralBlurNode.cc b/source/blender/compositor/nodes/COM_BilateralBlurNode.cc index 40a70e37e4b..2390f6305b2 100644 --- a/source/blender/compositor/nodes/COM_BilateralBlurNode.cc +++ b/source/blender/compositor/nodes/COM_BilateralBlurNode.cc @@ -21,23 +21,23 @@ namespace blender::compositor { -BilateralBlurNode::BilateralBlurNode(bNode *editorNode) : Node(editorNode) +BilateralBlurNode::BilateralBlurNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void BilateralBlurNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void BilateralBlurNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeBilateralBlurData *data = (NodeBilateralBlurData *)this->getbNode()->storage; + NodeBilateralBlurData *data = (NodeBilateralBlurData *)this->get_bnode()->storage; BilateralBlurOperation *operation = new BilateralBlurOperation(); - operation->setQuality(context.getQuality()); - operation->setData(data); + operation->set_quality(context.get_quality()); + operation->set_data(data); - converter.addOperation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.add_operation(operation); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_BilateralBlurNode.h b/source/blender/compositor/nodes/COM_BilateralBlurNode.h index fed2612ac02..6bef897f2ef 100644 --- a/source/blender/compositor/nodes/COM_BilateralBlurNode.h +++ b/source/blender/compositor/nodes/COM_BilateralBlurNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class BilateralBlurNode : public Node { public: - BilateralBlurNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + BilateralBlurNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor 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()); } } diff --git a/source/blender/compositor/nodes/COM_BlurNode.h b/source/blender/compositor/nodes/COM_BlurNode.h index 61cdc17f3a9..816f359cab1 100644 --- a/source/blender/compositor/nodes/COM_BlurNode.h +++ b/source/blender/compositor/nodes/COM_BlurNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class BlurNode : public Node { public: - BlurNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + BlurNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.cc b/source/blender/compositor/nodes/COM_BokehBlurNode.cc index c18f6351cbd..8f71621c435 100644 --- a/source/blender/compositor/nodes/COM_BokehBlurNode.cc +++ b/source/blender/compositor/nodes/COM_BokehBlurNode.cc @@ -22,52 +22,52 @@ namespace blender::compositor { -BokehBlurNode::BokehBlurNode(bNode *editorNode) : Node(editorNode) +BokehBlurNode::BokehBlurNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void BokehBlurNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void BokehBlurNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *b_node = this->getbNode(); + bNode *b_node = this->get_bnode(); - NodeInput *inputSizeSocket = this->getInputSocket(2); + NodeInput *input_size_socket = this->get_input_socket(2); - bool connectedSizeSocket = inputSizeSocket->isLinked(); + bool connected_size_socket = input_size_socket->is_linked(); const bool extend_bounds = (b_node->custom1 & CMP_NODEFLAG_BLUR_EXTEND_BOUNDS) != 0; - if ((b_node->custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE) && connectedSizeSocket) { + if ((b_node->custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE) && connected_size_socket) { VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation(); - operation->setQuality(context.getQuality()); - operation->setThreshold(0.0f); - operation->setMaxBlur(b_node->custom4); - operation->setDoScaleSize(true); + operation->set_quality(context.get_quality()); + operation->set_threshold(0.0f); + operation->set_max_blur(b_node->custom4); + operation->set_do_scale_size(true); - converter.addOperation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.add_operation(operation); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } else { BokehBlurOperation *operation = new BokehBlurOperation(); - operation->setQuality(context.getQuality()); - operation->setExtendBounds(extend_bounds); + operation->set_quality(context.get_quality()); + operation->set_extend_bounds(extend_bounds); - converter.addOperation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); + converter.add_operation(operation); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); /* NOTE: on the bokeh blur operation the sockets are switched. * for this reason the next two lines are correct. Fix for T43771. */ - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(3)); - converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(2)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(3)); + converter.map_input_socket(get_input_socket(3), operation->get_input_socket(2)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); - if (!connectedSizeSocket) { - operation->setSize(this->getInputSocket(2)->getEditorValueFloat()); + if (!connected_size_socket) { + operation->set_size(this->get_input_socket(2)->get_editor_value_float()); } } } diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.h b/source/blender/compositor/nodes/COM_BokehBlurNode.h index 2c060936025..869eee44a6f 100644 --- a/source/blender/compositor/nodes/COM_BokehBlurNode.h +++ b/source/blender/compositor/nodes/COM_BokehBlurNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class BokehBlurNode : public Node { public: - BokehBlurNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + BokehBlurNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_BokehImageNode.cc b/source/blender/compositor/nodes/COM_BokehImageNode.cc index 64237571e90..c860ef7a1c9 100644 --- a/source/blender/compositor/nodes/COM_BokehImageNode.cc +++ b/source/blender/compositor/nodes/COM_BokehImageNode.cc @@ -21,21 +21,21 @@ namespace blender::compositor { -BokehImageNode::BokehImageNode(bNode *editorNode) : Node(editorNode) +BokehImageNode::BokehImageNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void BokehImageNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void BokehImageNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { BokehImageOperation *operation = new BokehImageOperation(); - operation->setData((NodeBokehImage *)this->getbNode()->storage); + operation->set_data((NodeBokehImage *)this->get_bnode()->storage); - converter.addOperation(operation); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.add_operation(operation); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); - converter.addPreview(operation->getOutputSocket(0)); + converter.add_preview(operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_BokehImageNode.h b/source/blender/compositor/nodes/COM_BokehImageNode.h index 323561a7e4f..cb685c93237 100644 --- a/source/blender/compositor/nodes/COM_BokehImageNode.h +++ b/source/blender/compositor/nodes/COM_BokehImageNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class BokehImageNode : public Node { public: - BokehImageNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + BokehImageNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_BoxMaskNode.cc b/source/blender/compositor/nodes/COM_BoxMaskNode.cc index 6fcaeada406..1cf05727a0a 100644 --- a/source/blender/compositor/nodes/COM_BoxMaskNode.cc +++ b/source/blender/compositor/nodes/COM_BoxMaskNode.cc @@ -24,52 +24,53 @@ namespace blender::compositor { -BoxMaskNode::BoxMaskNode(bNode *editorNode) : Node(editorNode) +BoxMaskNode::BoxMaskNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void BoxMaskNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void BoxMaskNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_socket = this->get_input_socket(0); + NodeOutput *output_socket = this->get_output_socket(0); BoxMaskOperation *operation; operation = new BoxMaskOperation(); - operation->setData((NodeBoxMask *)this->getbNode()->storage); - operation->setMaskType(this->getbNode()->custom1); - converter.addOperation(operation); + operation->set_data((NodeBoxMask *)this->get_bnode()->storage); + operation->set_mask_type(this->get_bnode()->custom1); + converter.add_operation(operation); - if (inputSocket->isLinked()) { - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); + if (input_socket->is_linked()) { + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket()); } else { /* Value operation to produce original transparent image */ - SetValueOperation *valueOperation = new SetValueOperation(); - valueOperation->setValue(0.0f); - converter.addOperation(valueOperation); + SetValueOperation *value_operation = new SetValueOperation(); + value_operation->set_value(0.0f); + converter.add_operation(value_operation); /* Scale that image up to render resolution */ - const RenderData *rd = context.getRenderData(); - const float render_size_factor = context.getRenderPercentageAsFactor(); - ScaleFixedSizeOperation *scaleOperation = new ScaleFixedSizeOperation(); + const RenderData *rd = context.get_render_data(); + const float render_size_factor = context.get_render_percentage_as_factor(); + ScaleFixedSizeOperation *scale_operation = new ScaleFixedSizeOperation(); - scaleOperation->setIsAspect(false); - scaleOperation->setIsCrop(false); - scaleOperation->setOffset(0.0f, 0.0f); - scaleOperation->setNewWidth(rd->xsch * render_size_factor); - scaleOperation->setNewHeight(rd->ysch * render_size_factor); - scaleOperation->getInputSocket(0)->setResizeMode(ResizeMode::Align); - converter.addOperation(scaleOperation); + scale_operation->set_is_aspect(false); + scale_operation->set_is_crop(false); + scale_operation->set_offset(0.0f, 0.0f); + scale_operation->set_new_width(rd->xsch * render_size_factor); + scale_operation->set_new_height(rd->ysch * render_size_factor); + scale_operation->get_input_socket(0)->set_resize_mode(ResizeMode::Align); + converter.add_operation(scale_operation); - converter.addLink(valueOperation->getOutputSocket(0), scaleOperation->getInputSocket(0)); - converter.addLink(scaleOperation->getOutputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.add_link(value_operation->get_output_socket(0), + scale_operation->get_input_socket(0)); + converter.add_link(scale_operation->get_output_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); } - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_BoxMaskNode.h b/source/blender/compositor/nodes/COM_BoxMaskNode.h index 46cedf7af75..68d98f6c0ea 100644 --- a/source/blender/compositor/nodes/COM_BoxMaskNode.h +++ b/source/blender/compositor/nodes/COM_BoxMaskNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class BoxMaskNode : public Node { public: - BoxMaskNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + BoxMaskNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_BrightnessNode.cc b/source/blender/compositor/nodes/COM_BrightnessNode.cc index e01ec3d8729..0b87d5d3d49 100644 --- a/source/blender/compositor/nodes/COM_BrightnessNode.cc +++ b/source/blender/compositor/nodes/COM_BrightnessNode.cc @@ -21,23 +21,23 @@ namespace blender::compositor { -BrightnessNode::BrightnessNode(bNode *editorNode) : Node(editorNode) +BrightnessNode::BrightnessNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void BrightnessNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void BrightnessNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *bnode = this->getbNode(); + bNode *bnode = this->get_bnode(); BrightnessOperation *operation = new BrightnessOperation(); - operation->setUsePremultiply((bnode->custom1 & 1) != 0); - converter.addOperation(operation); + operation->set_use_premultiply((bnode->custom1 & 1) != 0); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_BrightnessNode.h b/source/blender/compositor/nodes/COM_BrightnessNode.h index 1084108b1c3..82a383557ba 100644 --- a/source/blender/compositor/nodes/COM_BrightnessNode.h +++ b/source/blender/compositor/nodes/COM_BrightnessNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class BrightnessNode : public Node { public: - BrightnessNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + BrightnessNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ChannelMatteNode.cc b/source/blender/compositor/nodes/COM_ChannelMatteNode.cc index ed49d9c36a9..cf8e8a7392d 100644 --- a/source/blender/compositor/nodes/COM_ChannelMatteNode.cc +++ b/source/blender/compositor/nodes/COM_ChannelMatteNode.cc @@ -23,19 +23,19 @@ namespace blender::compositor { -ChannelMatteNode::ChannelMatteNode(bNode *editorNode) : Node(editorNode) +ChannelMatteNode::ChannelMatteNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ChannelMatteNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ChannelMatteNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); - NodeInput *inputSocketImage = this->getInputSocket(0); - NodeOutput *outputSocketImage = this->getOutputSocket(0); - NodeOutput *outputSocketMatte = this->getOutputSocket(1); + NodeInput *input_socket_image = this->get_input_socket(0); + NodeOutput *output_socket_image = this->get_output_socket(0); + NodeOutput *output_socket_matte = this->get_output_socket(1); NodeOperation *convert = nullptr, *inv_convert = nullptr; /* colorspace */ @@ -52,9 +52,9 @@ void ChannelMatteNode::convertToOperations(NodeConverter &converter, break; case CMP_NODE_CHANNEL_MATTE_CS_YCC: /* YCC */ convert = new ConvertRGBToYCCOperation(); - ((ConvertRGBToYCCOperation *)convert)->setMode(BLI_YCC_ITU_BT709); + ((ConvertRGBToYCCOperation *)convert)->set_mode(BLI_YCC_ITU_BT709); inv_convert = new ConvertYCCToRGBOperation(); - ((ConvertYCCToRGBOperation *)inv_convert)->setMode(BLI_YCC_ITU_BT709); + ((ConvertYCCToRGBOperation *)inv_convert)->set_mode(BLI_YCC_ITU_BT709); break; default: break; @@ -62,36 +62,36 @@ void ChannelMatteNode::convertToOperations(NodeConverter &converter, ChannelMatteOperation *operation = new ChannelMatteOperation(); /* pass the ui properties to the operation */ - operation->setSettings((NodeChroma *)node->storage, node->custom2); - converter.addOperation(operation); + operation->set_settings((NodeChroma *)node->storage, node->custom2); + converter.add_operation(operation); - SetAlphaMultiplyOperation *operationAlpha = new SetAlphaMultiplyOperation(); - converter.addOperation(operationAlpha); + SetAlphaMultiplyOperation *operation_alpha = new SetAlphaMultiplyOperation(); + converter.add_operation(operation_alpha); if (convert != nullptr) { - converter.addOperation(convert); + converter.add_operation(convert); - converter.mapInputSocket(inputSocketImage, convert->getInputSocket(0)); - converter.addLink(convert->getOutputSocket(), operation->getInputSocket(0)); - converter.addLink(convert->getOutputSocket(), operationAlpha->getInputSocket(0)); + converter.map_input_socket(input_socket_image, convert->get_input_socket(0)); + converter.add_link(convert->get_output_socket(), operation->get_input_socket(0)); + converter.add_link(convert->get_output_socket(), operation_alpha->get_input_socket(0)); } else { - converter.mapInputSocket(inputSocketImage, operation->getInputSocket(0)); - converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); + converter.map_input_socket(input_socket_image, operation->get_input_socket(0)); + converter.map_input_socket(input_socket_image, operation_alpha->get_input_socket(0)); } - converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0)); - converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); + converter.map_output_socket(output_socket_matte, operation->get_output_socket(0)); + converter.add_link(operation->get_output_socket(), operation_alpha->get_input_socket(1)); if (inv_convert != nullptr) { - converter.addOperation(inv_convert); - converter.addLink(operationAlpha->getOutputSocket(0), inv_convert->getInputSocket(0)); - converter.mapOutputSocket(outputSocketImage, inv_convert->getOutputSocket()); - converter.addPreview(inv_convert->getOutputSocket()); + converter.add_operation(inv_convert); + converter.add_link(operation_alpha->get_output_socket(0), inv_convert->get_input_socket(0)); + converter.map_output_socket(output_socket_image, inv_convert->get_output_socket()); + converter.add_preview(inv_convert->get_output_socket()); } else { - converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket()); - converter.addPreview(operationAlpha->getOutputSocket()); + converter.map_output_socket(output_socket_image, operation_alpha->get_output_socket()); + converter.add_preview(operation_alpha->get_output_socket()); } } diff --git a/source/blender/compositor/nodes/COM_ChannelMatteNode.h b/source/blender/compositor/nodes/COM_ChannelMatteNode.h index 46100b3f7ea..c071c516e6d 100644 --- a/source/blender/compositor/nodes/COM_ChannelMatteNode.h +++ b/source/blender/compositor/nodes/COM_ChannelMatteNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ChannelMatteNode : public Node { public: - ChannelMatteNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ChannelMatteNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ChromaMatteNode.cc b/source/blender/compositor/nodes/COM_ChromaMatteNode.cc index 33516181152..8db96e0308d 100644 --- a/source/blender/compositor/nodes/COM_ChromaMatteNode.cc +++ b/source/blender/compositor/nodes/COM_ChromaMatteNode.cc @@ -23,46 +23,46 @@ namespace blender::compositor { -ChromaMatteNode::ChromaMatteNode(bNode *editorNode) : Node(editorNode) +ChromaMatteNode::ChromaMatteNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ChromaMatteNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ChromaMatteNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *editorsnode = getbNode(); + bNode *editorsnode = get_bnode(); - NodeInput *inputSocketImage = this->getInputSocket(0); - NodeInput *inputSocketKey = this->getInputSocket(1); - NodeOutput *outputSocketImage = this->getOutputSocket(0); - NodeOutput *outputSocketMatte = this->getOutputSocket(1); + NodeInput *input_socket_image = this->get_input_socket(0); + NodeInput *input_socket_key = this->get_input_socket(1); + NodeOutput *output_socket_image = this->get_output_socket(0); + NodeOutput *output_socket_matte = this->get_output_socket(1); ConvertRGBToYCCOperation *operationRGBToYCC_Image = new ConvertRGBToYCCOperation(); ConvertRGBToYCCOperation *operationRGBToYCC_Key = new ConvertRGBToYCCOperation(); - operationRGBToYCC_Image->setMode(BLI_YCC_ITU_BT709); - operationRGBToYCC_Key->setMode(BLI_YCC_ITU_BT709); - converter.addOperation(operationRGBToYCC_Image); - converter.addOperation(operationRGBToYCC_Key); + operationRGBToYCC_Image->set_mode(BLI_YCC_ITU_BT709); + operationRGBToYCC_Key->set_mode(BLI_YCC_ITU_BT709); + converter.add_operation(operationRGBToYCC_Image); + converter.add_operation(operationRGBToYCC_Key); ChromaMatteOperation *operation = new ChromaMatteOperation(); - operation->setSettings((NodeChroma *)editorsnode->storage); - converter.addOperation(operation); + operation->set_settings((NodeChroma *)editorsnode->storage); + converter.add_operation(operation); - SetAlphaMultiplyOperation *operationAlpha = new SetAlphaMultiplyOperation(); - converter.addOperation(operationAlpha); + SetAlphaMultiplyOperation *operation_alpha = new SetAlphaMultiplyOperation(); + converter.add_operation(operation_alpha); - converter.mapInputSocket(inputSocketImage, operationRGBToYCC_Image->getInputSocket(0)); - converter.mapInputSocket(inputSocketKey, operationRGBToYCC_Key->getInputSocket(0)); - converter.addLink(operationRGBToYCC_Image->getOutputSocket(), operation->getInputSocket(0)); - converter.addLink(operationRGBToYCC_Key->getOutputSocket(), operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket()); + converter.map_input_socket(input_socket_image, operationRGBToYCC_Image->get_input_socket(0)); + converter.map_input_socket(input_socket_key, operationRGBToYCC_Key->get_input_socket(0)); + converter.add_link(operationRGBToYCC_Image->get_output_socket(), operation->get_input_socket(0)); + converter.add_link(operationRGBToYCC_Key->get_output_socket(), operation->get_input_socket(1)); + converter.map_output_socket(output_socket_matte, operation->get_output_socket()); - converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); - converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); - converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket()); + converter.map_input_socket(input_socket_image, operation_alpha->get_input_socket(0)); + converter.add_link(operation->get_output_socket(), operation_alpha->get_input_socket(1)); + converter.map_output_socket(output_socket_image, operation_alpha->get_output_socket()); - converter.addPreview(operationAlpha->getOutputSocket()); + converter.add_preview(operation_alpha->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ChromaMatteNode.h b/source/blender/compositor/nodes/COM_ChromaMatteNode.h index f3ddd013fa4..854c07c104b 100644 --- a/source/blender/compositor/nodes/COM_ChromaMatteNode.h +++ b/source/blender/compositor/nodes/COM_ChromaMatteNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ChromaMatteNode : public Node { public: - ChromaMatteNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ChromaMatteNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorBalanceNode.cc b/source/blender/compositor/nodes/COM_ColorBalanceNode.cc index 8f9d05ad1e1..e7c43161a00 100644 --- a/source/blender/compositor/nodes/COM_ColorBalanceNode.cc +++ b/source/blender/compositor/nodes/COM_ColorBalanceNode.cc @@ -22,20 +22,20 @@ namespace blender::compositor { -ColorBalanceNode::ColorBalanceNode(bNode *editorNode) : Node(editorNode) +ColorBalanceNode::ColorBalanceNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ColorBalanceNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ColorBalanceNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); NodeColorBalance *n = (NodeColorBalance *)node->storage; - NodeInput *inputSocket = this->getInputSocket(0); - NodeInput *inputImageSocket = this->getInputSocket(1); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_socket = this->get_input_socket(0); + NodeInput *input_image_socket = this->get_input_socket(1); + NodeOutput *output_socket = this->get_output_socket(0); NodeOperation *operation; if (node->custom1 == 0) { @@ -47,9 +47,9 @@ void ColorBalanceNode::convertToOperations(NodeConverter &converter, gamma_inv[c] = (n->gamma[c] != 0.0f) ? 1.0f / n->gamma[c] : 1000000.0f; } - operationLGG->setGain(n->gain); - operationLGG->setLift(lift_lgg); - operationLGG->setGammaInv(gamma_inv); + operationLGG->set_gain(n->gain); + operationLGG->set_lift(lift_lgg); + operationLGG->set_gamma_inv(gamma_inv); operation = operationLGG; } else { @@ -59,16 +59,16 @@ void ColorBalanceNode::convertToOperations(NodeConverter &converter, copy_v3_fl(offset, n->offset_basis); add_v3_v3(offset, n->offset); - operationCDL->setOffset(offset); - operationCDL->setPower(n->power); - operationCDL->setSlope(n->slope); + operationCDL->set_offset(offset); + operationCDL->set_power(n->power); + operationCDL->set_slope(n->slope); operation = operationCDL; } - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapInputSocket(inputImageSocket, operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_input_socket(input_image_socket, operation->get_input_socket(1)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorBalanceNode.h b/source/blender/compositor/nodes/COM_ColorBalanceNode.h index 243713b4912..3ac0b7cdee1 100644 --- a/source/blender/compositor/nodes/COM_ColorBalanceNode.h +++ b/source/blender/compositor/nodes/COM_ColorBalanceNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ColorBalanceNode : public Node { public: - ColorBalanceNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ColorBalanceNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorCorrectionNode.cc b/source/blender/compositor/nodes/COM_ColorCorrectionNode.cc index b5bf118d7de..49d8a7fec98 100644 --- a/source/blender/compositor/nodes/COM_ColorCorrectionNode.cc +++ b/source/blender/compositor/nodes/COM_ColorCorrectionNode.cc @@ -21,26 +21,26 @@ namespace blender::compositor { -ColorCorrectionNode::ColorCorrectionNode(bNode *editorNode) : Node(editorNode) +ColorCorrectionNode::ColorCorrectionNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ColorCorrectionNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ColorCorrectionNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *editorNode = getbNode(); + bNode *editor_node = get_bnode(); ColorCorrectionOperation *operation = new ColorCorrectionOperation(); - operation->setData((NodeColorCorrection *)editorNode->storage); - operation->setRedChannelEnabled((editorNode->custom1 & 1) != 0); - operation->setGreenChannelEnabled((editorNode->custom1 & 2) != 0); - operation->setBlueChannelEnabled((editorNode->custom1 & 4) != 0); - converter.addOperation(operation); + operation->set_data((NodeColorCorrection *)editor_node->storage); + operation->set_red_channel_enabled((editor_node->custom1 & 1) != 0); + operation->set_green_channel_enabled((editor_node->custom1 & 2) != 0); + operation->set_blue_channel_enabled((editor_node->custom1 & 4) != 0); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorCorrectionNode.h b/source/blender/compositor/nodes/COM_ColorCorrectionNode.h index aee07ee07a3..6fe4212e428 100644 --- a/source/blender/compositor/nodes/COM_ColorCorrectionNode.h +++ b/source/blender/compositor/nodes/COM_ColorCorrectionNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ColorCorrectionNode : public Node { public: - ColorCorrectionNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ColorCorrectionNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorCurveNode.cc b/source/blender/compositor/nodes/COM_ColorCurveNode.cc index 4a82a42b036..5b59b2bee14 100644 --- a/source/blender/compositor/nodes/COM_ColorCurveNode.cc +++ b/source/blender/compositor/nodes/COM_ColorCurveNode.cc @@ -21,39 +21,39 @@ namespace blender::compositor { -ColorCurveNode::ColorCurveNode(bNode *editorNode) : Node(editorNode) +ColorCurveNode::ColorCurveNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ColorCurveNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ColorCurveNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - if (this->getInputSocket(2)->isLinked() || this->getInputSocket(3)->isLinked()) { + if (this->get_input_socket(2)->is_linked() || this->get_input_socket(3)->is_linked()) { ColorCurveOperation *operation = new ColorCurveOperation(); - operation->setCurveMapping((CurveMapping *)this->getbNode()->storage); - converter.addOperation(operation); + operation->set_curve_mapping((CurveMapping *)this->get_bnode()->storage); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); - converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(3)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2)); + converter.map_input_socket(get_input_socket(3), operation->get_input_socket(3)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } else { ConstantLevelColorCurveOperation *operation = new ConstantLevelColorCurveOperation(); float col[4]; - this->getInputSocket(2)->getEditorValueColor(col); - operation->setBlackLevel(col); - this->getInputSocket(3)->getEditorValueColor(col); - operation->setWhiteLevel(col); - operation->setCurveMapping((CurveMapping *)this->getbNode()->storage); - converter.addOperation(operation); - - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + this->get_input_socket(2)->get_editor_value_color(col); + operation->set_black_level(col); + this->get_input_socket(3)->get_editor_value_color(col); + operation->set_white_level(col); + operation->set_curve_mapping((CurveMapping *)this->get_bnode()->storage); + converter.add_operation(operation); + + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } } diff --git a/source/blender/compositor/nodes/COM_ColorCurveNode.h b/source/blender/compositor/nodes/COM_ColorCurveNode.h index 89786b47cf5..852f755bf95 100644 --- a/source/blender/compositor/nodes/COM_ColorCurveNode.h +++ b/source/blender/compositor/nodes/COM_ColorCurveNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ColorCurveNode : public Node { public: - ColorCurveNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ColorCurveNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorExposureNode.cc b/source/blender/compositor/nodes/COM_ColorExposureNode.cc index 83507395108..2f5e6b0a7bf 100644 --- a/source/blender/compositor/nodes/COM_ColorExposureNode.cc +++ b/source/blender/compositor/nodes/COM_ColorExposureNode.cc @@ -21,20 +21,20 @@ namespace blender::compositor { -ExposureNode::ExposureNode(bNode *editorNode) : Node(editorNode) +ExposureNode::ExposureNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ExposureNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ExposureNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { ExposureOperation *operation = new ExposureOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorExposureNode.h b/source/blender/compositor/nodes/COM_ColorExposureNode.h index df9bfc65f81..33b143e0676 100644 --- a/source/blender/compositor/nodes/COM_ColorExposureNode.h +++ b/source/blender/compositor/nodes/COM_ColorExposureNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ExposureNode : public Node { public: - ExposureNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ExposureNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorMatteNode.cc b/source/blender/compositor/nodes/COM_ColorMatteNode.cc index 345cdb3ecf7..629ae932eb7 100644 --- a/source/blender/compositor/nodes/COM_ColorMatteNode.cc +++ b/source/blender/compositor/nodes/COM_ColorMatteNode.cc @@ -23,44 +23,44 @@ namespace blender::compositor { -ColorMatteNode::ColorMatteNode(bNode *editorNode) : Node(editorNode) +ColorMatteNode::ColorMatteNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ColorMatteNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ColorMatteNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *editorsnode = getbNode(); + bNode *editorsnode = get_bnode(); - NodeInput *inputSocketImage = this->getInputSocket(0); - NodeInput *inputSocketKey = this->getInputSocket(1); - NodeOutput *outputSocketImage = this->getOutputSocket(0); - NodeOutput *outputSocketMatte = this->getOutputSocket(1); + NodeInput *input_socket_image = this->get_input_socket(0); + NodeInput *input_socket_key = this->get_input_socket(1); + NodeOutput *output_socket_image = this->get_output_socket(0); + NodeOutput *output_socket_matte = this->get_output_socket(1); ConvertRGBToHSVOperation *operationRGBToHSV_Image = new ConvertRGBToHSVOperation(); ConvertRGBToHSVOperation *operationRGBToHSV_Key = new ConvertRGBToHSVOperation(); - converter.addOperation(operationRGBToHSV_Image); - converter.addOperation(operationRGBToHSV_Key); + converter.add_operation(operationRGBToHSV_Image); + converter.add_operation(operationRGBToHSV_Key); ColorMatteOperation *operation = new ColorMatteOperation(); - operation->setSettings((NodeChroma *)editorsnode->storage); - converter.addOperation(operation); + operation->set_settings((NodeChroma *)editorsnode->storage); + converter.add_operation(operation); - SetAlphaMultiplyOperation *operationAlpha = new SetAlphaMultiplyOperation(); - converter.addOperation(operationAlpha); + SetAlphaMultiplyOperation *operation_alpha = new SetAlphaMultiplyOperation(); + converter.add_operation(operation_alpha); - converter.mapInputSocket(inputSocketImage, operationRGBToHSV_Image->getInputSocket(0)); - converter.mapInputSocket(inputSocketKey, operationRGBToHSV_Key->getInputSocket(0)); - converter.addLink(operationRGBToHSV_Image->getOutputSocket(), operation->getInputSocket(0)); - converter.addLink(operationRGBToHSV_Key->getOutputSocket(), operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket_image, operationRGBToHSV_Image->get_input_socket(0)); + converter.map_input_socket(input_socket_key, operationRGBToHSV_Key->get_input_socket(0)); + converter.add_link(operationRGBToHSV_Image->get_output_socket(), operation->get_input_socket(0)); + converter.add_link(operationRGBToHSV_Key->get_output_socket(), operation->get_input_socket(1)); + converter.map_output_socket(output_socket_matte, operation->get_output_socket(0)); - converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); - converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); - converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket()); + converter.map_input_socket(input_socket_image, operation_alpha->get_input_socket(0)); + converter.add_link(operation->get_output_socket(), operation_alpha->get_input_socket(1)); + converter.map_output_socket(output_socket_image, operation_alpha->get_output_socket()); - converter.addPreview(operationAlpha->getOutputSocket()); + converter.add_preview(operation_alpha->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorMatteNode.h b/source/blender/compositor/nodes/COM_ColorMatteNode.h index 9d70b6d8416..3e1bfd607e8 100644 --- a/source/blender/compositor/nodes/COM_ColorMatteNode.h +++ b/source/blender/compositor/nodes/COM_ColorMatteNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ColorMatteNode : public Node { public: - ColorMatteNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ColorMatteNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorNode.cc b/source/blender/compositor/nodes/COM_ColorNode.cc index e79f2eb97af..2d875d703c7 100644 --- a/source/blender/compositor/nodes/COM_ColorNode.cc +++ b/source/blender/compositor/nodes/COM_ColorNode.cc @@ -21,22 +21,22 @@ namespace blender::compositor { -ColorNode::ColorNode(bNode *editorNode) : Node(editorNode) +ColorNode::ColorNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ColorNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ColorNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { SetColorOperation *operation = new SetColorOperation(); - NodeOutput *output = this->getOutputSocket(0); + NodeOutput *output = this->get_output_socket(0); float col[4]; - output->getEditorValueColor(col); - operation->setChannels(col); - converter.addOperation(operation); + output->get_editor_value_color(col); + operation->set_channels(col); + converter.add_operation(operation); - converter.mapOutputSocket(output, operation->getOutputSocket()); + converter.map_output_socket(output, operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorNode.h b/source/blender/compositor/nodes/COM_ColorNode.h index ae3bf575bb4..f5b932f6321 100644 --- a/source/blender/compositor/nodes/COM_ColorNode.h +++ b/source/blender/compositor/nodes/COM_ColorNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ColorNode : public Node { public: - ColorNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ColorNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorRampNode.cc b/source/blender/compositor/nodes/COM_ColorRampNode.cc index e4346459dd4..7ae83be65c2 100644 --- a/source/blender/compositor/nodes/COM_ColorRampNode.cc +++ b/source/blender/compositor/nodes/COM_ColorRampNode.cc @@ -22,32 +22,32 @@ namespace blender::compositor { -ColorRampNode::ColorRampNode(bNode *editorNode) : Node(editorNode) +ColorRampNode::ColorRampNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ColorRampNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ColorRampNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeOutput *outputSocket = this->getOutputSocket(0); - NodeOutput *outputSocketAlpha = this->getOutputSocket(1); - bNode *editorNode = this->getbNode(); + NodeInput *input_socket = this->get_input_socket(0); + NodeOutput *output_socket = this->get_output_socket(0); + NodeOutput *output_socket_alpha = this->get_output_socket(1); + bNode *editor_node = this->get_bnode(); ColorRampOperation *operation = new ColorRampOperation(); - operation->setColorBand((ColorBand *)editorNode->storage); - converter.addOperation(operation); + operation->set_color_band((ColorBand *)editor_node->storage); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); SeparateChannelOperation *operation2 = new SeparateChannelOperation(); - operation2->setChannel(3); - converter.addOperation(operation2); + operation2->set_channel(3); + converter.add_operation(operation2); - converter.addLink(operation->getOutputSocket(), operation2->getInputSocket(0)); - converter.mapOutputSocket(outputSocketAlpha, operation2->getOutputSocket()); + converter.add_link(operation->get_output_socket(), operation2->get_input_socket(0)); + converter.map_output_socket(output_socket_alpha, operation2->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorRampNode.h b/source/blender/compositor/nodes/COM_ColorRampNode.h index d0c0e43d56c..70e10311b2a 100644 --- a/source/blender/compositor/nodes/COM_ColorRampNode.h +++ b/source/blender/compositor/nodes/COM_ColorRampNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ColorRampNode : public Node { public: - ColorRampNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ColorRampNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorSpillNode.cc b/source/blender/compositor/nodes/COM_ColorSpillNode.cc index d0bd4eb12ea..063c515b460 100644 --- a/source/blender/compositor/nodes/COM_ColorSpillNode.cc +++ b/source/blender/compositor/nodes/COM_ColorSpillNode.cc @@ -21,30 +21,30 @@ namespace blender::compositor { -ColorSpillNode::ColorSpillNode(bNode *editorNode) : Node(editorNode) +ColorSpillNode::ColorSpillNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ColorSpillNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ColorSpillNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *editorsnode = getbNode(); + bNode *editorsnode = get_bnode(); - NodeInput *inputSocketImage = this->getInputSocket(0); - NodeInput *inputSocketFac = this->getInputSocket(1); - NodeOutput *outputSocketImage = this->getOutputSocket(0); + NodeInput *input_socket_image = this->get_input_socket(0); + NodeInput *input_socket_fac = this->get_input_socket(1); + NodeOutput *output_socket_image = this->get_output_socket(0); ColorSpillOperation *operation; operation = new ColorSpillOperation(); - operation->setSettings((NodeColorspill *)editorsnode->storage); - operation->setSpillChannel(editorsnode->custom1 - 1); /* Channel for spilling */ - operation->setSpillMethod(editorsnode->custom2); /* Channel method */ - converter.addOperation(operation); - - converter.mapInputSocket(inputSocketImage, operation->getInputSocket(0)); - converter.mapInputSocket(inputSocketFac, operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket()); + operation->set_settings((NodeColorspill *)editorsnode->storage); + operation->set_spill_channel(editorsnode->custom1 - 1); /* Channel for spilling */ + operation->set_spill_method(editorsnode->custom2); /* Channel method */ + converter.add_operation(operation); + + converter.map_input_socket(input_socket_image, operation->get_input_socket(0)); + converter.map_input_socket(input_socket_fac, operation->get_input_socket(1)); + converter.map_output_socket(output_socket_image, operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorSpillNode.h b/source/blender/compositor/nodes/COM_ColorSpillNode.h index 731a76e8811..3a9b0e665e8 100644 --- a/source/blender/compositor/nodes/COM_ColorSpillNode.h +++ b/source/blender/compositor/nodes/COM_ColorSpillNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ColorSpillNode : public Node { public: - ColorSpillNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ColorSpillNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorToBWNode.cc b/source/blender/compositor/nodes/COM_ColorToBWNode.cc index ac051ab0d55..c021ee59b9e 100644 --- a/source/blender/compositor/nodes/COM_ColorToBWNode.cc +++ b/source/blender/compositor/nodes/COM_ColorToBWNode.cc @@ -22,22 +22,22 @@ namespace blender::compositor { -ColorToBWNode::ColorToBWNode(bNode *editorNode) : Node(editorNode) +ColorToBWNode::ColorToBWNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ColorToBWNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ColorToBWNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *colorSocket = this->getInputSocket(0); - NodeOutput *valueSocket = this->getOutputSocket(0); + NodeInput *color_socket = this->get_input_socket(0); + NodeOutput *value_socket = this->get_output_socket(0); - ConvertColorToBWOperation *convertProg = new ConvertColorToBWOperation(); - converter.addOperation(convertProg); + ConvertColorToBWOperation *convert_prog = new ConvertColorToBWOperation(); + converter.add_operation(convert_prog); - converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0)); - converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0)); + converter.map_input_socket(color_socket, convert_prog->get_input_socket(0)); + converter.map_output_socket(value_socket, convert_prog->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ColorToBWNode.h b/source/blender/compositor/nodes/COM_ColorToBWNode.h index 60c08a3c886..7018f30f559 100644 --- a/source/blender/compositor/nodes/COM_ColorToBWNode.h +++ b/source/blender/compositor/nodes/COM_ColorToBWNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class ColorToBWNode : public Node { public: - ColorToBWNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ColorToBWNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_CombineColorNode.cc b/source/blender/compositor/nodes/COM_CombineColorNode.cc index dd68780dc19..a37fc6ad5fa 100644 --- a/source/blender/compositor/nodes/COM_CombineColorNode.cc +++ b/source/blender/compositor/nodes/COM_CombineColorNode.cc @@ -22,70 +22,70 @@ namespace blender::compositor { -CombineColorNode::CombineColorNode(bNode *editorNode) : Node(editorNode) +CombineColorNode::CombineColorNode(bNode *editor_node) : Node(editor_node) { } -void CombineColorNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void CombineColorNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeInput *inputRSocket = this->getInputSocket(0); - NodeInput *inputGSocket = this->getInputSocket(1); - NodeInput *inputBSocket = this->getInputSocket(2); - NodeInput *inputASocket = this->getInputSocket(3); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_rsocket = this->get_input_socket(0); + NodeInput *input_gsocket = this->get_input_socket(1); + NodeInput *input_bsocket = this->get_input_socket(2); + NodeInput *input_asocket = this->get_input_socket(3); + NodeOutput *output_socket = this->get_output_socket(0); CombineChannelsOperation *operation = new CombineChannelsOperation(); - if (inputRSocket->isLinked()) { + if (input_rsocket->is_linked()) { operation->set_canvas_input_index(0); } - else if (inputGSocket->isLinked()) { + else if (input_gsocket->is_linked()) { operation->set_canvas_input_index(1); } - else if (inputBSocket->isLinked()) { + else if (input_bsocket->is_linked()) { operation->set_canvas_input_index(2); } else { operation->set_canvas_input_index(3); } - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputRSocket, operation->getInputSocket(0)); - converter.mapInputSocket(inputGSocket, operation->getInputSocket(1)); - converter.mapInputSocket(inputBSocket, operation->getInputSocket(2)); - converter.mapInputSocket(inputASocket, operation->getInputSocket(3)); + converter.map_input_socket(input_rsocket, operation->get_input_socket(0)); + converter.map_input_socket(input_gsocket, operation->get_input_socket(1)); + converter.map_input_socket(input_bsocket, operation->get_input_socket(2)); + converter.map_input_socket(input_asocket, operation->get_input_socket(3)); - NodeOperation *color_conv = getColorConverter(context); + NodeOperation *color_conv = get_color_converter(context); if (color_conv) { - converter.addOperation(color_conv); + converter.add_operation(color_conv); - converter.addLink(operation->getOutputSocket(), color_conv->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, color_conv->getOutputSocket()); + converter.add_link(operation->get_output_socket(), color_conv->get_input_socket(0)); + converter.map_output_socket(output_socket, color_conv->get_output_socket()); } else { - converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); + converter.map_output_socket(output_socket, operation->get_output_socket()); } } -NodeOperation *CombineRGBANode::getColorConverter(const CompositorContext & /*context*/) const +NodeOperation *CombineRGBANode::get_color_converter(const CompositorContext & /*context*/) const { return nullptr; /* no conversion needed */ } -NodeOperation *CombineHSVANode::getColorConverter(const CompositorContext & /*context*/) const +NodeOperation *CombineHSVANode::get_color_converter(const CompositorContext & /*context*/) const { return new ConvertHSVToRGBOperation(); } -NodeOperation *CombineYCCANode::getColorConverter(const CompositorContext & /*context*/) const +NodeOperation *CombineYCCANode::get_color_converter(const CompositorContext & /*context*/) const { ConvertYCCToRGBOperation *operation = new ConvertYCCToRGBOperation(); - bNode *editorNode = this->getbNode(); - operation->setMode(editorNode->custom1); + bNode *editor_node = this->get_bnode(); + operation->set_mode(editor_node->custom1); return operation; } -NodeOperation *CombineYUVANode::getColorConverter(const CompositorContext & /*context*/) const +NodeOperation *CombineYUVANode::get_color_converter(const CompositorContext & /*context*/) const { return new ConvertYUVToRGBOperation(); } diff --git a/source/blender/compositor/nodes/COM_CombineColorNode.h b/source/blender/compositor/nodes/COM_CombineColorNode.h index 29d3fa37817..3252fc779f4 100644 --- a/source/blender/compositor/nodes/COM_CombineColorNode.h +++ b/source/blender/compositor/nodes/COM_CombineColorNode.h @@ -24,48 +24,48 @@ namespace blender::compositor { class CombineColorNode : public Node { public: - CombineColorNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + CombineColorNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; protected: - virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0; + virtual NodeOperation *get_color_converter(const CompositorContext &context) const = 0; }; class CombineRGBANode : public CombineColorNode { public: - CombineRGBANode(bNode *editorNode) : CombineColorNode(editorNode) + CombineRGBANode(bNode *editor_node) : CombineColorNode(editor_node) { } - NodeOperation *getColorConverter(const CompositorContext &context) const override; + NodeOperation *get_color_converter(const CompositorContext &context) const override; }; class CombineHSVANode : public CombineColorNode { public: - CombineHSVANode(bNode *editorNode) : CombineColorNode(editorNode) + CombineHSVANode(bNode *editor_node) : CombineColorNode(editor_node) { } - NodeOperation *getColorConverter(const CompositorContext &context) const override; + NodeOperation *get_color_converter(const CompositorContext &context) const override; }; class CombineYCCANode : public CombineColorNode { public: - CombineYCCANode(bNode *editorNode) : CombineColorNode(editorNode) + CombineYCCANode(bNode *editor_node) : CombineColorNode(editor_node) { } - NodeOperation *getColorConverter(const CompositorContext &context) const override; + NodeOperation *get_color_converter(const CompositorContext &context) const override; }; class CombineYUVANode : public CombineColorNode { public: - CombineYUVANode(bNode *editorNode) : CombineColorNode(editorNode) + CombineYUVANode(bNode *editor_node) : CombineColorNode(editor_node) { } - NodeOperation *getColorConverter(const CompositorContext &context) const override; + NodeOperation *get_color_converter(const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_CompositorNode.cc b/source/blender/compositor/nodes/COM_CompositorNode.cc index 10c87b8c886..5121a7cc123 100644 --- a/source/blender/compositor/nodes/COM_CompositorNode.cc +++ b/source/blender/compositor/nodes/COM_CompositorNode.cc @@ -21,44 +21,44 @@ namespace blender::compositor { -CompositorNode::CompositorNode(bNode *editorNode) : Node(editorNode) +CompositorNode::CompositorNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void CompositorNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void CompositorNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - bool is_active = (editorNode->flag & NODE_DO_OUTPUT_RECALC) || context.isRendering(); - bool ignore_alpha = (editorNode->custom2 & CMP_NODE_OUTPUT_IGNORE_ALPHA) != 0; + bNode *editor_node = this->get_bnode(); + bool is_active = (editor_node->flag & NODE_DO_OUTPUT_RECALC) || context.is_rendering(); + bool ignore_alpha = (editor_node->custom2 & CMP_NODE_OUTPUT_IGNORE_ALPHA) != 0; - NodeInput *imageSocket = this->getInputSocket(0); - NodeInput *alphaSocket = this->getInputSocket(1); - NodeInput *depthSocket = this->getInputSocket(2); + NodeInput *image_socket = this->get_input_socket(0); + NodeInput *alpha_socket = this->get_input_socket(1); + NodeInput *depth_socket = this->get_input_socket(2); - CompositorOperation *compositorOperation = new CompositorOperation(); - compositorOperation->setScene(context.getScene()); - compositorOperation->setSceneName(context.getScene()->id.name); - compositorOperation->setRenderData(context.getRenderData()); - compositorOperation->setViewName(context.getViewName()); - compositorOperation->setbNodeTree(context.getbNodeTree()); + CompositorOperation *compositor_operation = new CompositorOperation(); + compositor_operation->set_scene(context.get_scene()); + compositor_operation->set_scene_name(context.get_scene()->id.name); + compositor_operation->set_render_data(context.get_render_data()); + compositor_operation->set_view_name(context.get_view_name()); + compositor_operation->set_bnodetree(context.get_bnodetree()); /* alpha socket gives either 1 or a custom alpha value if "use alpha" is enabled */ - compositorOperation->setUseAlphaInput(ignore_alpha || alphaSocket->isLinked()); - compositorOperation->setActive(is_active); + compositor_operation->set_use_alpha_input(ignore_alpha || alpha_socket->is_linked()); + compositor_operation->set_active(is_active); - converter.addOperation(compositorOperation); - converter.mapInputSocket(imageSocket, compositorOperation->getInputSocket(0)); + converter.add_operation(compositor_operation); + converter.map_input_socket(image_socket, compositor_operation->get_input_socket(0)); /* only use alpha link if "use alpha" is enabled */ if (ignore_alpha) { - converter.addInputValue(compositorOperation->getInputSocket(1), 1.0f); + converter.add_input_value(compositor_operation->get_input_socket(1), 1.0f); } else { - converter.mapInputSocket(alphaSocket, compositorOperation->getInputSocket(1)); + converter.map_input_socket(alpha_socket, compositor_operation->get_input_socket(1)); } - converter.mapInputSocket(depthSocket, compositorOperation->getInputSocket(2)); + converter.map_input_socket(depth_socket, compositor_operation->get_input_socket(2)); - converter.addNodeInputPreview(imageSocket); + converter.add_node_input_preview(image_socket); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_CompositorNode.h b/source/blender/compositor/nodes/COM_CompositorNode.h index 4da9f9a766f..68005230ba2 100644 --- a/source/blender/compositor/nodes/COM_CompositorNode.h +++ b/source/blender/compositor/nodes/COM_CompositorNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class CompositorNode : public Node { public: - CompositorNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + CompositorNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ConvertAlphaNode.cc b/source/blender/compositor/nodes/COM_ConvertAlphaNode.cc index 649d851fe84..c2c4b989007 100644 --- a/source/blender/compositor/nodes/COM_ConvertAlphaNode.cc +++ b/source/blender/compositor/nodes/COM_ConvertAlphaNode.cc @@ -21,11 +21,11 @@ namespace blender::compositor { -void ConvertAlphaNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ConvertAlphaNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { NodeOperation *operation = nullptr; - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); /* value hardcoded in rna_nodetree.c */ if (node->custom1 == 1) { @@ -35,10 +35,10 @@ void ConvertAlphaNode::convertToOperations(NodeConverter &converter, operation = new ConvertStraightToPremulOperation(); } - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ConvertAlphaNode.h b/source/blender/compositor/nodes/COM_ConvertAlphaNode.h index f3d0ef2cd5b..8f26c82c110 100644 --- a/source/blender/compositor/nodes/COM_ConvertAlphaNode.h +++ b/source/blender/compositor/nodes/COM_ConvertAlphaNode.h @@ -28,11 +28,11 @@ namespace blender::compositor { */ class ConvertAlphaNode : public Node { public: - ConvertAlphaNode(bNode *editorNode) : Node(editorNode) + ConvertAlphaNode(bNode *editor_node) : Node(editor_node) { } - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_CornerPinNode.cc b/source/blender/compositor/nodes/COM_CornerPinNode.cc index fb188dc45f8..0f7b58db89d 100644 --- a/source/blender/compositor/nodes/COM_CornerPinNode.cc +++ b/source/blender/compositor/nodes/COM_CornerPinNode.cc @@ -21,14 +21,14 @@ namespace blender::compositor { -CornerPinNode::CornerPinNode(bNode *editorNode) : Node(editorNode) +CornerPinNode::CornerPinNode(bNode *editor_node) : Node(editor_node) { } -void CornerPinNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void CornerPinNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *input_image = this->getInputSocket(0); + NodeInput *input_image = this->get_input_socket(0); /* NOTE: socket order differs between UI node and operations: * bNode uses intuitive order following top-down layout: * upper-left, upper-right, lower-left, lower-right @@ -37,22 +37,22 @@ void CornerPinNode::convertToOperations(NodeConverter &converter, */ const int node_corner_index[4] = {3, 4, 2, 1}; - NodeOutput *output_warped_image = this->getOutputSocket(0); - NodeOutput *output_plane = this->getOutputSocket(1); + NodeOutput *output_warped_image = this->get_output_socket(0); + NodeOutput *output_plane = this->get_output_socket(1); PlaneCornerPinWarpImageOperation *warp_image_operation = new PlaneCornerPinWarpImageOperation(); - converter.addOperation(warp_image_operation); + converter.add_operation(warp_image_operation); PlaneCornerPinMaskOperation *plane_mask_operation = new PlaneCornerPinMaskOperation(); - converter.addOperation(plane_mask_operation); + converter.add_operation(plane_mask_operation); - converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0)); + converter.map_input_socket(input_image, warp_image_operation->get_input_socket(0)); for (int i = 0; i < 4; i++) { - NodeInput *corner_input = getInputSocket(node_corner_index[i]); - converter.mapInputSocket(corner_input, warp_image_operation->getInputSocket(i + 1)); - converter.mapInputSocket(corner_input, plane_mask_operation->getInputSocket(i)); + NodeInput *corner_input = get_input_socket(node_corner_index[i]); + converter.map_input_socket(corner_input, warp_image_operation->get_input_socket(i + 1)); + converter.map_input_socket(corner_input, plane_mask_operation->get_input_socket(i)); } - converter.mapOutputSocket(output_warped_image, warp_image_operation->getOutputSocket()); - converter.mapOutputSocket(output_plane, plane_mask_operation->getOutputSocket()); + converter.map_output_socket(output_warped_image, warp_image_operation->get_output_socket()); + converter.map_output_socket(output_plane, plane_mask_operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_CornerPinNode.h b/source/blender/compositor/nodes/COM_CornerPinNode.h index 779e057ebb5..a1b4d107126 100644 --- a/source/blender/compositor/nodes/COM_CornerPinNode.h +++ b/source/blender/compositor/nodes/COM_CornerPinNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class CornerPinNode : public Node { public: - CornerPinNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + CornerPinNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_CropNode.cc b/source/blender/compositor/nodes/COM_CropNode.cc index 3f01062c789..e33af232f17 100644 --- a/source/blender/compositor/nodes/COM_CropNode.cc +++ b/source/blender/compositor/nodes/COM_CropNode.cc @@ -21,31 +21,31 @@ namespace blender::compositor { -CropNode::CropNode(bNode *editorNode) : Node(editorNode) +CropNode::CropNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void CropNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void CropNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *node = getbNode(); - NodeTwoXYs *cropSettings = (NodeTwoXYs *)node->storage; + bNode *node = get_bnode(); + NodeTwoXYs *crop_settings = (NodeTwoXYs *)node->storage; bool relative = (bool)node->custom2; - bool cropImage = (bool)node->custom1; + bool crop_image = (bool)node->custom1; CropBaseOperation *operation; - if (cropImage) { + if (crop_image) { operation = new CropImageOperation(); } else { operation = new CropOperation(); } - operation->setCropSettings(cropSettings); - operation->setRelative(relative); - converter.addOperation(operation); + operation->set_crop_settings(crop_settings); + operation->set_relative(relative); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(), operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_CropNode.h b/source/blender/compositor/nodes/COM_CropNode.h index be3c9a268f9..55324bb37df 100644 --- a/source/blender/compositor/nodes/COM_CropNode.h +++ b/source/blender/compositor/nodes/COM_CropNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class CropNode : public Node { public: - CropNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + CropNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_CryptomatteNode.cc b/source/blender/compositor/nodes/COM_CryptomatteNode.cc index 21596d5aebb..f54088627e1 100644 --- a/source/blender/compositor/nodes/COM_CryptomatteNode.cc +++ b/source/blender/compositor/nodes/COM_CryptomatteNode.cc @@ -30,41 +30,41 @@ namespace blender::compositor { /** \name Cryptomatte Base * \{ */ -void CryptomatteBaseNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void CryptomatteBaseNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeOutput *output_image_socket = this->getOutputSocket(0); + NodeOutput *output_image_socket = this->get_output_socket(0); - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); NodeCryptomatte *cryptomatte_settings = static_cast<NodeCryptomatte *>(node->storage); CryptomatteOperation *cryptomatte_operation = create_cryptomatte_operation( converter, context, *node, cryptomatte_settings); - converter.addOperation(cryptomatte_operation); + converter.add_operation(cryptomatte_operation); - NodeOutput *output_matte_socket = this->getOutputSocket(1); + NodeOutput *output_matte_socket = this->get_output_socket(1); SeparateChannelOperation *extract_mask_operation = new SeparateChannelOperation; - extract_mask_operation->setChannel(3); - converter.addOperation(extract_mask_operation); - converter.addLink(cryptomatte_operation->getOutputSocket(0), - extract_mask_operation->getInputSocket(0)); - converter.mapOutputSocket(output_matte_socket, extract_mask_operation->getOutputSocket(0)); + extract_mask_operation->set_channel(3); + converter.add_operation(extract_mask_operation); + converter.add_link(cryptomatte_operation->get_output_socket(0), + extract_mask_operation->get_input_socket(0)); + converter.map_output_socket(output_matte_socket, extract_mask_operation->get_output_socket(0)); - NodeInput *input_image_socket = this->getInputSocket(0); + NodeInput *input_image_socket = this->get_input_socket(0); SetAlphaMultiplyOperation *apply_mask_operation = new SetAlphaMultiplyOperation(); - converter.mapInputSocket(input_image_socket, apply_mask_operation->getInputSocket(0)); - converter.addOperation(apply_mask_operation); - converter.addLink(extract_mask_operation->getOutputSocket(0), - apply_mask_operation->getInputSocket(1)); - converter.mapOutputSocket(output_image_socket, apply_mask_operation->getOutputSocket(0)); + converter.map_input_socket(input_image_socket, apply_mask_operation->get_input_socket(0)); + converter.add_operation(apply_mask_operation); + converter.add_link(extract_mask_operation->get_output_socket(0), + apply_mask_operation->get_input_socket(1)); + converter.map_output_socket(output_image_socket, apply_mask_operation->get_output_socket(0)); - NodeOutput *output_pick_socket = this->getOutputSocket(2); + NodeOutput *output_pick_socket = this->get_output_socket(2); SetAlphaMultiplyOperation *extract_pick_operation = new SetAlphaMultiplyOperation(); - converter.addOperation(extract_pick_operation); - converter.addInputValue(extract_pick_operation->getInputSocket(1), 1.0f); - converter.addLink(cryptomatte_operation->getOutputSocket(0), - extract_pick_operation->getInputSocket(0)); - converter.mapOutputSocket(output_pick_socket, extract_pick_operation->getOutputSocket(0)); + converter.add_operation(extract_pick_operation); + converter.add_input_value(extract_pick_operation->get_input_socket(1), 1.0f); + converter.add_link(cryptomatte_operation->get_output_socket(0), + extract_pick_operation->get_input_socket(0)); + converter.map_output_socket(output_pick_socket, extract_pick_operation->get_output_socket(0)); } /** \} */ @@ -76,7 +76,7 @@ void CryptomatteBaseNode::convertToOperations(NodeConverter &converter, static std::string prefix_from_node(const CompositorContext &context, const bNode &node) { char prefix[MAX_NAME]; - ntreeCompositCryptomatteLayerPrefix(context.getScene(), &node, prefix, sizeof(prefix)); + ntreeCompositCryptomatteLayerPrefix(context.get_scene(), &node, prefix, sizeof(prefix)); return std::string(prefix, BLI_strnlen(prefix, sizeof(prefix))); } @@ -120,7 +120,7 @@ void CryptomatteNode::input_operations_from_render_source( RenderLayer *render_layer = RE_GetRenderLayer(render_result, view_layer->name); if (render_layer) { LISTBASE_FOREACH (RenderPass *, render_pass, &render_layer->passes) { - if (context.has_explicit_view() && !STREQ(render_pass->view, context.getViewName())) { + if (context.has_explicit_view() && !STREQ(render_pass->view, context.get_view_name())) { continue; } @@ -128,10 +128,10 @@ void CryptomatteNode::input_operations_from_render_source( if (blender::StringRef(combined_name).startswith(prefix)) { RenderLayersProg *op = new RenderLayersProg( render_pass->name, DataType::Color, render_pass->channels); - op->setScene(scene); - op->setLayerId(view_layer_id); - op->setRenderData(context.getRenderData()); - op->setViewName(context.getViewName()); + op->set_scene(scene); + op->set_layer_id(view_layer_id); + op->set_render_data(context.get_render_data()); + op->set_view_name(context.get_view_name()); r_input_operations.append(op); } } @@ -157,7 +157,7 @@ void CryptomatteNode::input_operations_from_image_source( } ImageUser *iuser = &cryptomatte_settings->iuser; - BKE_image_user_frame_calc(image, iuser, context.getFramenumber()); + BKE_image_user_frame_calc(image, iuser, context.get_framenumber()); ImBuf *ibuf = BKE_image_acquire_ibuf(image, iuser, nullptr); if (image->rr) { @@ -167,7 +167,7 @@ void CryptomatteNode::input_operations_from_image_source( /* Heuristic to match image name with scene names, check if the view name exists in the * image. */ view = BLI_findstringindex( - &image->rr->views, context.getViewName(), offsetof(RenderView, name)); + &image->rr->views, context.get_view_name(), offsetof(RenderView, name)); if (view == -1) { view = 0; } @@ -189,10 +189,10 @@ void CryptomatteNode::input_operations_from_image_source( if (blender::StringRef(combined_name).startswith(prefix)) { MultilayerColorOperation *op = new MultilayerColorOperation( render_layer, render_pass, view); - op->setImage(image); - op->setImageUser(iuser); + op->set_image(image); + op->set_image_user(iuser); iuser->layer = layer_index; - op->setFramenumber(context.getFramenumber()); + op->set_framenumber(context.get_framenumber()); r_input_operations.append(op); } } @@ -217,10 +217,10 @@ Vector<NodeOperation *> CryptomatteNode::create_input_operations(const Composito if (input_operations.is_empty()) { SetColorOperation *op = new SetColorOperation(); - op->setChannel1(0.0f); - op->setChannel2(1.0f); - op->setChannel3(0.0f); - op->setChannel4(0.0f); + op->set_channel1(0.0f); + op->set_channel2(1.0f); + op->set_channel3(0.0f); + op->set_channel4(0.0f); input_operations.append(op); } return input_operations; @@ -234,11 +234,11 @@ CryptomatteOperation *CryptomatteNode::create_cryptomatte_operation( Vector<NodeOperation *> input_operations = create_input_operations(context, node); CryptomatteOperation *operation = new CryptomatteOperation(input_operations.size()); LISTBASE_FOREACH (CryptomatteEntry *, cryptomatte_entry, &cryptomatte_settings->entries) { - operation->addObjectIndex(cryptomatte_entry->encoded_hash); + operation->add_object_index(cryptomatte_entry->encoded_hash); } for (int i = 0; i < input_operations.size(); ++i) { - converter.addOperation(input_operations[i]); - converter.addLink(input_operations[i]->getOutputSocket(), operation->getInputSocket(i)); + converter.add_operation(input_operations[i]); + converter.add_link(input_operations[i]->get_output_socket(), operation->get_input_socket(i)); } return operation; } @@ -259,12 +259,12 @@ CryptomatteOperation *CryptomatteLegacyNode::create_cryptomatte_operation( CryptomatteOperation *operation = new CryptomatteOperation(num_inputs); if (cryptomatte_settings) { LISTBASE_FOREACH (CryptomatteEntry *, cryptomatte_entry, &cryptomatte_settings->entries) { - operation->addObjectIndex(cryptomatte_entry->encoded_hash); + operation->add_object_index(cryptomatte_entry->encoded_hash); } } for (int i = 0; i < num_inputs; i++) { - converter.mapInputSocket(this->getInputSocket(i + 1), operation->getInputSocket(i)); + converter.map_input_socket(this->get_input_socket(i + 1), operation->get_input_socket(i)); } return operation; diff --git a/source/blender/compositor/nodes/COM_CryptomatteNode.h b/source/blender/compositor/nodes/COM_CryptomatteNode.h index eacb49e2033..7ca1084886b 100644 --- a/source/blender/compositor/nodes/COM_CryptomatteNode.h +++ b/source/blender/compositor/nodes/COM_CryptomatteNode.h @@ -38,8 +38,8 @@ class CryptomatteBaseNode : public Node { } public: - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; protected: virtual CryptomatteOperation *create_cryptomatte_operation( diff --git a/source/blender/compositor/nodes/COM_DefocusNode.cc b/source/blender/compositor/nodes/COM_DefocusNode.cc index 6f1361df284..684f9014c3c 100644 --- a/source/blender/compositor/nodes/COM_DefocusNode.cc +++ b/source/blender/compositor/nodes/COM_DefocusNode.cc @@ -26,58 +26,58 @@ namespace blender::compositor { -DefocusNode::DefocusNode(bNode *editorNode) : Node(editorNode) +DefocusNode::DefocusNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void DefocusNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void DefocusNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); NodeDefocus *data = (NodeDefocus *)node->storage; - Scene *scene = node->id ? (Scene *)node->id : context.getScene(); + Scene *scene = node->id ? (Scene *)node->id : context.get_scene(); Object *camob = scene ? scene->camera : nullptr; - NodeOperation *radiusOperation; + NodeOperation *radius_operation; if (data->no_zbuf) { MathMultiplyOperation *multiply = new MathMultiplyOperation(); SetValueOperation *multiplier = new SetValueOperation(); - multiplier->setValue(data->scale); - SetValueOperation *maxRadius = new SetValueOperation(); - maxRadius->setValue(data->maxblur); + multiplier->set_value(data->scale); + SetValueOperation *max_radius = new SetValueOperation(); + max_radius->set_value(data->maxblur); MathMinimumOperation *minimize = new MathMinimumOperation(); - converter.addOperation(multiply); - converter.addOperation(multiplier); - converter.addOperation(maxRadius); - converter.addOperation(minimize); + converter.add_operation(multiply); + converter.add_operation(multiplier); + converter.add_operation(max_radius); + converter.add_operation(minimize); - converter.mapInputSocket(getInputSocket(1), multiply->getInputSocket(0)); - converter.addLink(multiplier->getOutputSocket(), multiply->getInputSocket(1)); - converter.addLink(multiply->getOutputSocket(), minimize->getInputSocket(0)); - converter.addLink(maxRadius->getOutputSocket(), minimize->getInputSocket(1)); + converter.map_input_socket(get_input_socket(1), multiply->get_input_socket(0)); + converter.add_link(multiplier->get_output_socket(), multiply->get_input_socket(1)); + converter.add_link(multiply->get_output_socket(), minimize->get_input_socket(0)); + converter.add_link(max_radius->get_output_socket(), minimize->get_input_socket(1)); - radiusOperation = minimize; + radius_operation = minimize; } else { ConvertDepthToRadiusOperation *radius_op = new ConvertDepthToRadiusOperation(); - radius_op->setCameraObject(camob); - radius_op->setfStop(data->fstop); - radius_op->setMaxRadius(data->maxblur); - converter.addOperation(radius_op); + radius_op->set_camera_object(camob); + radius_op->setf_stop(data->fstop); + radius_op->set_max_radius(data->maxblur); + converter.add_operation(radius_op); - converter.mapInputSocket(getInputSocket(1), radius_op->getInputSocket(0)); + converter.map_input_socket(get_input_socket(1), radius_op->get_input_socket(0)); FastGaussianBlurValueOperation *blur = new FastGaussianBlurValueOperation(); /* maintain close pixels so far Z values don't bleed into the foreground */ - blur->setOverlay(FAST_GAUSS_OVERLAY_MIN); - converter.addOperation(blur); + blur->set_overlay(FAST_GAUSS_OVERLAY_MIN); + converter.add_operation(blur); - converter.addLink(radius_op->getOutputSocket(0), blur->getInputSocket(0)); - radius_op->setPostBlur(blur); + converter.add_link(radius_op->get_output_socket(0), blur->get_input_socket(0)); + radius_op->set_post_blur(blur); - radiusOperation = blur; + radius_operation = blur; } NodeBokehImage *bokehdata = new NodeBokehImage(); @@ -92,49 +92,49 @@ void DefocusNode::convertToOperations(NodeConverter &converter, bokehdata->lensshift = 0.0f; BokehImageOperation *bokeh = new BokehImageOperation(); - bokeh->setData(bokehdata); - bokeh->deleteDataOnFinish(); - converter.addOperation(bokeh); + bokeh->set_data(bokehdata); + bokeh->delete_data_on_finish(); + converter.add_operation(bokeh); #ifdef COM_DEFOCUS_SEARCH InverseSearchRadiusOperation *search = new InverseSearchRadiusOperation(); - search->setMaxBlur(data->maxblur); - converter.addOperation(search); + search->set_max_blur(data->maxblur); + converter.add_operation(search); - converter.addLink(radiusOperation->getOutputSocket(0), search->getInputSocket(0)); + converter.add_link(radius_operation->get_output_socket(0), search->get_input_socket(0)); #endif VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation(); if (data->preview) { - operation->setQuality(eCompositorQuality::Low); + operation->set_quality(eCompositorQuality::Low); } else { - operation->setQuality(context.getQuality()); + operation->set_quality(context.get_quality()); } - operation->setMaxBlur(data->maxblur); - operation->setThreshold(data->bthresh); - converter.addOperation(operation); + operation->set_max_blur(data->maxblur); + operation->set_threshold(data->bthresh); + converter.add_operation(operation); - converter.addLink(bokeh->getOutputSocket(), operation->getInputSocket(1)); - converter.addLink(radiusOperation->getOutputSocket(), operation->getInputSocket(2)); + converter.add_link(bokeh->get_output_socket(), operation->get_input_socket(1)); + converter.add_link(radius_operation->get_output_socket(), operation->get_input_socket(2)); #ifdef COM_DEFOCUS_SEARCH - converter.addLink(search->getOutputSocket(), operation->getInputSocket(3)); + converter.add_link(search->get_output_socket(), operation->get_input_socket(3)); #endif if (data->gamco) { GammaCorrectOperation *correct = new GammaCorrectOperation(); - converter.addOperation(correct); + converter.add_operation(correct); GammaUncorrectOperation *inverse = new GammaUncorrectOperation(); - converter.addOperation(inverse); + converter.add_operation(inverse); - converter.mapInputSocket(getInputSocket(0), correct->getInputSocket(0)); - converter.addLink(correct->getOutputSocket(), operation->getInputSocket(0)); - converter.addLink(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(), operation->get_input_socket(0)); + converter.add_link(operation->get_output_socket(), inverse->get_input_socket(0)); + converter.map_output_socket(get_output_socket(), inverse->get_output_socket()); } else { - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(), operation->get_output_socket()); } } diff --git a/source/blender/compositor/nodes/COM_DefocusNode.h b/source/blender/compositor/nodes/COM_DefocusNode.h index 5e51a0ccd52..58993495bee 100644 --- a/source/blender/compositor/nodes/COM_DefocusNode.h +++ b/source/blender/compositor/nodes/COM_DefocusNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class DefocusNode : public Node { public: - DefocusNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + DefocusNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DenoiseNode.cc b/source/blender/compositor/nodes/COM_DenoiseNode.cc index e576966626c..2ff8870f716 100644 --- a/source/blender/compositor/nodes/COM_DenoiseNode.cc +++ b/source/blender/compositor/nodes/COM_DenoiseNode.cc @@ -20,51 +20,51 @@ namespace blender::compositor { -DenoiseNode::DenoiseNode(bNode *editorNode) : Node(editorNode) +DenoiseNode::DenoiseNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void DenoiseNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void DenoiseNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { if (!COM_is_denoise_supported()) { - converter.mapOutputSocket(getOutputSocket(0), - converter.addInputProxy(getInputSocket(0), false)); + converter.map_output_socket(get_output_socket(0), + converter.add_input_proxy(get_input_socket(0), false)); return; } - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); NodeDenoise *denoise = (NodeDenoise *)node->storage; DenoiseOperation *operation = new DenoiseOperation(); - converter.addOperation(operation); - operation->setDenoiseSettings(denoise); + converter.add_operation(operation); + operation->set_denoise_settings(denoise); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); if (denoise && denoise->prefilter == CMP_NODE_DENOISE_PREFILTER_ACCURATE) { { DenoisePrefilterOperation *normal_prefilter = new DenoisePrefilterOperation( DataType::Vector); normal_prefilter->set_image_name("normal"); - converter.addOperation(normal_prefilter); - converter.mapInputSocket(getInputSocket(1), normal_prefilter->getInputSocket(0)); - converter.addLink(normal_prefilter->getOutputSocket(), operation->getInputSocket(1)); + converter.add_operation(normal_prefilter); + converter.map_input_socket(get_input_socket(1), normal_prefilter->get_input_socket(0)); + converter.add_link(normal_prefilter->get_output_socket(), operation->get_input_socket(1)); } { DenoisePrefilterOperation *albedo_prefilter = new DenoisePrefilterOperation(DataType::Color); albedo_prefilter->set_image_name("albedo"); - converter.addOperation(albedo_prefilter); - converter.mapInputSocket(getInputSocket(2), albedo_prefilter->getInputSocket(0)); - converter.addLink(albedo_prefilter->getOutputSocket(), operation->getInputSocket(2)); + converter.add_operation(albedo_prefilter); + converter.map_input_socket(get_input_socket(2), albedo_prefilter->get_input_socket(0)); + converter.add_link(albedo_prefilter->get_output_socket(), operation->get_input_socket(2)); } } else { - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2)); } - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DenoiseNode.h b/source/blender/compositor/nodes/COM_DenoiseNode.h index 91be8e3e3ad..7e18c22c1e9 100644 --- a/source/blender/compositor/nodes/COM_DenoiseNode.h +++ b/source/blender/compositor/nodes/COM_DenoiseNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class DenoiseNode : public Node { public: - DenoiseNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + DenoiseNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DespeckleNode.cc b/source/blender/compositor/nodes/COM_DespeckleNode.cc index 1a068112210..12c9d50f214 100644 --- a/source/blender/compositor/nodes/COM_DespeckleNode.cc +++ b/source/blender/compositor/nodes/COM_DespeckleNode.cc @@ -21,29 +21,29 @@ namespace blender::compositor { -DespeckleNode::DespeckleNode(bNode *editorNode) : Node(editorNode) +DespeckleNode::DespeckleNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void DespeckleNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void DespeckleNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *editorNode = this->getbNode(); - NodeInput *inputSocket = this->getInputSocket(0); - NodeInput *inputImageSocket = this->getInputSocket(1); - NodeOutput *outputSocket = this->getOutputSocket(0); + bNode *editor_node = this->get_bnode(); + NodeInput *input_socket = this->get_input_socket(0); + NodeInput *input_image_socket = this->get_input_socket(1); + NodeOutput *output_socket = this->get_output_socket(0); DespeckleOperation *operation = new DespeckleOperation(); - operation->setThreshold(editorNode->custom3); - operation->setThresholdNeighbor(editorNode->custom4); - converter.addOperation(operation); + operation->set_threshold(editor_node->custom3); + operation->set_threshold_neighbor(editor_node->custom4); + converter.add_operation(operation); - converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0)); - converter.mapInputSocket(inputSocket, operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); + converter.map_input_socket(input_image_socket, operation->get_input_socket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(1)); + converter.map_output_socket(output_socket, operation->get_output_socket()); - converter.addPreview(operation->getOutputSocket(0)); + converter.add_preview(operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DespeckleNode.h b/source/blender/compositor/nodes/COM_DespeckleNode.h index 2f268e99e1b..2c3af600aed 100644 --- a/source/blender/compositor/nodes/COM_DespeckleNode.h +++ b/source/blender/compositor/nodes/COM_DespeckleNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class DespeckleNode : public Node { public: - DespeckleNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + DespeckleNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DifferenceMatteNode.cc b/source/blender/compositor/nodes/COM_DifferenceMatteNode.cc index 9700b761eca..ceb5be7bd08 100644 --- a/source/blender/compositor/nodes/COM_DifferenceMatteNode.cc +++ b/source/blender/compositor/nodes/COM_DifferenceMatteNode.cc @@ -22,36 +22,36 @@ namespace blender::compositor { -DifferenceMatteNode::DifferenceMatteNode(bNode *editorNode) : Node(editorNode) +DifferenceMatteNode::DifferenceMatteNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void DifferenceMatteNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void DifferenceMatteNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeInput *inputSocket2 = this->getInputSocket(1); - NodeOutput *outputSocketImage = this->getOutputSocket(0); - NodeOutput *outputSocketMatte = this->getOutputSocket(1); - bNode *editorNode = this->getbNode(); + NodeInput *input_socket = this->get_input_socket(0); + NodeInput *input_socket2 = this->get_input_socket(1); + NodeOutput *output_socket_image = this->get_output_socket(0); + NodeOutput *output_socket_matte = this->get_output_socket(1); + bNode *editor_node = this->get_bnode(); - DifferenceMatteOperation *operationSet = new DifferenceMatteOperation(); - operationSet->setSettings((NodeChroma *)editorNode->storage); - converter.addOperation(operationSet); + DifferenceMatteOperation *operation_set = new DifferenceMatteOperation(); + operation_set->set_settings((NodeChroma *)editor_node->storage); + converter.add_operation(operation_set); - converter.mapInputSocket(inputSocket, operationSet->getInputSocket(0)); - converter.mapInputSocket(inputSocket2, operationSet->getInputSocket(1)); - converter.mapOutputSocket(outputSocketMatte, operationSet->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation_set->get_input_socket(0)); + converter.map_input_socket(input_socket2, operation_set->get_input_socket(1)); + converter.map_output_socket(output_socket_matte, operation_set->get_output_socket(0)); SetAlphaMultiplyOperation *operation = new SetAlphaMultiplyOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket()); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.add_link(operation_set->get_output_socket(), operation->get_input_socket(1)); + converter.map_output_socket(output_socket_image, operation->get_output_socket()); - converter.addPreview(operation->getOutputSocket()); + converter.add_preview(operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DifferenceMatteNode.h b/source/blender/compositor/nodes/COM_DifferenceMatteNode.h index a173c723192..f99d4022507 100644 --- a/source/blender/compositor/nodes/COM_DifferenceMatteNode.h +++ b/source/blender/compositor/nodes/COM_DifferenceMatteNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class DifferenceMatteNode : public Node { public: - DifferenceMatteNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + DifferenceMatteNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cc b/source/blender/compositor/nodes/COM_DilateErodeNode.cc index ea7ce396189..b121fcb3724 100644 --- a/source/blender/compositor/nodes/COM_DilateErodeNode.cc +++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cc @@ -24,126 +24,126 @@ namespace blender::compositor { -DilateErodeNode::DilateErodeNode(bNode *editorNode) : Node(editorNode) +DilateErodeNode::DilateErodeNode(bNode *editor_node) : Node(editor_node) { /* initialize node data */ NodeBlurData *data = &alpha_blur_; memset(data, 0, sizeof(NodeBlurData)); data->filtertype = R_FILTER_GAUSS; - if (editorNode->custom2 > 0) { - data->sizex = data->sizey = editorNode->custom2; + if (editor_node->custom2 > 0) { + data->sizex = data->sizey = editor_node->custom2; } else { - data->sizex = data->sizey = -editorNode->custom2; + data->sizex = data->sizey = -editor_node->custom2; } } -void DilateErodeNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void DilateErodeNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) { + bNode *editor_node = this->get_bnode(); + if (editor_node->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) { DilateErodeThresholdOperation *operation = new DilateErodeThresholdOperation(); - operation->setDistance(editorNode->custom2); - operation->setInset(editorNode->custom3); - converter.addOperation(operation); + operation->set_distance(editor_node->custom2); + operation->set_inset(editor_node->custom3); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); - if (editorNode->custom3 < 2.0f) { - AntiAliasOperation *antiAlias = new AntiAliasOperation(); - converter.addOperation(antiAlias); + if (editor_node->custom3 < 2.0f) { + AntiAliasOperation *anti_alias = new AntiAliasOperation(); + converter.add_operation(anti_alias); - converter.addLink(operation->getOutputSocket(), antiAlias->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), antiAlias->getOutputSocket(0)); + converter.add_link(operation->get_output_socket(), anti_alias->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), anti_alias->get_output_socket(0)); } else { - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } - else if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) { - if (editorNode->custom2 > 0) { + else if (editor_node->custom1 == CMP_NODE_DILATEERODE_DISTANCE) { + if (editor_node->custom2 > 0) { DilateDistanceOperation *operation = new DilateDistanceOperation(); - operation->setDistance(editorNode->custom2); - converter.addOperation(operation); + operation->set_distance(editor_node->custom2); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } else { ErodeDistanceOperation *operation = new ErodeDistanceOperation(); - operation->setDistance(-editorNode->custom2); - converter.addOperation(operation); + operation->set_distance(-editor_node->custom2); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } - else if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_FEATHER) { + else if (editor_node->custom1 == CMP_NODE_DILATEERODE_DISTANCE_FEATHER) { /* this uses a modified gaussian blur function otherwise its far too slow */ - eCompositorQuality quality = context.getQuality(); + eCompositorQuality quality = context.get_quality(); GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation(); - operationx->setData(&alpha_blur_); - operationx->setQuality(quality); - operationx->setFalloff(PROP_SMOOTH); - converter.addOperation(operationx); + operationx->set_data(&alpha_blur_); + operationx->set_quality(quality); + operationx->set_falloff(PROP_SMOOTH); + converter.add_operation(operationx); - converter.mapInputSocket(getInputSocket(0), operationx->getInputSocket(0)); - // converter.mapInputSocket(getInputSocket(1), operationx->getInputSocket(1)); // no size input - // yet + converter.map_input_socket(get_input_socket(0), operationx->get_input_socket(0)); + // converter.map_input_socket(get_input_socket(1), operationx->get_input_socket(1)); // no size + // input yet GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation(); - operationy->setData(&alpha_blur_); - operationy->setQuality(quality); - operationy->setFalloff(PROP_SMOOTH); - converter.addOperation(operationy); + operationy->set_data(&alpha_blur_); + operationy->set_quality(quality); + operationy->set_falloff(PROP_SMOOTH); + converter.add_operation(operationy); - converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0)); - // converter.mapInputSocket(getInputSocket(1), operationy->getInputSocket(1)); // no size input - // yet - converter.mapOutputSocket(getOutputSocket(0), operationy->getOutputSocket()); + converter.add_link(operationx->get_output_socket(), operationy->get_input_socket(0)); + // converter.map_input_socket(get_input_socket(1), operationy->get_input_socket(1)); // no size + // input yet + converter.map_output_socket(get_output_socket(0), operationy->get_output_socket()); - converter.addPreview(operationy->getOutputSocket()); + converter.add_preview(operationy->get_output_socket()); /* TODO? */ /* see gaussian blue node for original usage */ #if 0 - if (!connectedSizeSocket) { - operationx->setSize(size); - operationy->setSize(size); + if (!connected_size_socket) { + operationx->set_size(size); + operationy->set_size(size); } #else - operationx->setSize(1.0f); - operationy->setSize(1.0f); + operationx->set_size(1.0f); + operationy->set_size(1.0f); #endif - operationx->setSubtract(editorNode->custom2 < 0); - operationy->setSubtract(editorNode->custom2 < 0); + operationx->set_subtract(editor_node->custom2 < 0); + operationy->set_subtract(editor_node->custom2 < 0); - if (editorNode->storage) { - NodeDilateErode *data_storage = (NodeDilateErode *)editorNode->storage; - operationx->setFalloff(data_storage->falloff); - operationy->setFalloff(data_storage->falloff); + if (editor_node->storage) { + NodeDilateErode *data_storage = (NodeDilateErode *)editor_node->storage; + operationx->set_falloff(data_storage->falloff); + operationy->set_falloff(data_storage->falloff); } } else { - if (editorNode->custom2 > 0) { + if (editor_node->custom2 > 0) { DilateStepOperation *operation = new DilateStepOperation(); - operation->setIterations(editorNode->custom2); - converter.addOperation(operation); + operation->set_iterations(editor_node->custom2); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } else { ErodeStepOperation *operation = new ErodeStepOperation(); - operation->setIterations(-editorNode->custom2); - converter.addOperation(operation); + operation->set_iterations(-editor_node->custom2); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } } diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.h b/source/blender/compositor/nodes/COM_DilateErodeNode.h index 2a635a8b0a6..df6abe7a6b6 100644 --- a/source/blender/compositor/nodes/COM_DilateErodeNode.h +++ b/source/blender/compositor/nodes/COM_DilateErodeNode.h @@ -31,9 +31,9 @@ class DilateErodeNode : public Node { NodeBlurData alpha_blur_; public: - DilateErodeNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + DilateErodeNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DirectionalBlurNode.cc b/source/blender/compositor/nodes/COM_DirectionalBlurNode.cc index dce2a1a7911..b8e3e44f41f 100644 --- a/source/blender/compositor/nodes/COM_DirectionalBlurNode.cc +++ b/source/blender/compositor/nodes/COM_DirectionalBlurNode.cc @@ -21,22 +21,22 @@ namespace blender::compositor { -DirectionalBlurNode::DirectionalBlurNode(bNode *editorNode) : Node(editorNode) +DirectionalBlurNode::DirectionalBlurNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void DirectionalBlurNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void DirectionalBlurNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeDBlurData *data = (NodeDBlurData *)this->getbNode()->storage; + NodeDBlurData *data = (NodeDBlurData *)this->get_bnode()->storage; DirectionalBlurOperation *operation = new DirectionalBlurOperation(); - operation->setQuality(context.getQuality()); - operation->setData(data); - converter.addOperation(operation); + operation->set_quality(context.get_quality()); + operation->set_data(data); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DirectionalBlurNode.h b/source/blender/compositor/nodes/COM_DirectionalBlurNode.h index ce3ef378aaf..96a5122d134 100644 --- a/source/blender/compositor/nodes/COM_DirectionalBlurNode.h +++ b/source/blender/compositor/nodes/COM_DirectionalBlurNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class DirectionalBlurNode : public Node { public: - DirectionalBlurNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + DirectionalBlurNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DisplaceNode.cc b/source/blender/compositor/nodes/COM_DisplaceNode.cc index d13c0c347fb..06208fb7d89 100644 --- a/source/blender/compositor/nodes/COM_DisplaceNode.cc +++ b/source/blender/compositor/nodes/COM_DisplaceNode.cc @@ -22,28 +22,28 @@ namespace blender::compositor { -DisplaceNode::DisplaceNode(bNode *editorNode) : Node(editorNode) +DisplaceNode::DisplaceNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void DisplaceNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void DisplaceNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { NodeOperation *operation; - if (context.getQuality() == eCompositorQuality::Low) { + if (context.get_quality() == eCompositorQuality::Low) { operation = new DisplaceSimpleOperation(); } else { operation = new DisplaceOperation(); } - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); - converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(3)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2)); + converter.map_input_socket(get_input_socket(3), operation->get_input_socket(3)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DisplaceNode.h b/source/blender/compositor/nodes/COM_DisplaceNode.h index b2495839da3..394624e8f60 100644 --- a/source/blender/compositor/nodes/COM_DisplaceNode.h +++ b/source/blender/compositor/nodes/COM_DisplaceNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class DisplaceNode : public Node { public: - DisplaceNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + DisplaceNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DistanceMatteNode.cc b/source/blender/compositor/nodes/COM_DistanceMatteNode.cc index 26886a6580f..db78e60fbbe 100644 --- a/source/blender/compositor/nodes/COM_DistanceMatteNode.cc +++ b/source/blender/compositor/nodes/COM_DistanceMatteNode.cc @@ -23,77 +23,78 @@ namespace blender::compositor { -DistanceMatteNode::DistanceMatteNode(bNode *editorNode) : Node(editorNode) +DistanceMatteNode::DistanceMatteNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void DistanceMatteNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void DistanceMatteNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *editorsnode = getbNode(); + bNode *editorsnode = get_bnode(); NodeChroma *storage = (NodeChroma *)editorsnode->storage; - NodeInput *inputSocketImage = this->getInputSocket(0); - NodeInput *inputSocketKey = this->getInputSocket(1); - NodeOutput *outputSocketImage = this->getOutputSocket(0); - NodeOutput *outputSocketMatte = this->getOutputSocket(1); + NodeInput *input_socket_image = this->get_input_socket(0); + NodeInput *input_socket_key = this->get_input_socket(1); + NodeOutput *output_socket_image = this->get_output_socket(0); + NodeOutput *output_socket_matte = this->get_output_socket(1); - SetAlphaMultiplyOperation *operationAlpha = new SetAlphaMultiplyOperation(); - converter.addOperation(operationAlpha); + SetAlphaMultiplyOperation *operation_alpha = new SetAlphaMultiplyOperation(); + converter.add_operation(operation_alpha); /* work in RGB color space */ NodeOperation *operation; if (storage->channel == 1) { DistanceRGBMatteOperation *matte = new DistanceRGBMatteOperation(); - matte->setSettings(storage); - converter.addOperation(matte); + matte->set_settings(storage); + converter.add_operation(matte); - converter.mapInputSocket(inputSocketImage, matte->getInputSocket(0)); - converter.mapInputSocket(inputSocketImage, operationAlpha->getInputSocket(0)); + converter.map_input_socket(input_socket_image, matte->get_input_socket(0)); + converter.map_input_socket(input_socket_image, operation_alpha->get_input_socket(0)); - converter.mapInputSocket(inputSocketKey, matte->getInputSocket(1)); + converter.map_input_socket(input_socket_key, matte->get_input_socket(1)); operation = matte; } /* work in YCbCr color space */ else { DistanceYCCMatteOperation *matte = new DistanceYCCMatteOperation(); - matte->setSettings(storage); - converter.addOperation(matte); + matte->set_settings(storage); + converter.add_operation(matte); - ConvertRGBToYCCOperation *operationYCCImage = new ConvertRGBToYCCOperation(); - ConvertRGBToYCCOperation *operationYCCMatte = new ConvertRGBToYCCOperation(); - operationYCCImage->setMode(BLI_YCC_ITU_BT709); - operationYCCMatte->setMode(BLI_YCC_ITU_BT709); - converter.addOperation(operationYCCImage); - converter.addOperation(operationYCCMatte); + ConvertRGBToYCCOperation *operation_yccimage = new ConvertRGBToYCCOperation(); + ConvertRGBToYCCOperation *operation_yccmatte = new ConvertRGBToYCCOperation(); + operation_yccimage->set_mode(BLI_YCC_ITU_BT709); + operation_yccmatte->set_mode(BLI_YCC_ITU_BT709); + converter.add_operation(operation_yccimage); + converter.add_operation(operation_yccmatte); - converter.mapInputSocket(inputSocketImage, operationYCCImage->getInputSocket(0)); - converter.addLink(operationYCCImage->getOutputSocket(), matte->getInputSocket(0)); - converter.addLink(operationYCCImage->getOutputSocket(), operationAlpha->getInputSocket(0)); + converter.map_input_socket(input_socket_image, operation_yccimage->get_input_socket(0)); + converter.add_link(operation_yccimage->get_output_socket(), matte->get_input_socket(0)); + converter.add_link(operation_yccimage->get_output_socket(), + operation_alpha->get_input_socket(0)); - converter.mapInputSocket(inputSocketKey, operationYCCMatte->getInputSocket(0)); - converter.addLink(operationYCCMatte->getOutputSocket(), matte->getInputSocket(1)); + converter.map_input_socket(input_socket_key, operation_yccmatte->get_input_socket(0)); + converter.add_link(operation_yccmatte->get_output_socket(), matte->get_input_socket(1)); operation = matte; } - converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0)); - converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1)); + converter.map_output_socket(output_socket_matte, operation->get_output_socket(0)); + converter.add_link(operation->get_output_socket(), operation_alpha->get_input_socket(1)); if (storage->channel != 1) { ConvertYCCToRGBOperation *inv_convert = new ConvertYCCToRGBOperation(); - inv_convert->setMode(BLI_YCC_ITU_BT709); + inv_convert->set_mode(BLI_YCC_ITU_BT709); - converter.addOperation(inv_convert); - converter.addLink(operationAlpha->getOutputSocket(0), inv_convert->getInputSocket(0)); - converter.mapOutputSocket(outputSocketImage, inv_convert->getOutputSocket()); - converter.addPreview(inv_convert->getOutputSocket()); + converter.add_operation(inv_convert); + converter.add_link(operation_alpha->get_output_socket(0), inv_convert->get_input_socket(0)); + converter.map_output_socket(output_socket_image, inv_convert->get_output_socket()); + converter.add_preview(inv_convert->get_output_socket()); } else { - converter.mapOutputSocket(outputSocketImage, operationAlpha->getOutputSocket()); - converter.addPreview(operationAlpha->getOutputSocket()); + converter.map_output_socket(output_socket_image, operation_alpha->get_output_socket()); + converter.add_preview(operation_alpha->get_output_socket()); } } diff --git a/source/blender/compositor/nodes/COM_DistanceMatteNode.h b/source/blender/compositor/nodes/COM_DistanceMatteNode.h index 0baa531b4d2..d12e69d8065 100644 --- a/source/blender/compositor/nodes/COM_DistanceMatteNode.h +++ b/source/blender/compositor/nodes/COM_DistanceMatteNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class DistanceMatteNode : public Node { public: - DistanceMatteNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + DistanceMatteNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cc b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cc index 273f0ee7026..b88348ccc60 100644 --- a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cc +++ b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cc @@ -21,25 +21,25 @@ namespace blender::compositor { -DoubleEdgeMaskNode::DoubleEdgeMaskNode(bNode *editorNode) : Node(editorNode) +DoubleEdgeMaskNode::DoubleEdgeMaskNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void DoubleEdgeMaskNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void DoubleEdgeMaskNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { DoubleEdgeMaskOperation *operation; - bNode *bnode = this->getbNode(); + bNode *bnode = this->get_bnode(); operation = new DoubleEdgeMaskOperation(); - operation->setAdjecentOnly(bnode->custom1); - operation->setKeepInside(bnode->custom2); - converter.addOperation(operation); + operation->set_adjecent_only(bnode->custom1); + operation->set_keep_inside(bnode->custom2); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h index 90e009747c1..99b3b1d0546 100644 --- a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h +++ b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class DoubleEdgeMaskNode : public Node { public: - DoubleEdgeMaskNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + DoubleEdgeMaskNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_EllipseMaskNode.cc b/source/blender/compositor/nodes/COM_EllipseMaskNode.cc index 4f3703dceb1..1f6e2ab2a6c 100644 --- a/source/blender/compositor/nodes/COM_EllipseMaskNode.cc +++ b/source/blender/compositor/nodes/COM_EllipseMaskNode.cc @@ -24,52 +24,53 @@ namespace blender::compositor { -EllipseMaskNode::EllipseMaskNode(bNode *editorNode) : Node(editorNode) +EllipseMaskNode::EllipseMaskNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void EllipseMaskNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void EllipseMaskNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_socket = this->get_input_socket(0); + NodeOutput *output_socket = this->get_output_socket(0); EllipseMaskOperation *operation; operation = new EllipseMaskOperation(); - operation->setData((NodeEllipseMask *)this->getbNode()->storage); - operation->setMaskType(this->getbNode()->custom1); - converter.addOperation(operation); + operation->set_data((NodeEllipseMask *)this->get_bnode()->storage); + operation->set_mask_type(this->get_bnode()->custom1); + converter.add_operation(operation); - if (inputSocket->isLinked()) { - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); + if (input_socket->is_linked()) { + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket()); } else { /* Value operation to produce original transparent image */ - SetValueOperation *valueOperation = new SetValueOperation(); - valueOperation->setValue(0.0f); - converter.addOperation(valueOperation); + SetValueOperation *value_operation = new SetValueOperation(); + value_operation->set_value(0.0f); + converter.add_operation(value_operation); /* Scale that image up to render resolution */ - const RenderData *rd = context.getRenderData(); - const float render_size_factor = context.getRenderPercentageAsFactor(); - ScaleFixedSizeOperation *scaleOperation = new ScaleFixedSizeOperation(); + const RenderData *rd = context.get_render_data(); + const float render_size_factor = context.get_render_percentage_as_factor(); + ScaleFixedSizeOperation *scale_operation = new ScaleFixedSizeOperation(); - scaleOperation->setIsAspect(false); - scaleOperation->setIsCrop(false); - scaleOperation->setOffset(0.0f, 0.0f); - scaleOperation->setNewWidth(rd->xsch * render_size_factor); - scaleOperation->setNewHeight(rd->ysch * render_size_factor); - scaleOperation->getInputSocket(0)->setResizeMode(ResizeMode::Align); - converter.addOperation(scaleOperation); + scale_operation->set_is_aspect(false); + scale_operation->set_is_crop(false); + scale_operation->set_offset(0.0f, 0.0f); + scale_operation->set_new_width(rd->xsch * render_size_factor); + scale_operation->set_new_height(rd->ysch * render_size_factor); + scale_operation->get_input_socket(0)->set_resize_mode(ResizeMode::Align); + converter.add_operation(scale_operation); - converter.addLink(valueOperation->getOutputSocket(0), scaleOperation->getInputSocket(0)); - converter.addLink(scaleOperation->getOutputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.add_link(value_operation->get_output_socket(0), + scale_operation->get_input_socket(0)); + converter.add_link(scale_operation->get_output_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); } - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_EllipseMaskNode.h b/source/blender/compositor/nodes/COM_EllipseMaskNode.h index cbe189be9f6..4a582b63d91 100644 --- a/source/blender/compositor/nodes/COM_EllipseMaskNode.h +++ b/source/blender/compositor/nodes/COM_EllipseMaskNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class EllipseMaskNode : public Node { public: - EllipseMaskNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + EllipseMaskNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_FilterNode.cc b/source/blender/compositor/nodes/COM_FilterNode.cc index 4cdb00a87f4..2108e68cbec 100644 --- a/source/blender/compositor/nodes/COM_FilterNode.cc +++ b/source/blender/compositor/nodes/COM_FilterNode.cc @@ -22,20 +22,20 @@ namespace blender::compositor { -FilterNode::FilterNode(bNode *editorNode) : Node(editorNode) +FilterNode::FilterNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void FilterNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void FilterNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeInput *inputImageSocket = this->getInputSocket(1); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_socket = this->get_input_socket(0); + NodeInput *input_image_socket = this->get_input_socket(1); + NodeOutput *output_socket = this->get_output_socket(0); ConvolutionFilterOperation *operation = nullptr; - switch (this->getbNode()->custom1) { + switch (this->get_bnode()->custom1) { case CMP_FILT_SOFT: operation = new ConvolutionFilterOperation(); operation->set3x3Filter(1 / 16.0f, @@ -85,13 +85,13 @@ void FilterNode::convertToOperations(NodeConverter &converter, operation->set3x3Filter(0, 0, 0, 0, 1, 0, 0, 0, 0); break; } - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputImageSocket, operation->getInputSocket(0)); - converter.mapInputSocket(inputSocket, operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); + converter.map_input_socket(input_image_socket, operation->get_input_socket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(1)); + converter.map_output_socket(output_socket, operation->get_output_socket()); - converter.addPreview(operation->getOutputSocket(0)); + converter.add_preview(operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_FilterNode.h b/source/blender/compositor/nodes/COM_FilterNode.h index f7f4176cea5..c160e11fd9f 100644 --- a/source/blender/compositor/nodes/COM_FilterNode.h +++ b/source/blender/compositor/nodes/COM_FilterNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class FilterNode : public Node { public: - FilterNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + FilterNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_FlipNode.cc b/source/blender/compositor/nodes/COM_FlipNode.cc index 1c613bde674..ec9a4f9419b 100644 --- a/source/blender/compositor/nodes/COM_FlipNode.cc +++ b/source/blender/compositor/nodes/COM_FlipNode.cc @@ -22,18 +22,18 @@ namespace blender::compositor { -FlipNode::FlipNode(bNode *editorNode) : Node(editorNode) +FlipNode::FlipNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void FlipNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void FlipNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_socket = this->get_input_socket(0); + NodeOutput *output_socket = this->get_output_socket(0); FlipOperation *operation = new FlipOperation(); - switch (this->getbNode()->custom1) { + switch (this->get_bnode()->custom1) { case 0: /* TODO: I didn't find any constants in the old implementation, * should I introduce them. */ operation->setFlipX(true); @@ -49,9 +49,9 @@ void FlipNode::convertToOperations(NodeConverter &converter, break; } - converter.addOperation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.add_operation(operation); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_FlipNode.h b/source/blender/compositor/nodes/COM_FlipNode.h index ee61d09fbba..40dc44edbbe 100644 --- a/source/blender/compositor/nodes/COM_FlipNode.h +++ b/source/blender/compositor/nodes/COM_FlipNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class FlipNode : public Node { public: - FlipNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + FlipNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_GammaNode.cc b/source/blender/compositor/nodes/COM_GammaNode.cc index 31253a90462..3c4e885ff76 100644 --- a/source/blender/compositor/nodes/COM_GammaNode.cc +++ b/source/blender/compositor/nodes/COM_GammaNode.cc @@ -21,20 +21,20 @@ namespace blender::compositor { -GammaNode::GammaNode(bNode *editorNode) : Node(editorNode) +GammaNode::GammaNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void GammaNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void GammaNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { GammaOperation *operation = new GammaOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_GammaNode.h b/source/blender/compositor/nodes/COM_GammaNode.h index 29c9ed170fa..3c7a8ee4983 100644 --- a/source/blender/compositor/nodes/COM_GammaNode.h +++ b/source/blender/compositor/nodes/COM_GammaNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class GammaNode : public Node { public: - GammaNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + GammaNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_GlareNode.cc b/source/blender/compositor/nodes/COM_GlareNode.cc index bbbbb7fa7ee..77b1162f7cc 100644 --- a/source/blender/compositor/nodes/COM_GlareNode.cc +++ b/source/blender/compositor/nodes/COM_GlareNode.cc @@ -27,15 +27,15 @@ namespace blender::compositor { -GlareNode::GlareNode(bNode *editorNode) : Node(editorNode) +GlareNode::GlareNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void GlareNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void GlareNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); NodeGlare *glare = (NodeGlare *)node->storage; GlareBaseOperation *glareoperation = nullptr; @@ -55,30 +55,31 @@ void GlareNode::convertToOperations(NodeConverter &converter, break; } BLI_assert(glareoperation); - glareoperation->setGlareSettings(glare); + glareoperation->set_glare_settings(glare); - GlareThresholdOperation *thresholdOperation = new GlareThresholdOperation(); - thresholdOperation->setGlareSettings(glare); + GlareThresholdOperation *threshold_operation = new GlareThresholdOperation(); + threshold_operation->set_glare_settings(glare); SetValueOperation *mixvalueoperation = new SetValueOperation(); - mixvalueoperation->setValue(glare->mix); + mixvalueoperation->set_value(glare->mix); MixGlareOperation *mixoperation = new MixGlareOperation(); mixoperation->set_canvas_input_index(1); - mixoperation->getInputSocket(2)->setResizeMode(ResizeMode::FitAny); + mixoperation->get_input_socket(2)->set_resize_mode(ResizeMode::FitAny); - converter.addOperation(glareoperation); - converter.addOperation(thresholdOperation); - converter.addOperation(mixvalueoperation); - converter.addOperation(mixoperation); + converter.add_operation(glareoperation); + converter.add_operation(threshold_operation); + converter.add_operation(mixvalueoperation); + converter.add_operation(mixoperation); - converter.mapInputSocket(getInputSocket(0), thresholdOperation->getInputSocket(0)); - converter.addLink(thresholdOperation->getOutputSocket(), glareoperation->getInputSocket(0)); + converter.map_input_socket(get_input_socket(0), threshold_operation->get_input_socket(0)); + converter.add_link(threshold_operation->get_output_socket(), + glareoperation->get_input_socket(0)); - converter.addLink(mixvalueoperation->getOutputSocket(), mixoperation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(0), mixoperation->getInputSocket(1)); - converter.addLink(glareoperation->getOutputSocket(), mixoperation->getInputSocket(2)); - converter.mapOutputSocket(getOutputSocket(), mixoperation->getOutputSocket()); + converter.add_link(mixvalueoperation->get_output_socket(), mixoperation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(0), mixoperation->get_input_socket(1)); + converter.add_link(glareoperation->get_output_socket(), mixoperation->get_input_socket(2)); + converter.map_output_socket(get_output_socket(), mixoperation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_GlareNode.h b/source/blender/compositor/nodes/COM_GlareNode.h index 7db5fa85e04..85e657984cd 100644 --- a/source/blender/compositor/nodes/COM_GlareNode.h +++ b/source/blender/compositor/nodes/COM_GlareNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class GlareNode : public Node { public: - GlareNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + GlareNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cc b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cc index 3cf4b218bb2..6cf9a5356c4 100644 --- a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cc +++ b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cc @@ -24,41 +24,42 @@ namespace blender::compositor { -HueSaturationValueCorrectNode::HueSaturationValueCorrectNode(bNode *editorNode) : Node(editorNode) +HueSaturationValueCorrectNode::HueSaturationValueCorrectNode(bNode *editor_node) + : Node(editor_node) { /* pass */ } -void HueSaturationValueCorrectNode::convertToOperations( +void HueSaturationValueCorrectNode::convert_to_operations( NodeConverter &converter, const CompositorContext & /*context*/) const { - NodeInput *valueSocket = this->getInputSocket(0); - NodeInput *colorSocket = this->getInputSocket(1); - NodeOutput *outputSocket = this->getOutputSocket(0); - bNode *editorsnode = getbNode(); + NodeInput *value_socket = this->get_input_socket(0); + NodeInput *color_socket = this->get_input_socket(1); + NodeOutput *output_socket = this->get_output_socket(0); + bNode *editorsnode = get_bnode(); CurveMapping *storage = (CurveMapping *)editorsnode->storage; ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation(); - converter.addOperation(rgbToHSV); + converter.add_operation(rgbToHSV); ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation(); - converter.addOperation(hsvToRGB); + converter.add_operation(hsvToRGB); HueSaturationValueCorrectOperation *changeHSV = new HueSaturationValueCorrectOperation(); - changeHSV->setCurveMapping(storage); - converter.addOperation(changeHSV); + changeHSV->set_curve_mapping(storage); + converter.add_operation(changeHSV); MixBlendOperation *blend = new MixBlendOperation(); blend->set_canvas_input_index(1); - converter.addOperation(blend); + converter.add_operation(blend); - converter.mapInputSocket(colorSocket, rgbToHSV->getInputSocket(0)); - converter.addLink(rgbToHSV->getOutputSocket(), changeHSV->getInputSocket(0)); - converter.addLink(changeHSV->getOutputSocket(), hsvToRGB->getInputSocket(0)); - converter.addLink(hsvToRGB->getOutputSocket(), blend->getInputSocket(2)); - converter.mapInputSocket(colorSocket, blend->getInputSocket(1)); - converter.mapInputSocket(valueSocket, blend->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, blend->getOutputSocket()); + converter.map_input_socket(color_socket, rgbToHSV->get_input_socket(0)); + converter.add_link(rgbToHSV->get_output_socket(), changeHSV->get_input_socket(0)); + converter.add_link(changeHSV->get_output_socket(), hsvToRGB->get_input_socket(0)); + converter.add_link(hsvToRGB->get_output_socket(), blend->get_input_socket(2)); + converter.map_input_socket(color_socket, blend->get_input_socket(1)); + converter.map_input_socket(value_socket, blend->get_input_socket(0)); + converter.map_output_socket(output_socket, blend->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h index d75b2ba51ca..1f59c06cb9f 100644 --- a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h +++ b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class HueSaturationValueCorrectNode : public Node { public: - HueSaturationValueCorrectNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + HueSaturationValueCorrectNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueNode.cc b/source/blender/compositor/nodes/COM_HueSaturationValueNode.cc index 7711c306f24..fa296f54d8f 100644 --- a/source/blender/compositor/nodes/COM_HueSaturationValueNode.cc +++ b/source/blender/compositor/nodes/COM_HueSaturationValueNode.cc @@ -24,44 +24,44 @@ namespace blender::compositor { -HueSaturationValueNode::HueSaturationValueNode(bNode *editorNode) : Node(editorNode) +HueSaturationValueNode::HueSaturationValueNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void HueSaturationValueNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void HueSaturationValueNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *colorSocket = this->getInputSocket(0); - NodeInput *hueSocket = this->getInputSocket(1); - NodeInput *saturationSocket = this->getInputSocket(2); - NodeInput *valueSocket = this->getInputSocket(3); - NodeInput *facSocket = this->getInputSocket(4); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *color_socket = this->get_input_socket(0); + NodeInput *hue_socket = this->get_input_socket(1); + NodeInput *saturation_socket = this->get_input_socket(2); + NodeInput *value_socket = this->get_input_socket(3); + NodeInput *fac_socket = this->get_input_socket(4); + NodeOutput *output_socket = this->get_output_socket(0); ConvertRGBToHSVOperation *rgbToHSV = new ConvertRGBToHSVOperation(); - converter.addOperation(rgbToHSV); + converter.add_operation(rgbToHSV); ConvertHSVToRGBOperation *hsvToRGB = new ConvertHSVToRGBOperation(); - converter.addOperation(hsvToRGB); + converter.add_operation(hsvToRGB); ChangeHSVOperation *changeHSV = new ChangeHSVOperation(); - converter.mapInputSocket(hueSocket, changeHSV->getInputSocket(1)); - converter.mapInputSocket(saturationSocket, changeHSV->getInputSocket(2)); - converter.mapInputSocket(valueSocket, changeHSV->getInputSocket(3)); - converter.addOperation(changeHSV); + converter.map_input_socket(hue_socket, changeHSV->get_input_socket(1)); + converter.map_input_socket(saturation_socket, changeHSV->get_input_socket(2)); + converter.map_input_socket(value_socket, changeHSV->get_input_socket(3)); + converter.add_operation(changeHSV); MixBlendOperation *blend = new MixBlendOperation(); blend->set_canvas_input_index(1); - converter.addOperation(blend); + converter.add_operation(blend); - converter.mapInputSocket(colorSocket, rgbToHSV->getInputSocket(0)); - converter.addLink(rgbToHSV->getOutputSocket(), changeHSV->getInputSocket(0)); - converter.addLink(changeHSV->getOutputSocket(), hsvToRGB->getInputSocket(0)); - converter.addLink(hsvToRGB->getOutputSocket(), blend->getInputSocket(2)); - converter.mapInputSocket(colorSocket, blend->getInputSocket(1)); - converter.mapInputSocket(facSocket, blend->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, blend->getOutputSocket()); + converter.map_input_socket(color_socket, rgbToHSV->get_input_socket(0)); + converter.add_link(rgbToHSV->get_output_socket(), changeHSV->get_input_socket(0)); + converter.add_link(changeHSV->get_output_socket(), hsvToRGB->get_input_socket(0)); + converter.add_link(hsvToRGB->get_output_socket(), blend->get_input_socket(2)); + converter.map_input_socket(color_socket, blend->get_input_socket(1)); + converter.map_input_socket(fac_socket, blend->get_input_socket(0)); + converter.map_output_socket(output_socket, blend->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueNode.h b/source/blender/compositor/nodes/COM_HueSaturationValueNode.h index 0b295158cc7..abb7d0afebe 100644 --- a/source/blender/compositor/nodes/COM_HueSaturationValueNode.h +++ b/source/blender/compositor/nodes/COM_HueSaturationValueNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class HueSaturationValueNode : public Node { public: - HueSaturationValueNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + HueSaturationValueNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_IDMaskNode.cc b/source/blender/compositor/nodes/COM_IDMaskNode.cc index 0a7ed521afb..4d761f25fd3 100644 --- a/source/blender/compositor/nodes/COM_IDMaskNode.cc +++ b/source/blender/compositor/nodes/COM_IDMaskNode.cc @@ -22,46 +22,46 @@ namespace blender::compositor { -IDMaskNode::IDMaskNode(bNode *editorNode) : Node(editorNode) +IDMaskNode::IDMaskNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void IDMaskNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void IDMaskNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *bnode = this->getbNode(); + bNode *bnode = this->get_bnode(); IDMaskOperation *operation; operation = new IDMaskOperation(); - operation->setObjectIndex(bnode->custom1); - converter.addOperation(operation); + operation->set_object_index(bnode->custom1); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); if (bnode->custom2 == 0) { - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } else { SMAAEdgeDetectionOperation *operation1 = nullptr; operation1 = new SMAAEdgeDetectionOperation(); - converter.addOperation(operation1); + converter.add_operation(operation1); - converter.addLink(operation->getOutputSocket(0), operation1->getInputSocket(0)); + converter.add_link(operation->get_output_socket(0), operation1->get_input_socket(0)); /* Blending Weight Calculation Pixel Shader (Second Pass). */ SMAABlendingWeightCalculationOperation *operation2 = new SMAABlendingWeightCalculationOperation(); - converter.addOperation(operation2); + converter.add_operation(operation2); - converter.addLink(operation1->getOutputSocket(), operation2->getInputSocket(0)); + converter.add_link(operation1->get_output_socket(), operation2->get_input_socket(0)); /* Neighborhood Blending Pixel Shader (Third Pass). */ SMAANeighborhoodBlendingOperation *operation3 = new SMAANeighborhoodBlendingOperation(); - converter.addOperation(operation3); + converter.add_operation(operation3); - converter.addLink(operation->getOutputSocket(0), operation3->getInputSocket(0)); - converter.addLink(operation2->getOutputSocket(), operation3->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation3->getOutputSocket()); + converter.add_link(operation->get_output_socket(0), operation3->get_input_socket(0)); + converter.add_link(operation2->get_output_socket(), operation3->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation3->get_output_socket()); } } diff --git a/source/blender/compositor/nodes/COM_IDMaskNode.h b/source/blender/compositor/nodes/COM_IDMaskNode.h index f702732a8ed..8eba2af715f 100644 --- a/source/blender/compositor/nodes/COM_IDMaskNode.h +++ b/source/blender/compositor/nodes/COM_IDMaskNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class IDMaskNode : public Node { public: - IDMaskNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + IDMaskNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ImageNode.cc b/source/blender/compositor/nodes/COM_ImageNode.cc index 992d5697109..928a7c735c7 100644 --- a/source/blender/compositor/nodes/COM_ImageNode.cc +++ b/source/blender/compositor/nodes/COM_ImageNode.cc @@ -26,21 +26,21 @@ namespace blender::compositor { -ImageNode::ImageNode(bNode *editorNode) : Node(editorNode) +ImageNode::ImageNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter, - RenderLayer *render_layer, - RenderPass *render_pass, - Image *image, - ImageUser *user, - int framenumber, - int outputsocketIndex, - int view, - DataType datatype) const +NodeOperation *ImageNode::do_multilayer_check(NodeConverter &converter, + RenderLayer *render_layer, + RenderPass *render_pass, + Image *image, + ImageUser *user, + int framenumber, + int outputsocket_index, + int view, + DataType datatype) const { - NodeOutput *outputSocket = this->getOutputSocket(outputsocketIndex); + NodeOutput *output_socket = this->get_output_socket(outputsocket_index); MultilayerBaseOperation *operation = nullptr; switch (datatype) { case DataType::Value: @@ -55,27 +55,27 @@ NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter, default: break; } - operation->setImage(image); - operation->setImageUser(user); - operation->setFramenumber(framenumber); + operation->set_image(image); + operation->set_image_user(user); + operation->set_framenumber(framenumber); - converter.addOperation(operation); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket()); + converter.add_operation(operation); + converter.map_output_socket(output_socket, operation->get_output_socket()); return operation; } -void ImageNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void ImageNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { /** Image output */ - NodeOutput *outputImage = this->getOutputSocket(0); - bNode *editorNode = this->getbNode(); - Image *image = (Image *)editorNode->id; - ImageUser *imageuser = (ImageUser *)editorNode->storage; - int framenumber = context.getFramenumber(); - bool outputStraightAlpha = (editorNode->custom1 & CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT) != 0; - BKE_image_user_frame_calc(image, imageuser, context.getFramenumber()); + NodeOutput *output_image = this->get_output_socket(0); + bNode *editor_node = this->get_bnode(); + Image *image = (Image *)editor_node->id; + ImageUser *imageuser = (ImageUser *)editor_node->storage; + int framenumber = context.get_framenumber(); + bool output_straight_alpha = (editor_node->custom1 & CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT) != 0; + BKE_image_user_frame_calc(image, imageuser, context.get_framenumber()); /* force a load, we assume iuser index will be set OK anyway */ if (image && image->type == IMA_TYPE_MULTILAYER) { bool is_multilayer_ok = false; @@ -88,14 +88,14 @@ void ImageNode::convertToOperations(NodeConverter &converter, for (int64_t index = 0; index < outputs.size(); index++) { NodeOutput *socket = outputs[index]; NodeOperation *operation = nullptr; - bNodeSocket *bnodeSocket = socket->getbNodeSocket(); - NodeImageLayer *storage = (NodeImageLayer *)bnodeSocket->storage; + bNodeSocket *bnode_socket = socket->get_bnode_socket(); + NodeImageLayer *storage = (NodeImageLayer *)bnode_socket->storage; RenderPass *rpass = (RenderPass *)BLI_findstring( &rl->passes, storage->pass_name, offsetof(RenderPass, name)); int view = 0; if (STREQ(storage->pass_name, RE_PASSNAME_COMBINED) && - STREQ(bnodeSocket->name, "Alpha")) { + STREQ(bnode_socket->name, "Alpha")) { /* Alpha output is already handled with the associated combined output. */ continue; } @@ -109,7 +109,7 @@ void ImageNode::convertToOperations(NodeConverter &converter, /* heuristic to match image name with scene names * check if the view name exists in the image */ view = BLI_findstringindex( - &image->rr->views, context.getViewName(), offsetof(RenderView, name)); + &image->rr->views, context.get_view_name(), offsetof(RenderView, name)); if (view == -1) { view = 0; } @@ -122,64 +122,64 @@ void ImageNode::convertToOperations(NodeConverter &converter, if (rpass) { switch (rpass->channels) { case 1: - operation = doMultilayerCheck(converter, - rl, - rpass, - image, - imageuser, - framenumber, - index, - view, - DataType::Value); + operation = do_multilayer_check(converter, + rl, + rpass, + image, + imageuser, + framenumber, + index, + view, + DataType::Value); break; /* using image operations for both 3 and 4 channels (RGB and RGBA respectively) */ /* XXX any way to detect actual vector images? */ case 3: - operation = doMultilayerCheck(converter, - rl, - rpass, - image, - imageuser, - framenumber, - index, - view, - DataType::Vector); + operation = do_multilayer_check(converter, + rl, + rpass, + image, + imageuser, + framenumber, + index, + view, + DataType::Vector); break; case 4: - operation = doMultilayerCheck(converter, - rl, - rpass, - image, - imageuser, - framenumber, - index, - view, - DataType::Color); + operation = do_multilayer_check(converter, + rl, + rpass, + image, + imageuser, + framenumber, + index, + view, + DataType::Color); break; default: /* dummy operation is added below */ break; } if (index == 0 && operation) { - converter.addPreview(operation->getOutputSocket()); + converter.add_preview(operation->get_output_socket()); } - if (STREQ(rpass->name, RE_PASSNAME_COMBINED) && !(bnodeSocket->flag & SOCK_UNAVAIL)) { - for (NodeOutput *alphaSocket : getOutputSockets()) { - bNodeSocket *bnodeAlphaSocket = alphaSocket->getbNodeSocket(); - if (!STREQ(bnodeAlphaSocket->name, "Alpha")) { + if (STREQ(rpass->name, RE_PASSNAME_COMBINED) && !(bnode_socket->flag & SOCK_UNAVAIL)) { + for (NodeOutput *alpha_socket : get_output_sockets()) { + bNodeSocket *bnode_alpha_socket = alpha_socket->get_bnode_socket(); + if (!STREQ(bnode_alpha_socket->name, "Alpha")) { continue; } - NodeImageLayer *alphaStorage = (NodeImageLayer *)bnodeSocket->storage; - if (!STREQ(alphaStorage->pass_name, RE_PASSNAME_COMBINED)) { + NodeImageLayer *alpha_storage = (NodeImageLayer *)bnode_socket->storage; + if (!STREQ(alpha_storage->pass_name, RE_PASSNAME_COMBINED)) { continue; } SeparateChannelOperation *separate_operation; separate_operation = new SeparateChannelOperation(); - separate_operation->setChannel(3); - converter.addOperation(separate_operation); - converter.addLink(operation->getOutputSocket(), - separate_operation->getInputSocket(0)); - converter.mapOutputSocket(alphaSocket, separate_operation->getOutputSocket()); + separate_operation->set_channel(3); + converter.add_operation(separate_operation); + converter.add_link(operation->get_output_socket(), + separate_operation->get_input_socket(0)); + converter.map_output_socket(alpha_socket, separate_operation->get_output_socket()); break; } } @@ -187,7 +187,7 @@ void ImageNode::convertToOperations(NodeConverter &converter, /* In case we can't load the layer. */ if (operation == nullptr) { - converter.setInvalidOutput(getOutputSocket(index)); + converter.set_invalid_output(get_output_socket(index)); } } } @@ -196,69 +196,70 @@ void ImageNode::convertToOperations(NodeConverter &converter, /* without this, multilayer that fail to load will crash blender T32490. */ if (is_multilayer_ok == false) { - for (NodeOutput *output : getOutputSockets()) { - converter.setInvalidOutput(output); + for (NodeOutput *output : get_output_sockets()) { + converter.set_invalid_output(output); } } } else { - const int64_t numberOfOutputs = getOutputSockets().size(); - if (numberOfOutputs > 0) { + const int64_t number_of_outputs = get_output_sockets().size(); + if (number_of_outputs > 0) { ImageOperation *operation = new ImageOperation(); - operation->setImage(image); - operation->setImageUser(imageuser); - operation->setFramenumber(framenumber); - operation->setRenderData(context.getRenderData()); - operation->setViewName(context.getViewName()); - converter.addOperation(operation); + operation->set_image(image); + operation->set_image_user(imageuser); + operation->set_framenumber(framenumber); + operation->set_render_data(context.get_render_data()); + operation->set_view_name(context.get_view_name()); + converter.add_operation(operation); - if (outputStraightAlpha) { - NodeOperation *alphaConvertOperation = new ConvertPremulToStraightOperation(); + if (output_straight_alpha) { + NodeOperation *alpha_convert_operation = new ConvertPremulToStraightOperation(); - converter.addOperation(alphaConvertOperation); - converter.mapOutputSocket(outputImage, alphaConvertOperation->getOutputSocket()); - converter.addLink(operation->getOutputSocket(0), alphaConvertOperation->getInputSocket(0)); + converter.add_operation(alpha_convert_operation); + converter.map_output_socket(output_image, alpha_convert_operation->get_output_socket()); + converter.add_link(operation->get_output_socket(0), + alpha_convert_operation->get_input_socket(0)); } else { - converter.mapOutputSocket(outputImage, operation->getOutputSocket()); + converter.map_output_socket(output_image, operation->get_output_socket()); } - converter.addPreview(operation->getOutputSocket()); + converter.add_preview(operation->get_output_socket()); } - if (numberOfOutputs > 1) { - NodeOutput *alphaImage = this->getOutputSocket(1); - ImageAlphaOperation *alphaOperation = new ImageAlphaOperation(); - alphaOperation->setImage(image); - alphaOperation->setImageUser(imageuser); - alphaOperation->setFramenumber(framenumber); - alphaOperation->setRenderData(context.getRenderData()); - alphaOperation->setViewName(context.getViewName()); - converter.addOperation(alphaOperation); + if (number_of_outputs > 1) { + NodeOutput *alpha_image = this->get_output_socket(1); + ImageAlphaOperation *alpha_operation = new ImageAlphaOperation(); + alpha_operation->set_image(image); + alpha_operation->set_image_user(imageuser); + alpha_operation->set_framenumber(framenumber); + alpha_operation->set_render_data(context.get_render_data()); + alpha_operation->set_view_name(context.get_view_name()); + converter.add_operation(alpha_operation); - converter.mapOutputSocket(alphaImage, alphaOperation->getOutputSocket()); + converter.map_output_socket(alpha_image, alpha_operation->get_output_socket()); } - if (numberOfOutputs > 2) { - NodeOutput *depthImage = this->getOutputSocket(2); - ImageDepthOperation *depthOperation = new ImageDepthOperation(); - depthOperation->setImage(image); - depthOperation->setImageUser(imageuser); - depthOperation->setFramenumber(framenumber); - depthOperation->setRenderData(context.getRenderData()); - depthOperation->setViewName(context.getViewName()); - converter.addOperation(depthOperation); + if (number_of_outputs > 2) { + NodeOutput *depth_image = this->get_output_socket(2); + ImageDepthOperation *depth_operation = new ImageDepthOperation(); + depth_operation->set_image(image); + depth_operation->set_image_user(imageuser); + depth_operation->set_framenumber(framenumber); + depth_operation->set_render_data(context.get_render_data()); + depth_operation->set_view_name(context.get_view_name()); + converter.add_operation(depth_operation); - converter.mapOutputSocket(depthImage, depthOperation->getOutputSocket()); + converter.map_output_socket(depth_image, depth_operation->get_output_socket()); } - if (numberOfOutputs > 3) { + if (number_of_outputs > 3) { /* happens when unlinking image datablock from multilayer node */ - for (int i = 3; i < numberOfOutputs; i++) { - NodeOutput *output = this->getOutputSocket(i); + for (int i = 3; i < number_of_outputs; i++) { + NodeOutput *output = this->get_output_socket(i); NodeOperation *operation = nullptr; - switch (output->getDataType()) { + switch (output->get_data_type()) { case DataType::Value: { SetValueOperation *valueoperation = new SetValueOperation(); - valueoperation->setValue(0.0f); + valueoperation->set_value(0.0f); operation = valueoperation; break; } @@ -272,10 +273,10 @@ void ImageNode::convertToOperations(NodeConverter &converter, } case DataType::Color: { SetColorOperation *coloroperation = new SetColorOperation(); - coloroperation->setChannel1(0.0f); - coloroperation->setChannel2(0.0f); - coloroperation->setChannel3(0.0f); - coloroperation->setChannel4(0.0f); + coloroperation->set_channel1(0.0f); + coloroperation->set_channel2(0.0f); + coloroperation->set_channel3(0.0f); + coloroperation->set_channel4(0.0f); operation = coloroperation; break; } @@ -283,8 +284,8 @@ void ImageNode::convertToOperations(NodeConverter &converter, if (operation) { /* not supporting multiview for this generic case */ - converter.addOperation(operation); - converter.mapOutputSocket(output, operation->getOutputSocket()); + converter.add_operation(operation); + converter.map_output_socket(output, operation->get_output_socket()); } } } diff --git a/source/blender/compositor/nodes/COM_ImageNode.h b/source/blender/compositor/nodes/COM_ImageNode.h index 047cc496f83..7dd948be946 100644 --- a/source/blender/compositor/nodes/COM_ImageNode.h +++ b/source/blender/compositor/nodes/COM_ImageNode.h @@ -34,20 +34,20 @@ namespace blender::compositor { */ class ImageNode : public Node { private: - NodeOperation *doMultilayerCheck(NodeConverter &converter, - RenderLayer *render_layer, - RenderPass *render_pass, - Image *image, - ImageUser *user, - int framenumber, - int outputsocketIndex, - int view, - DataType datatype) const; + NodeOperation *do_multilayer_check(NodeConverter &converter, + RenderLayer *render_layer, + RenderPass *render_pass, + Image *image, + ImageUser *user, + int framenumber, + int outputsocket_index, + int view, + DataType datatype) const; public: - ImageNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ImageNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_InpaintNode.cc b/source/blender/compositor/nodes/COM_InpaintNode.cc index 93fb051090c..1feb618d47a 100644 --- a/source/blender/compositor/nodes/COM_InpaintNode.cc +++ b/source/blender/compositor/nodes/COM_InpaintNode.cc @@ -21,25 +21,25 @@ namespace blender::compositor { -InpaintNode::InpaintNode(bNode *editorNode) : Node(editorNode) +InpaintNode::InpaintNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void InpaintNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void InpaintNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *editorNode = this->getbNode(); + bNode *editor_node = this->get_bnode(); - /* if (editorNode->custom1 == CMP_NODE_INPAINT_SIMPLE) { */ + /* if (editor_node->custom1 == CMP_NODE_INPAINT_SIMPLE) { */ if (true) { InpaintSimpleOperation *operation = new InpaintSimpleOperation(); - operation->setIterations(editorNode->custom2); - converter.addOperation(operation); + operation->set_iterations(editor_node->custom2); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } diff --git a/source/blender/compositor/nodes/COM_InpaintNode.h b/source/blender/compositor/nodes/COM_InpaintNode.h index 3a10c11bf61..389ca1d56f4 100644 --- a/source/blender/compositor/nodes/COM_InpaintNode.h +++ b/source/blender/compositor/nodes/COM_InpaintNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class InpaintNode : public Node { public: - InpaintNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + InpaintNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_InvertNode.cc b/source/blender/compositor/nodes/COM_InvertNode.cc index cb15f3b28b0..ffde5b1e12e 100644 --- a/source/blender/compositor/nodes/COM_InvertNode.cc +++ b/source/blender/compositor/nodes/COM_InvertNode.cc @@ -22,23 +22,23 @@ namespace blender::compositor { -InvertNode::InvertNode(bNode *editorNode) : Node(editorNode) +InvertNode::InvertNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void InvertNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void InvertNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { InvertOperation *operation = new InvertOperation(); - bNode *node = this->getbNode(); - operation->setColor(node->custom1 & CMP_CHAN_RGB); - operation->setAlpha(node->custom1 & CMP_CHAN_A); - converter.addOperation(operation); + bNode *node = this->get_bnode(); + operation->set_color(node->custom1 & CMP_CHAN_RGB); + operation->set_alpha(node->custom1 & CMP_CHAN_A); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_InvertNode.h b/source/blender/compositor/nodes/COM_InvertNode.h index 1cc975b8236..8f2eb258ab5 100644 --- a/source/blender/compositor/nodes/COM_InvertNode.h +++ b/source/blender/compositor/nodes/COM_InvertNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class InvertNode : public Node { public: - InvertNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + InvertNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_KeyingNode.cc b/source/blender/compositor/nodes/COM_KeyingNode.cc index c928b55fbb0..d3130fdd2eb 100644 --- a/source/blender/compositor/nodes/COM_KeyingNode.cc +++ b/source/blender/compositor/nodes/COM_KeyingNode.cc @@ -37,112 +37,114 @@ namespace blender::compositor { -KeyingNode::KeyingNode(bNode *editorNode) : Node(editorNode) +KeyingNode::KeyingNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -NodeOperationOutput *KeyingNode::setupPreBlur(NodeConverter &converter, - NodeInput *inputImage, - int size) const +NodeOperationOutput *KeyingNode::setup_pre_blur(NodeConverter &converter, + NodeInput *input_image, + int size) const { ConvertRGBToYCCOperation *convertRGBToYCCOperation = new ConvertRGBToYCCOperation(); - convertRGBToYCCOperation->setMode(BLI_YCC_ITU_BT709); - converter.addOperation(convertRGBToYCCOperation); + convertRGBToYCCOperation->set_mode(BLI_YCC_ITU_BT709); + converter.add_operation(convertRGBToYCCOperation); - converter.mapInputSocket(inputImage, convertRGBToYCCOperation->getInputSocket(0)); + converter.map_input_socket(input_image, convertRGBToYCCOperation->get_input_socket(0)); - CombineChannelsOperation *combineOperation = new CombineChannelsOperation(); - converter.addOperation(combineOperation); + CombineChannelsOperation *combine_operation = new CombineChannelsOperation(); + converter.add_operation(combine_operation); for (int channel = 0; channel < 4; channel++) { - SeparateChannelOperation *separateOperation = new SeparateChannelOperation(); - separateOperation->setChannel(channel); - converter.addOperation(separateOperation); + SeparateChannelOperation *separate_operation = new SeparateChannelOperation(); + separate_operation->set_channel(channel); + converter.add_operation(separate_operation); - converter.addLink(convertRGBToYCCOperation->getOutputSocket(0), - separateOperation->getInputSocket(0)); + converter.add_link(convertRGBToYCCOperation->get_output_socket(0), + separate_operation->get_input_socket(0)); if (ELEM(channel, 0, 3)) { - converter.addLink(separateOperation->getOutputSocket(0), - combineOperation->getInputSocket(channel)); + converter.add_link(separate_operation->get_output_socket(0), + combine_operation->get_input_socket(channel)); } else { - KeyingBlurOperation *blurXOperation = new KeyingBlurOperation(); - blurXOperation->setSize(size); - blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X); - converter.addOperation(blurXOperation); - - KeyingBlurOperation *blurYOperation = new KeyingBlurOperation(); - blurYOperation->setSize(size); - blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y); - converter.addOperation(blurYOperation); - - converter.addLink(separateOperation->getOutputSocket(), blurXOperation->getInputSocket(0)); - converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0)); - converter.addLink(blurYOperation->getOutputSocket(0), - combineOperation->getInputSocket(channel)); + KeyingBlurOperation *blur_xoperation = new KeyingBlurOperation(); + blur_xoperation->set_size(size); + blur_xoperation->set_axis(KeyingBlurOperation::BLUR_AXIS_X); + converter.add_operation(blur_xoperation); + + KeyingBlurOperation *blur_yoperation = new KeyingBlurOperation(); + blur_yoperation->set_size(size); + blur_yoperation->set_axis(KeyingBlurOperation::BLUR_AXIS_Y); + converter.add_operation(blur_yoperation); + + converter.add_link(separate_operation->get_output_socket(), + blur_xoperation->get_input_socket(0)); + converter.add_link(blur_xoperation->get_output_socket(), + blur_yoperation->get_input_socket(0)); + converter.add_link(blur_yoperation->get_output_socket(0), + combine_operation->get_input_socket(channel)); } } ConvertYCCToRGBOperation *convertYCCToRGBOperation = new ConvertYCCToRGBOperation(); - convertYCCToRGBOperation->setMode(BLI_YCC_ITU_BT709); - converter.addOperation(convertYCCToRGBOperation); + convertYCCToRGBOperation->set_mode(BLI_YCC_ITU_BT709); + converter.add_operation(convertYCCToRGBOperation); - converter.addLink(combineOperation->getOutputSocket(0), - convertYCCToRGBOperation->getInputSocket(0)); + converter.add_link(combine_operation->get_output_socket(0), + convertYCCToRGBOperation->get_input_socket(0)); - return convertYCCToRGBOperation->getOutputSocket(0); + return convertYCCToRGBOperation->get_output_socket(0); } -NodeOperationOutput *KeyingNode::setupPostBlur(NodeConverter &converter, - NodeOperationOutput *postBlurInput, - int size) const +NodeOperationOutput *KeyingNode::setup_post_blur(NodeConverter &converter, + NodeOperationOutput *post_blur_input, + int size) const { - KeyingBlurOperation *blurXOperation = new KeyingBlurOperation(); - blurXOperation->setSize(size); - blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X); - converter.addOperation(blurXOperation); + KeyingBlurOperation *blur_xoperation = new KeyingBlurOperation(); + blur_xoperation->set_size(size); + blur_xoperation->set_axis(KeyingBlurOperation::BLUR_AXIS_X); + converter.add_operation(blur_xoperation); - KeyingBlurOperation *blurYOperation = new KeyingBlurOperation(); - blurYOperation->setSize(size); - blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y); - converter.addOperation(blurYOperation); + KeyingBlurOperation *blur_yoperation = new KeyingBlurOperation(); + blur_yoperation->set_size(size); + blur_yoperation->set_axis(KeyingBlurOperation::BLUR_AXIS_Y); + converter.add_operation(blur_yoperation); - converter.addLink(postBlurInput, blurXOperation->getInputSocket(0)); - converter.addLink(blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0)); + converter.add_link(post_blur_input, blur_xoperation->get_input_socket(0)); + converter.add_link(blur_xoperation->get_output_socket(), blur_yoperation->get_input_socket(0)); - return blurYOperation->getOutputSocket(); + return blur_yoperation->get_output_socket(); } -NodeOperationOutput *KeyingNode::setupDilateErode(NodeConverter &converter, - NodeOperationOutput *dilateErodeInput, - int distance) const +NodeOperationOutput *KeyingNode::setup_dilate_erode(NodeConverter &converter, + NodeOperationOutput *dilate_erode_input, + int distance) const { - DilateDistanceOperation *dilateErodeOperation; + DilateDistanceOperation *dilate_erode_operation; if (distance > 0) { - dilateErodeOperation = new DilateDistanceOperation(); - dilateErodeOperation->setDistance(distance); + dilate_erode_operation = new DilateDistanceOperation(); + dilate_erode_operation->set_distance(distance); } else { - dilateErodeOperation = new ErodeDistanceOperation(); - dilateErodeOperation->setDistance(-distance); + dilate_erode_operation = new ErodeDistanceOperation(); + dilate_erode_operation->set_distance(-distance); } - converter.addOperation(dilateErodeOperation); + converter.add_operation(dilate_erode_operation); - converter.addLink(dilateErodeInput, dilateErodeOperation->getInputSocket(0)); + converter.add_link(dilate_erode_input, dilate_erode_operation->get_input_socket(0)); - return dilateErodeOperation->getOutputSocket(0); + return dilate_erode_operation->get_output_socket(0); } -NodeOperationOutput *KeyingNode::setupFeather(NodeConverter &converter, - const CompositorContext &context, - NodeOperationOutput *featherInput, - int falloff, - int distance) const +NodeOperationOutput *KeyingNode::setup_feather(NodeConverter &converter, + const CompositorContext &context, + NodeOperationOutput *feather_input, + int falloff, + int distance) const { /* this uses a modified gaussian blur function otherwise its far too slow */ - eCompositorQuality quality = context.getQuality(); + eCompositorQuality quality = context.get_quality(); /* initialize node data */ NodeBlurData data; @@ -156,196 +158,198 @@ NodeOperationOutput *KeyingNode::setupFeather(NodeConverter &converter, } GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation(); - operationx->setData(&data); - operationx->setQuality(quality); - operationx->setSize(1.0f); - operationx->setSubtract(distance < 0); - operationx->setFalloff(falloff); - converter.addOperation(operationx); + operationx->set_data(&data); + operationx->set_quality(quality); + operationx->set_size(1.0f); + operationx->set_subtract(distance < 0); + operationx->set_falloff(falloff); + converter.add_operation(operationx); GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation(); - operationy->setData(&data); - operationy->setQuality(quality); - operationy->setSize(1.0f); - operationy->setSubtract(distance < 0); - operationy->setFalloff(falloff); - converter.addOperation(operationy); + operationy->set_data(&data); + operationy->set_quality(quality); + operationy->set_size(1.0f); + operationy->set_subtract(distance < 0); + operationy->set_falloff(falloff); + converter.add_operation(operationy); - converter.addLink(featherInput, operationx->getInputSocket(0)); - converter.addLink(operationx->getOutputSocket(), operationy->getInputSocket(0)); + converter.add_link(feather_input, operationx->get_input_socket(0)); + converter.add_link(operationx->get_output_socket(), operationy->get_input_socket(0)); - return operationy->getOutputSocket(); + return operationy->get_output_socket(); } -NodeOperationOutput *KeyingNode::setupDespill(NodeConverter &converter, - NodeOperationOutput *despillInput, - NodeInput *inputScreen, - float factor, - float colorBalance) const +NodeOperationOutput *KeyingNode::setup_despill(NodeConverter &converter, + NodeOperationOutput *despill_input, + NodeInput *input_screen, + float factor, + float color_balance) const { - KeyingDespillOperation *despillOperation = new KeyingDespillOperation(); - despillOperation->setDespillFactor(factor); - despillOperation->setColorBalance(colorBalance); - converter.addOperation(despillOperation); + KeyingDespillOperation *despill_operation = new KeyingDespillOperation(); + despill_operation->set_despill_factor(factor); + despill_operation->set_color_balance(color_balance); + converter.add_operation(despill_operation); - converter.addLink(despillInput, despillOperation->getInputSocket(0)); - converter.mapInputSocket(inputScreen, despillOperation->getInputSocket(1)); + converter.add_link(despill_input, despill_operation->get_input_socket(0)); + converter.map_input_socket(input_screen, despill_operation->get_input_socket(1)); - return despillOperation->getOutputSocket(0); + return despill_operation->get_output_socket(0); } -NodeOperationOutput *KeyingNode::setupClip(NodeConverter &converter, - NodeOperationOutput *clipInput, - int kernelRadius, - float kernelTolerance, - float clipBlack, - float clipWhite, - bool edgeMatte) const +NodeOperationOutput *KeyingNode::setup_clip(NodeConverter &converter, + NodeOperationOutput *clip_input, + int kernel_radius, + float kernel_tolerance, + float clip_black, + float clip_white, + bool edge_matte) const { - KeyingClipOperation *clipOperation = new KeyingClipOperation(); - clipOperation->setKernelRadius(kernelRadius); - clipOperation->setKernelTolerance(kernelTolerance); - clipOperation->setClipBlack(clipBlack); - clipOperation->setClipWhite(clipWhite); - clipOperation->setIsEdgeMatte(edgeMatte); - converter.addOperation(clipOperation); + KeyingClipOperation *clip_operation = new KeyingClipOperation(); + clip_operation->set_kernel_radius(kernel_radius); + clip_operation->set_kernel_tolerance(kernel_tolerance); + clip_operation->set_clip_black(clip_black); + clip_operation->set_clip_white(clip_white); + clip_operation->set_is_edge_matte(edge_matte); + converter.add_operation(clip_operation); - converter.addLink(clipInput, clipOperation->getInputSocket(0)); + converter.add_link(clip_input, clip_operation->get_input_socket(0)); - return clipOperation->getOutputSocket(0); + return clip_operation->get_output_socket(0); } -void KeyingNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void KeyingNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - NodeKeyingData *keying_data = (NodeKeyingData *)editorNode->storage; - - NodeInput *inputImage = this->getInputSocket(0); - NodeInput *inputScreen = this->getInputSocket(1); - NodeInput *inputGarbageMatte = this->getInputSocket(2); - NodeInput *inputCoreMatte = this->getInputSocket(3); - NodeOutput *outputImage = this->getOutputSocket(0); - NodeOutput *outputMatte = this->getOutputSocket(1); - NodeOutput *outputEdges = this->getOutputSocket(2); - NodeOperationOutput *postprocessedMatte = nullptr, *postprocessedImage = nullptr, - *edgesMatte = nullptr; + bNode *editor_node = this->get_bnode(); + NodeKeyingData *keying_data = (NodeKeyingData *)editor_node->storage; + + NodeInput *input_image = this->get_input_socket(0); + NodeInput *input_screen = this->get_input_socket(1); + NodeInput *input_garbage_matte = this->get_input_socket(2); + NodeInput *input_core_matte = this->get_input_socket(3); + NodeOutput *output_image = this->get_output_socket(0); + NodeOutput *output_matte = this->get_output_socket(1); + NodeOutput *output_edges = this->get_output_socket(2); + NodeOperationOutput *postprocessed_matte = nullptr, *postprocessed_image = nullptr, + *edges_matte = nullptr; /* keying operation */ - KeyingOperation *keyingOperation = new KeyingOperation(); - keyingOperation->setScreenBalance(keying_data->screen_balance); - converter.addOperation(keyingOperation); + KeyingOperation *keying_operation = new KeyingOperation(); + keying_operation->set_screen_balance(keying_data->screen_balance); + converter.add_operation(keying_operation); - converter.mapInputSocket(inputScreen, keyingOperation->getInputSocket(1)); + converter.map_input_socket(input_screen, keying_operation->get_input_socket(1)); if (keying_data->blur_pre) { /* Chroma pre-blur operation for input of keying operation. */ - NodeOperationOutput *preBlurredImage = setupPreBlur( - converter, inputImage, keying_data->blur_pre); - converter.addLink(preBlurredImage, keyingOperation->getInputSocket(0)); + NodeOperationOutput *pre_blurred_image = setup_pre_blur( + converter, input_image, keying_data->blur_pre); + converter.add_link(pre_blurred_image, keying_operation->get_input_socket(0)); } else { - converter.mapInputSocket(inputImage, keyingOperation->getInputSocket(0)); + converter.map_input_socket(input_image, keying_operation->get_input_socket(0)); } - postprocessedMatte = keyingOperation->getOutputSocket(); + postprocessed_matte = keying_operation->get_output_socket(); /* black / white clipping */ if (keying_data->clip_black > 0.0f || keying_data->clip_white < 1.0f) { - postprocessedMatte = setupClip(converter, - postprocessedMatte, - keying_data->edge_kernel_radius, - keying_data->edge_kernel_tolerance, - keying_data->clip_black, - keying_data->clip_white, - false); + postprocessed_matte = setup_clip(converter, + postprocessed_matte, + keying_data->edge_kernel_radius, + keying_data->edge_kernel_tolerance, + keying_data->clip_black, + keying_data->clip_white, + false); } /* output edge matte */ - edgesMatte = setupClip(converter, - postprocessedMatte, - keying_data->edge_kernel_radius, - keying_data->edge_kernel_tolerance, - keying_data->clip_black, - keying_data->clip_white, - true); + edges_matte = setup_clip(converter, + postprocessed_matte, + keying_data->edge_kernel_radius, + keying_data->edge_kernel_tolerance, + keying_data->clip_black, + keying_data->clip_white, + true); /* apply garbage matte */ - if (inputGarbageMatte->isLinked()) { - SetValueOperation *valueOperation = new SetValueOperation(); - valueOperation->setValue(1.0f); - converter.addOperation(valueOperation); + if (input_garbage_matte->is_linked()) { + SetValueOperation *value_operation = new SetValueOperation(); + value_operation->set_value(1.0f); + converter.add_operation(value_operation); - MathSubtractOperation *subtractOperation = new MathSubtractOperation(); - converter.addOperation(subtractOperation); + MathSubtractOperation *subtract_operation = new MathSubtractOperation(); + converter.add_operation(subtract_operation); - MathMinimumOperation *minOperation = new MathMinimumOperation(); - converter.addOperation(minOperation); + MathMinimumOperation *min_operation = new MathMinimumOperation(); + converter.add_operation(min_operation); - converter.addLink(valueOperation->getOutputSocket(), subtractOperation->getInputSocket(0)); - converter.mapInputSocket(inputGarbageMatte, subtractOperation->getInputSocket(1)); + converter.add_link(value_operation->get_output_socket(), + subtract_operation->get_input_socket(0)); + converter.map_input_socket(input_garbage_matte, subtract_operation->get_input_socket(1)); - converter.addLink(subtractOperation->getOutputSocket(), minOperation->getInputSocket(0)); - converter.addLink(postprocessedMatte, minOperation->getInputSocket(1)); + converter.add_link(subtract_operation->get_output_socket(), + min_operation->get_input_socket(0)); + converter.add_link(postprocessed_matte, min_operation->get_input_socket(1)); - postprocessedMatte = minOperation->getOutputSocket(); + postprocessed_matte = min_operation->get_output_socket(); } /* apply core matte */ - if (inputCoreMatte->isLinked()) { - MathMaximumOperation *maxOperation = new MathMaximumOperation(); - converter.addOperation(maxOperation); + if (input_core_matte->is_linked()) { + MathMaximumOperation *max_operation = new MathMaximumOperation(); + converter.add_operation(max_operation); - converter.mapInputSocket(inputCoreMatte, maxOperation->getInputSocket(0)); - converter.addLink(postprocessedMatte, maxOperation->getInputSocket(1)); + converter.map_input_socket(input_core_matte, max_operation->get_input_socket(0)); + converter.add_link(postprocessed_matte, max_operation->get_input_socket(1)); - postprocessedMatte = maxOperation->getOutputSocket(); + postprocessed_matte = max_operation->get_output_socket(); } /* apply blur on matte if needed */ if (keying_data->blur_post) { - postprocessedMatte = setupPostBlur(converter, postprocessedMatte, keying_data->blur_post); + postprocessed_matte = setup_post_blur(converter, postprocessed_matte, keying_data->blur_post); } /* matte dilate/erode */ if (keying_data->dilate_distance != 0) { - postprocessedMatte = setupDilateErode( - converter, postprocessedMatte, keying_data->dilate_distance); + postprocessed_matte = setup_dilate_erode( + converter, postprocessed_matte, keying_data->dilate_distance); } /* matte feather */ if (keying_data->feather_distance != 0) { - postprocessedMatte = setupFeather(converter, - context, - postprocessedMatte, - keying_data->feather_falloff, - keying_data->feather_distance); + postprocessed_matte = setup_feather(converter, + context, + postprocessed_matte, + keying_data->feather_falloff, + keying_data->feather_distance); } /* set alpha channel to output image */ - SetAlphaMultiplyOperation *alphaOperation = new SetAlphaMultiplyOperation(); - converter.addOperation(alphaOperation); + SetAlphaMultiplyOperation *alpha_operation = new SetAlphaMultiplyOperation(); + converter.add_operation(alpha_operation); - converter.mapInputSocket(inputImage, alphaOperation->getInputSocket(0)); - converter.addLink(postprocessedMatte, alphaOperation->getInputSocket(1)); + converter.map_input_socket(input_image, alpha_operation->get_input_socket(0)); + converter.add_link(postprocessed_matte, alpha_operation->get_input_socket(1)); - postprocessedImage = alphaOperation->getOutputSocket(); + postprocessed_image = alpha_operation->get_output_socket(); /* despill output image */ if (keying_data->despill_factor > 0.0f) { - postprocessedImage = setupDespill(converter, - postprocessedImage, - inputScreen, - keying_data->despill_factor, - keying_data->despill_balance); + postprocessed_image = setup_despill(converter, + postprocessed_image, + input_screen, + keying_data->despill_factor, + keying_data->despill_balance); } /* connect result to output sockets */ - converter.mapOutputSocket(outputImage, postprocessedImage); - converter.mapOutputSocket(outputMatte, postprocessedMatte); + converter.map_output_socket(output_image, postprocessed_image); + converter.map_output_socket(output_matte, postprocessed_matte); - if (edgesMatte) { - converter.mapOutputSocket(outputEdges, edgesMatte); + if (edges_matte) { + converter.map_output_socket(output_edges, edges_matte); } } diff --git a/source/blender/compositor/nodes/COM_KeyingNode.h b/source/blender/compositor/nodes/COM_KeyingNode.h index 6d5e3ca1883..ed70433fea3 100644 --- a/source/blender/compositor/nodes/COM_KeyingNode.h +++ b/source/blender/compositor/nodes/COM_KeyingNode.h @@ -28,37 +28,37 @@ namespace blender::compositor { */ class KeyingNode : public Node { protected: - NodeOperationOutput *setupPreBlur(NodeConverter &converter, - NodeInput *inputImage, - int size) const; - NodeOperationOutput *setupPostBlur(NodeConverter &converter, - NodeOperationOutput *postBlurInput, - int size) const; - NodeOperationOutput *setupDilateErode(NodeConverter &converter, - NodeOperationOutput *dilateErodeInput, - int distance) const; - NodeOperationOutput *setupFeather(NodeConverter &converter, - const CompositorContext &context, - NodeOperationOutput *featherInput, - int falloff, - int distance) const; - NodeOperationOutput *setupDespill(NodeConverter &converter, - NodeOperationOutput *despillInput, - NodeInput *inputScreen, - float factor, - float colorBalance) const; - NodeOperationOutput *setupClip(NodeConverter &converter, - NodeOperationOutput *clipInput, - int kernelRadius, - float kernelTolerance, - float clipBlack, - float clipWhite, - bool edgeMatte) const; + NodeOperationOutput *setup_pre_blur(NodeConverter &converter, + NodeInput *input_image, + int size) const; + NodeOperationOutput *setup_post_blur(NodeConverter &converter, + NodeOperationOutput *post_blur_input, + int size) const; + NodeOperationOutput *setup_dilate_erode(NodeConverter &converter, + NodeOperationOutput *dilate_erode_input, + int distance) const; + NodeOperationOutput *setup_feather(NodeConverter &converter, + const CompositorContext &context, + NodeOperationOutput *feather_input, + int falloff, + int distance) const; + NodeOperationOutput *setup_despill(NodeConverter &converter, + NodeOperationOutput *despill_input, + NodeInput *input_screen, + float factor, + float color_balance) const; + NodeOperationOutput *setup_clip(NodeConverter &converter, + NodeOperationOutput *clip_input, + int kernel_radius, + float kernel_tolerance, + float clip_black, + float clip_white, + bool edge_matte) const; public: - KeyingNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + KeyingNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_KeyingScreenNode.cc b/source/blender/compositor/nodes/COM_KeyingScreenNode.cc index e405c01ddf2..bf5d7bb237a 100644 --- a/source/blender/compositor/nodes/COM_KeyingScreenNode.cc +++ b/source/blender/compositor/nodes/COM_KeyingScreenNode.cc @@ -21,28 +21,28 @@ namespace blender::compositor { -KeyingScreenNode::KeyingScreenNode(bNode *editorNode) : Node(editorNode) +KeyingScreenNode::KeyingScreenNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void KeyingScreenNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void KeyingScreenNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - MovieClip *clip = (MovieClip *)editorNode->id; - NodeKeyingScreenData *keyingscreen_data = (NodeKeyingScreenData *)editorNode->storage; + bNode *editor_node = this->get_bnode(); + MovieClip *clip = (MovieClip *)editor_node->id; + NodeKeyingScreenData *keyingscreen_data = (NodeKeyingScreenData *)editor_node->storage; - NodeOutput *outputScreen = this->getOutputSocket(0); + NodeOutput *output_screen = this->get_output_socket(0); /* Always connect the output image. */ KeyingScreenOperation *operation = new KeyingScreenOperation(); - operation->setMovieClip(clip); - operation->setTrackingObject(keyingscreen_data->tracking_object); - operation->setFramenumber(context.getFramenumber()); - converter.addOperation(operation); + operation->set_movie_clip(clip); + operation->set_tracking_object(keyingscreen_data->tracking_object); + operation->set_framenumber(context.get_framenumber()); + converter.add_operation(operation); - converter.mapOutputSocket(outputScreen, operation->getOutputSocket()); + converter.map_output_socket(output_screen, operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_KeyingScreenNode.h b/source/blender/compositor/nodes/COM_KeyingScreenNode.h index f2ad3b344f1..3704081041f 100644 --- a/source/blender/compositor/nodes/COM_KeyingScreenNode.h +++ b/source/blender/compositor/nodes/COM_KeyingScreenNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class KeyingScreenNode : public Node { public: - KeyingScreenNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + KeyingScreenNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.cc b/source/blender/compositor/nodes/COM_LensDistortionNode.cc index 46223c1f294..7cef21487df 100644 --- a/source/blender/compositor/nodes/COM_LensDistortionNode.cc +++ b/source/blender/compositor/nodes/COM_LensDistortionNode.cc @@ -22,42 +22,42 @@ namespace blender::compositor { -LensDistortionNode::LensDistortionNode(bNode *editorNode) : Node(editorNode) +LensDistortionNode::LensDistortionNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void LensDistortionNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void LensDistortionNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *editorNode = this->getbNode(); - NodeLensDist *data = (NodeLensDist *)editorNode->storage; + bNode *editor_node = this->get_bnode(); + NodeLensDist *data = (NodeLensDist *)editor_node->storage; if (data->proj) { ProjectorLensDistortionOperation *operation = new ProjectorLensDistortionOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } else { ScreenLensDistortionOperation *operation = new ScreenLensDistortionOperation(); - operation->setFit(data->fit); - operation->setJitter(data->jit); + operation->set_fit(data->fit); + operation->set_jitter(data->jit); - if (!getInputSocket(1)->isLinked()) { - operation->setDistortion(getInputSocket(1)->getEditorValueFloat()); + if (!get_input_socket(1)->is_linked()) { + operation->set_distortion(get_input_socket(1)->get_editor_value_float()); } - if (!getInputSocket(2)->isLinked()) { - operation->setDispersion(getInputSocket(2)->getEditorValueFloat()); + if (!get_input_socket(2)->is_linked()) { + operation->set_dispersion(get_input_socket(2)->get_editor_value_float()); } - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.h b/source/blender/compositor/nodes/COM_LensDistortionNode.h index 4de1b0fe4da..154b8c20b86 100644 --- a/source/blender/compositor/nodes/COM_LensDistortionNode.h +++ b/source/blender/compositor/nodes/COM_LensDistortionNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class LensDistortionNode : public Node { public: - LensDistortionNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + LensDistortionNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_LuminanceMatteNode.cc b/source/blender/compositor/nodes/COM_LuminanceMatteNode.cc index e38aff91431..645cbe91fd2 100644 --- a/source/blender/compositor/nodes/COM_LuminanceMatteNode.cc +++ b/source/blender/compositor/nodes/COM_LuminanceMatteNode.cc @@ -22,34 +22,34 @@ namespace blender::compositor { -LuminanceMatteNode::LuminanceMatteNode(bNode *editorNode) : Node(editorNode) +LuminanceMatteNode::LuminanceMatteNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void LuminanceMatteNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void LuminanceMatteNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *editorsnode = getbNode(); - NodeInput *inputSocket = this->getInputSocket(0); - NodeOutput *outputSocketImage = this->getOutputSocket(0); - NodeOutput *outputSocketMatte = this->getOutputSocket(1); + bNode *editorsnode = get_bnode(); + NodeInput *input_socket = this->get_input_socket(0); + NodeOutput *output_socket_image = this->get_output_socket(0); + NodeOutput *output_socket_matte = this->get_output_socket(1); - LuminanceMatteOperation *operationSet = new LuminanceMatteOperation(); - operationSet->setSettings((NodeChroma *)editorsnode->storage); - converter.addOperation(operationSet); + LuminanceMatteOperation *operation_set = new LuminanceMatteOperation(); + operation_set->set_settings((NodeChroma *)editorsnode->storage); + converter.add_operation(operation_set); - converter.mapInputSocket(inputSocket, operationSet->getInputSocket(0)); - converter.mapOutputSocket(outputSocketMatte, operationSet->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation_set->get_input_socket(0)); + converter.map_output_socket(output_socket_matte, operation_set->get_output_socket(0)); SetAlphaMultiplyOperation *operation = new SetAlphaMultiplyOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.addLink(operationSet->getOutputSocket(), operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocketImage, operation->getOutputSocket()); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.add_link(operation_set->get_output_socket(), operation->get_input_socket(1)); + converter.map_output_socket(output_socket_image, operation->get_output_socket()); - converter.addPreview(operation->getOutputSocket()); + converter.add_preview(operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_LuminanceMatteNode.h b/source/blender/compositor/nodes/COM_LuminanceMatteNode.h index ef4ebc8ad92..1f934c73d1e 100644 --- a/source/blender/compositor/nodes/COM_LuminanceMatteNode.h +++ b/source/blender/compositor/nodes/COM_LuminanceMatteNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class LuminanceMatteNode : public Node { public: - LuminanceMatteNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + LuminanceMatteNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MapRangeNode.cc b/source/blender/compositor/nodes/COM_MapRangeNode.cc index 01288b779ec..45f3113ca9e 100644 --- a/source/blender/compositor/nodes/COM_MapRangeNode.cc +++ b/source/blender/compositor/nodes/COM_MapRangeNode.cc @@ -22,31 +22,31 @@ namespace blender::compositor { -MapRangeNode::MapRangeNode(bNode *editorNode) : Node(editorNode) +MapRangeNode::MapRangeNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void MapRangeNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void MapRangeNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *valueSocket = this->getInputSocket(0); - NodeInput *sourceMinSocket = this->getInputSocket(1); - NodeInput *sourceMaxSocket = this->getInputSocket(2); - NodeInput *destMinSocket = this->getInputSocket(3); - NodeInput *destMaxSocket = this->getInputSocket(4); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *value_socket = this->get_input_socket(0); + NodeInput *source_min_socket = this->get_input_socket(1); + NodeInput *source_max_socket = this->get_input_socket(2); + NodeInput *dest_min_socket = this->get_input_socket(3); + NodeInput *dest_max_socket = this->get_input_socket(4); + NodeOutput *output_socket = this->get_output_socket(0); MapRangeOperation *operation = new MapRangeOperation(); - operation->setUseClamp(this->getbNode()->custom1); - converter.addOperation(operation); - - converter.mapInputSocket(valueSocket, operation->getInputSocket(0)); - converter.mapInputSocket(sourceMinSocket, operation->getInputSocket(1)); - converter.mapInputSocket(sourceMaxSocket, operation->getInputSocket(2)); - converter.mapInputSocket(destMinSocket, operation->getInputSocket(3)); - converter.mapInputSocket(destMaxSocket, operation->getInputSocket(4)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + operation->set_use_clamp(this->get_bnode()->custom1); + converter.add_operation(operation); + + converter.map_input_socket(value_socket, operation->get_input_socket(0)); + converter.map_input_socket(source_min_socket, operation->get_input_socket(1)); + converter.map_input_socket(source_max_socket, operation->get_input_socket(2)); + converter.map_input_socket(dest_min_socket, operation->get_input_socket(3)); + converter.map_input_socket(dest_max_socket, operation->get_input_socket(4)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MapRangeNode.h b/source/blender/compositor/nodes/COM_MapRangeNode.h index ad6fd78a7d5..c9323ac00c2 100644 --- a/source/blender/compositor/nodes/COM_MapRangeNode.h +++ b/source/blender/compositor/nodes/COM_MapRangeNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class MapRangeNode : public Node { public: - MapRangeNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + MapRangeNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MapUVNode.cc b/source/blender/compositor/nodes/COM_MapUVNode.cc index ddda1e2db1d..9c794165e0b 100644 --- a/source/blender/compositor/nodes/COM_MapUVNode.cc +++ b/source/blender/compositor/nodes/COM_MapUVNode.cc @@ -21,24 +21,24 @@ namespace blender::compositor { -MapUVNode::MapUVNode(bNode *editorNode) : Node(editorNode) +MapUVNode::MapUVNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void MapUVNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void MapUVNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); MapUVOperation *operation = new MapUVOperation(); - operation->setAlpha((float)node->custom1); + operation->set_alpha((float)node->custom1); operation->set_canvas_input_index(1); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MapUVNode.h b/source/blender/compositor/nodes/COM_MapUVNode.h index f7f4db167ea..eebfd0e66fa 100644 --- a/source/blender/compositor/nodes/COM_MapUVNode.h +++ b/source/blender/compositor/nodes/COM_MapUVNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class MapUVNode : public Node { public: - MapUVNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + MapUVNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MapValueNode.cc b/source/blender/compositor/nodes/COM_MapValueNode.cc index 9c6be55e93b..8c81a902863 100644 --- a/source/blender/compositor/nodes/COM_MapValueNode.cc +++ b/source/blender/compositor/nodes/COM_MapValueNode.cc @@ -22,25 +22,25 @@ namespace blender::compositor { -MapValueNode::MapValueNode(bNode *editorNode) : Node(editorNode) +MapValueNode::MapValueNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void MapValueNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void MapValueNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - TexMapping *storage = (TexMapping *)this->getbNode()->storage; + TexMapping *storage = (TexMapping *)this->get_bnode()->storage; - NodeInput *colorSocket = this->getInputSocket(0); - NodeOutput *valueSocket = this->getOutputSocket(0); + NodeInput *color_socket = this->get_input_socket(0); + NodeOutput *value_socket = this->get_output_socket(0); - MapValueOperation *convertProg = new MapValueOperation(); - convertProg->setSettings(storage); - converter.addOperation(convertProg); + MapValueOperation *convert_prog = new MapValueOperation(); + convert_prog->set_settings(storage); + converter.add_operation(convert_prog); - converter.mapInputSocket(colorSocket, convertProg->getInputSocket(0)); - converter.mapOutputSocket(valueSocket, convertProg->getOutputSocket(0)); + converter.map_input_socket(color_socket, convert_prog->get_input_socket(0)); + converter.map_output_socket(value_socket, convert_prog->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MapValueNode.h b/source/blender/compositor/nodes/COM_MapValueNode.h index dcac1d6e3c5..4516d7eb016 100644 --- a/source/blender/compositor/nodes/COM_MapValueNode.h +++ b/source/blender/compositor/nodes/COM_MapValueNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class MapValueNode : public Node { public: - MapValueNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + MapValueNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MaskNode.cc b/source/blender/compositor/nodes/COM_MaskNode.cc index 27488c8a6c8..b1e0506089e 100644 --- a/source/blender/compositor/nodes/COM_MaskNode.cc +++ b/source/blender/compositor/nodes/COM_MaskNode.cc @@ -21,51 +21,51 @@ namespace blender::compositor { -MaskNode::MaskNode(bNode *editorNode) : Node(editorNode) +MaskNode::MaskNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void MaskNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void MaskNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - const RenderData *rd = context.getRenderData(); - const float render_size_factor = context.getRenderPercentageAsFactor(); + const RenderData *rd = context.get_render_data(); + const float render_size_factor = context.get_render_percentage_as_factor(); - NodeOutput *outputMask = this->getOutputSocket(0); + NodeOutput *output_mask = this->get_output_socket(0); - bNode *editorNode = this->getbNode(); - NodeMask *data = (NodeMask *)editorNode->storage; - Mask *mask = (Mask *)editorNode->id; + bNode *editor_node = this->get_bnode(); + NodeMask *data = (NodeMask *)editor_node->storage; + Mask *mask = (Mask *)editor_node->id; /* Always connect the output image. */ MaskOperation *operation = new MaskOperation(); - if (editorNode->custom1 & CMP_NODEFLAG_MASK_FIXED) { - operation->setMaskWidth(data->size_x); - operation->setMaskHeight(data->size_y); + if (editor_node->custom1 & CMP_NODEFLAG_MASK_FIXED) { + operation->set_mask_width(data->size_x); + operation->set_mask_height(data->size_y); } - else if (editorNode->custom1 & CMP_NODEFLAG_MASK_FIXED_SCENE) { - operation->setMaskWidth(data->size_x * render_size_factor); - operation->setMaskHeight(data->size_y * render_size_factor); + else if (editor_node->custom1 & CMP_NODEFLAG_MASK_FIXED_SCENE) { + operation->set_mask_width(data->size_x * render_size_factor); + operation->set_mask_height(data->size_y * render_size_factor); } else { - operation->setMaskWidth(rd->xsch * render_size_factor); - operation->setMaskHeight(rd->ysch * render_size_factor); + operation->set_mask_width(rd->xsch * render_size_factor); + operation->set_mask_height(rd->ysch * render_size_factor); } - operation->setMask(mask); - operation->setFramenumber(context.getFramenumber()); - operation->setFeather((bool)(editorNode->custom1 & CMP_NODEFLAG_MASK_NO_FEATHER) == 0); + operation->set_mask(mask); + operation->set_framenumber(context.get_framenumber()); + operation->set_feather((bool)(editor_node->custom1 & CMP_NODEFLAG_MASK_NO_FEATHER) == 0); - if ((editorNode->custom1 & CMP_NODEFLAG_MASK_MOTION_BLUR) && (editorNode->custom2 > 1) && - (editorNode->custom3 > FLT_EPSILON)) { - operation->setMotionBlurSamples(editorNode->custom2); - operation->setMotionBlurShutter(editorNode->custom3); + if ((editor_node->custom1 & CMP_NODEFLAG_MASK_MOTION_BLUR) && (editor_node->custom2 > 1) && + (editor_node->custom3 > FLT_EPSILON)) { + operation->set_motion_blur_samples(editor_node->custom2); + operation->set_motion_blur_shutter(editor_node->custom3); } - converter.addOperation(operation); - converter.mapOutputSocket(outputMask, operation->getOutputSocket()); + converter.add_operation(operation); + converter.map_output_socket(output_mask, operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MaskNode.h b/source/blender/compositor/nodes/COM_MaskNode.h index 5890cf5957a..0d9d4284b27 100644 --- a/source/blender/compositor/nodes/COM_MaskNode.h +++ b/source/blender/compositor/nodes/COM_MaskNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class MaskNode : public Node { public: - MaskNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + MaskNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MathNode.cc b/source/blender/compositor/nodes/COM_MathNode.cc index f8a1530fe29..6102aed0f88 100644 --- a/source/blender/compositor/nodes/COM_MathNode.cc +++ b/source/blender/compositor/nodes/COM_MathNode.cc @@ -21,12 +21,12 @@ namespace blender::compositor { -void MathNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void MathNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { MathBaseOperation *operation = nullptr; - switch (this->getbNode()->custom1) { + switch (this->get_bnode()->custom1) { case NODE_MATH_ADD: operation = new MathAddOperation(); break; @@ -150,14 +150,14 @@ void MathNode::convertToOperations(NodeConverter &converter, } if (operation) { - bool useClamp = getbNode()->custom2; - operation->setUseClamp(useClamp); - converter.addOperation(operation); + bool use_clamp = get_bnode()->custom2; + operation->set_use_clamp(use_clamp); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } } diff --git a/source/blender/compositor/nodes/COM_MathNode.h b/source/blender/compositor/nodes/COM_MathNode.h index 5db59e62bab..7f60fc03fcd 100644 --- a/source/blender/compositor/nodes/COM_MathNode.h +++ b/source/blender/compositor/nodes/COM_MathNode.h @@ -28,11 +28,11 @@ namespace blender::compositor { */ class MathNode : public Node { public: - MathNode(bNode *editorNode) : Node(editorNode) + MathNode(bNode *editor_node) : Node(editor_node) { } - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MixNode.cc b/source/blender/compositor/nodes/COM_MixNode.cc index 9eb38783d6a..ae7736b4b67 100644 --- a/source/blender/compositor/nodes/COM_MixNode.cc +++ b/source/blender/compositor/nodes/COM_MixNode.cc @@ -24,91 +24,91 @@ namespace blender::compositor { -MixNode::MixNode(bNode *editorNode) : Node(editorNode) +MixNode::MixNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void MixNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void MixNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *valueSocket = this->getInputSocket(0); - NodeInput *color1Socket = this->getInputSocket(1); - NodeInput *color2Socket = this->getInputSocket(2); - NodeOutput *outputSocket = this->getOutputSocket(0); - bNode *editorNode = this->getbNode(); - bool useAlphaPremultiply = (this->getbNode()->custom2 & 1) != 0; - bool useClamp = (this->getbNode()->custom2 & 2) != 0; + NodeInput *value_socket = this->get_input_socket(0); + NodeInput *color1Socket = this->get_input_socket(1); + NodeInput *color2Socket = this->get_input_socket(2); + NodeOutput *output_socket = this->get_output_socket(0); + bNode *editor_node = this->get_bnode(); + bool use_alpha_premultiply = (this->get_bnode()->custom2 & 1) != 0; + bool use_clamp = (this->get_bnode()->custom2 & 2) != 0; - MixBaseOperation *convertProg; - switch (editorNode->custom1) { + MixBaseOperation *convert_prog; + switch (editor_node->custom1) { case MA_RAMP_ADD: - convertProg = new MixAddOperation(); + convert_prog = new MixAddOperation(); break; case MA_RAMP_MULT: - convertProg = new MixMultiplyOperation(); + convert_prog = new MixMultiplyOperation(); break; case MA_RAMP_LIGHT: - convertProg = new MixLightenOperation(); + convert_prog = new MixLightenOperation(); break; case MA_RAMP_BURN: - convertProg = new MixColorBurnOperation(); + convert_prog = new MixColorBurnOperation(); break; case MA_RAMP_HUE: - convertProg = new MixHueOperation(); + convert_prog = new MixHueOperation(); break; case MA_RAMP_COLOR: - convertProg = new MixColorOperation(); + convert_prog = new MixColorOperation(); break; case MA_RAMP_SOFT: - convertProg = new MixSoftLightOperation(); + convert_prog = new MixSoftLightOperation(); break; case MA_RAMP_SCREEN: - convertProg = new MixScreenOperation(); + convert_prog = new MixScreenOperation(); break; case MA_RAMP_LINEAR: - convertProg = new MixLinearLightOperation(); + convert_prog = new MixLinearLightOperation(); break; case MA_RAMP_DIFF: - convertProg = new MixDifferenceOperation(); + convert_prog = new MixDifferenceOperation(); break; case MA_RAMP_SAT: - convertProg = new MixSaturationOperation(); + convert_prog = new MixSaturationOperation(); break; case MA_RAMP_DIV: - convertProg = new MixDivideOperation(); + convert_prog = new MixDivideOperation(); break; case MA_RAMP_SUB: - convertProg = new MixSubtractOperation(); + convert_prog = new MixSubtractOperation(); break; case MA_RAMP_DARK: - convertProg = new MixDarkenOperation(); + convert_prog = new MixDarkenOperation(); break; case MA_RAMP_OVERLAY: - convertProg = new MixOverlayOperation(); + convert_prog = new MixOverlayOperation(); break; case MA_RAMP_VAL: - convertProg = new MixValueOperation(); + convert_prog = new MixValueOperation(); break; case MA_RAMP_DODGE: - convertProg = new MixDodgeOperation(); + convert_prog = new MixDodgeOperation(); break; case MA_RAMP_BLEND: default: - convertProg = new MixBlendOperation(); + convert_prog = new MixBlendOperation(); break; } - convertProg->setUseValueAlphaMultiply(useAlphaPremultiply); - convertProg->setUseClamp(useClamp); - converter.addOperation(convertProg); + convert_prog->set_use_value_alpha_multiply(use_alpha_premultiply); + convert_prog->set_use_clamp(use_clamp); + converter.add_operation(convert_prog); - converter.mapInputSocket(valueSocket, convertProg->getInputSocket(0)); - converter.mapInputSocket(color1Socket, convertProg->getInputSocket(1)); - converter.mapInputSocket(color2Socket, convertProg->getInputSocket(2)); - converter.mapOutputSocket(outputSocket, convertProg->getOutputSocket(0)); + converter.map_input_socket(value_socket, convert_prog->get_input_socket(0)); + converter.map_input_socket(color1Socket, convert_prog->get_input_socket(1)); + converter.map_input_socket(color2Socket, convert_prog->get_input_socket(2)); + converter.map_output_socket(output_socket, convert_prog->get_output_socket(0)); - converter.addPreview(convertProg->getOutputSocket(0)); + converter.add_preview(convert_prog->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MixNode.h b/source/blender/compositor/nodes/COM_MixNode.h index 81f9c41871e..1a6bdf1cf57 100644 --- a/source/blender/compositor/nodes/COM_MixNode.h +++ b/source/blender/compositor/nodes/COM_MixNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class MixNode : public Node { public: - MixNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + MixNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MovieClipNode.cc b/source/blender/compositor/nodes/COM_MovieClipNode.cc index 9c2e3c95a03..b71e379304e 100644 --- a/source/blender/compositor/nodes/COM_MovieClipNode.cc +++ b/source/blender/compositor/nodes/COM_MovieClipNode.cc @@ -29,58 +29,58 @@ namespace blender::compositor { -MovieClipNode::MovieClipNode(bNode *editorNode) : Node(editorNode) +MovieClipNode::MovieClipNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void MovieClipNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void MovieClipNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeOutput *outputMovieClip = this->getOutputSocket(0); - NodeOutput *alphaMovieClip = this->getOutputSocket(1); - NodeOutput *offsetXMovieClip = this->getOutputSocket(2); - NodeOutput *offsetYMovieClip = this->getOutputSocket(3); - NodeOutput *scaleMovieClip = this->getOutputSocket(4); - NodeOutput *angleMovieClip = this->getOutputSocket(5); - - bNode *editorNode = this->getbNode(); - MovieClip *movieClip = (MovieClip *)editorNode->id; - MovieClipUser *movieClipUser = (MovieClipUser *)editorNode->storage; - bool cacheFrame = !context.isRendering(); + NodeOutput *output_movie_clip = this->get_output_socket(0); + NodeOutput *alpha_movie_clip = this->get_output_socket(1); + NodeOutput *offset_xmovie_clip = this->get_output_socket(2); + NodeOutput *offset_ymovie_clip = this->get_output_socket(3); + NodeOutput *scale_movie_clip = this->get_output_socket(4); + NodeOutput *angle_movie_clip = this->get_output_socket(5); + + bNode *editor_node = this->get_bnode(); + MovieClip *movie_clip = (MovieClip *)editor_node->id; + MovieClipUser *movie_clip_user = (MovieClipUser *)editor_node->storage; + bool cache_frame = !context.is_rendering(); ImBuf *ibuf = nullptr; - if (movieClip) { - if (cacheFrame) { - ibuf = BKE_movieclip_get_ibuf(movieClip, movieClipUser); + if (movie_clip) { + if (cache_frame) { + ibuf = BKE_movieclip_get_ibuf(movie_clip, movie_clip_user); } else { ibuf = BKE_movieclip_get_ibuf_flag( - movieClip, movieClipUser, movieClip->flag, MOVIECLIP_CACHE_SKIP); + movie_clip, movie_clip_user, movie_clip->flag, MOVIECLIP_CACHE_SKIP); } } /* Always connect the output image. */ MovieClipOperation *operation = new MovieClipOperation(); - operation->setMovieClip(movieClip); - operation->setMovieClipUser(movieClipUser); - operation->setFramenumber(context.getFramenumber()); - operation->setCacheFrame(cacheFrame); + operation->set_movie_clip(movie_clip); + operation->set_movie_clip_user(movie_clip_user); + operation->set_framenumber(context.get_framenumber()); + operation->set_cache_frame(cache_frame); - converter.addOperation(operation); - converter.mapOutputSocket(outputMovieClip, operation->getOutputSocket()); - converter.addPreview(operation->getOutputSocket()); + converter.add_operation(operation); + converter.map_output_socket(output_movie_clip, operation->get_output_socket()); + converter.add_preview(operation->get_output_socket()); - MovieClipAlphaOperation *alphaOperation = new MovieClipAlphaOperation(); - alphaOperation->setMovieClip(movieClip); - alphaOperation->setMovieClipUser(movieClipUser); - alphaOperation->setFramenumber(context.getFramenumber()); - alphaOperation->setCacheFrame(cacheFrame); + MovieClipAlphaOperation *alpha_operation = new MovieClipAlphaOperation(); + alpha_operation->set_movie_clip(movie_clip); + alpha_operation->set_movie_clip_user(movie_clip_user); + alpha_operation->set_framenumber(context.get_framenumber()); + alpha_operation->set_cache_frame(cache_frame); - converter.addOperation(alphaOperation); - converter.mapOutputSocket(alphaMovieClip, alphaOperation->getOutputSocket()); + converter.add_operation(alpha_operation); + converter.map_output_socket(alpha_movie_clip, alpha_operation->get_output_socket()); - MovieTrackingStabilization *stab = &movieClip->tracking.stabilization; + MovieTrackingStabilization *stab = &movie_clip->tracking.stabilization; float loc[2], scale, angle; loc[0] = 0.0f; loc[1] = 0.0f; @@ -89,18 +89,18 @@ void MovieClipNode::convertToOperations(NodeConverter &converter, if (ibuf) { if (stab->flag & TRACKING_2D_STABILIZATION) { - int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(movieClip, - context.getFramenumber()); + int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(movie_clip, + context.get_framenumber()); BKE_tracking_stabilization_data_get( - movieClip, clip_framenr, ibuf->x, ibuf->y, loc, &scale, &angle); + movie_clip, clip_framenr, ibuf->x, ibuf->y, loc, &scale, &angle); } } - converter.addOutputValue(offsetXMovieClip, loc[0]); - converter.addOutputValue(offsetYMovieClip, loc[1]); - converter.addOutputValue(scaleMovieClip, scale); - converter.addOutputValue(angleMovieClip, angle); + converter.add_output_value(offset_xmovie_clip, loc[0]); + converter.add_output_value(offset_ymovie_clip, loc[1]); + converter.add_output_value(scale_movie_clip, scale); + converter.add_output_value(angle_movie_clip, angle); if (ibuf) { IMB_freeImBuf(ibuf); diff --git a/source/blender/compositor/nodes/COM_MovieClipNode.h b/source/blender/compositor/nodes/COM_MovieClipNode.h index a469ce9e2a4..cf9e7a3e01e 100644 --- a/source/blender/compositor/nodes/COM_MovieClipNode.h +++ b/source/blender/compositor/nodes/COM_MovieClipNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class MovieClipNode : public Node { public: - MovieClipNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + MovieClipNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MovieDistortionNode.cc b/source/blender/compositor/nodes/COM_MovieDistortionNode.cc index c9155ee8ca3..03b780198cd 100644 --- a/source/blender/compositor/nodes/COM_MovieDistortionNode.cc +++ b/source/blender/compositor/nodes/COM_MovieDistortionNode.cc @@ -22,27 +22,27 @@ namespace blender::compositor { -MovieDistortionNode::MovieDistortionNode(bNode *editorNode) : Node(editorNode) +MovieDistortionNode::MovieDistortionNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void MovieDistortionNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void MovieDistortionNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *bnode = this->getbNode(); + bNode *bnode = this->get_bnode(); MovieClip *clip = (MovieClip *)bnode->id; - NodeInput *inputSocket = this->getInputSocket(0); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_socket = this->get_input_socket(0); + NodeOutput *output_socket = this->get_output_socket(0); MovieDistortionOperation *operation = new MovieDistortionOperation(bnode->custom1 == 1); - operation->setMovieClip(clip); - operation->setFramenumber(context.getFramenumber()); - converter.addOperation(operation); + operation->set_movie_clip(clip); + operation->set_framenumber(context.get_framenumber()); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_MovieDistortionNode.h b/source/blender/compositor/nodes/COM_MovieDistortionNode.h index 0c1610aa3d3..530b0dd6f97 100644 --- a/source/blender/compositor/nodes/COM_MovieDistortionNode.h +++ b/source/blender/compositor/nodes/COM_MovieDistortionNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class MovieDistortionNode : public Node { public: - MovieDistortionNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + MovieDistortionNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_NormalNode.cc b/source/blender/compositor/nodes/COM_NormalNode.cc index 5a05f4c89b5..f9875c6015c 100644 --- a/source/blender/compositor/nodes/COM_NormalNode.cc +++ b/source/blender/compositor/nodes/COM_NormalNode.cc @@ -22,37 +22,37 @@ namespace blender::compositor { -NormalNode::NormalNode(bNode *editorNode) : Node(editorNode) +NormalNode::NormalNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void NormalNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void NormalNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeOutput *outputSocket = this->getOutputSocket(0); - NodeOutput *outputSocketDotproduct = this->getOutputSocket(1); + NodeInput *input_socket = this->get_input_socket(0); + NodeOutput *output_socket = this->get_output_socket(0); + NodeOutput *output_socket_dotproduct = this->get_output_socket(1); - SetVectorOperation *operationSet = new SetVectorOperation(); + SetVectorOperation *operation_set = new SetVectorOperation(); float normal[3]; - outputSocket->getEditorValueVector(normal); + output_socket->get_editor_value_vector(normal); /* animation can break normalization, this restores it */ normalize_v3(normal); - operationSet->setX(normal[0]); - operationSet->setY(normal[1]); - operationSet->setZ(normal[2]); - operationSet->setW(0.0f); - converter.addOperation(operationSet); + operation_set->setX(normal[0]); + operation_set->setY(normal[1]); + operation_set->setZ(normal[2]); + operation_set->setW(0.0f); + converter.add_operation(operation_set); - converter.mapOutputSocket(outputSocket, operationSet->getOutputSocket(0)); + converter.map_output_socket(output_socket, operation_set->get_output_socket(0)); DotproductOperation *operation = new DotproductOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.addLink(operationSet->getOutputSocket(0), operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocketDotproduct, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.add_link(operation_set->get_output_socket(0), operation->get_input_socket(1)); + converter.map_output_socket(output_socket_dotproduct, operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_NormalNode.h b/source/blender/compositor/nodes/COM_NormalNode.h index 6d5cbb394a0..2fcbb280c20 100644 --- a/source/blender/compositor/nodes/COM_NormalNode.h +++ b/source/blender/compositor/nodes/COM_NormalNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class NormalNode : public Node { public: - NormalNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + NormalNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_NormalizeNode.cc b/source/blender/compositor/nodes/COM_NormalizeNode.cc index b42f8154ce0..0dbd9e1837c 100644 --- a/source/blender/compositor/nodes/COM_NormalizeNode.cc +++ b/source/blender/compositor/nodes/COM_NormalizeNode.cc @@ -21,19 +21,19 @@ namespace blender::compositor { -NormalizeNode::NormalizeNode(bNode *editorNode) : Node(editorNode) +NormalizeNode::NormalizeNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void NormalizeNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void NormalizeNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { NormalizeOperation *operation = new NormalizeOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_NormalizeNode.h b/source/blender/compositor/nodes/COM_NormalizeNode.h index 7770fc49b61..50d3b939b30 100644 --- a/source/blender/compositor/nodes/COM_NormalizeNode.h +++ b/source/blender/compositor/nodes/COM_NormalizeNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class NormalizeNode : public Node { public: - NormalizeNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + NormalizeNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cc b/source/blender/compositor/nodes/COM_OutputFileNode.cc index 772456da963..25d201fc9c4 100644 --- a/source/blender/compositor/nodes/COM_OutputFileNode.cc +++ b/source/blender/compositor/nodes/COM_OutputFileNode.cc @@ -20,7 +20,7 @@ namespace blender::compositor { -OutputFileNode::OutputFileNode(bNode *editorNode) : Node(editorNode) +OutputFileNode::OutputFileNode(bNode *editor_node) : Node(editor_node) { /* pass */ } @@ -29,34 +29,34 @@ void OutputFileNode::add_input_sockets(OutputOpenExrMultiLayerOperation &operati { for (NodeInput *input : inputs) { NodeImageMultiFileSocket *sockdata = - (NodeImageMultiFileSocket *)input->getbNodeSocket()->storage; + (NodeImageMultiFileSocket *)input->get_bnode_socket()->storage; /* NOTE: layer becomes an empty placeholder if the input is not linked. */ - operation.add_layer(sockdata->layer, input->getDataType(), input->isLinked()); + operation.add_layer(sockdata->layer, input->get_data_type(), input->is_linked()); } } void OutputFileNode::map_input_sockets(NodeConverter &converter, OutputOpenExrMultiLayerOperation &operation) const { - bool previewAdded = false; + bool preview_added = false; int index = 0; for (NodeInput *input : inputs) { - converter.mapInputSocket(input, operation.getInputSocket(index++)); + converter.map_input_socket(input, operation.get_input_socket(index++)); - if (!previewAdded) { - converter.addNodeInputPreview(input); - previewAdded = true; + if (!preview_added) { + converter.add_node_input_preview(input); + preview_added = true; } } } -void OutputFileNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void OutputFileNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeImageMultiFile *storage = (NodeImageMultiFile *)this->getbNode()->storage; - const bool is_multiview = (context.getRenderData()->scemode & R_MULTIVIEW) != 0; + NodeImageMultiFile *storage = (NodeImageMultiFile *)this->get_bnode()->storage; + const bool is_multiview = (context.get_render_data()->scemode & R_MULTIVIEW) != 0; - if (!context.isRendering()) { + if (!context.is_rendering()) { /* only output files when rendering a sequence - * otherwise, it overwrites the output files just * scrubbing through the timeline when the compositor updates. @@ -67,40 +67,40 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, if (storage->format.imtype == R_IMF_IMTYPE_MULTILAYER) { const bool use_half_float = (storage->format.depth == R_IMF_CHAN_DEPTH_16); /* single output operation for the multilayer file */ - OutputOpenExrMultiLayerOperation *outputOperation; + OutputOpenExrMultiLayerOperation *output_operation; if (is_multiview && storage->format.views_format == R_IMF_VIEWS_MULTIVIEW) { - outputOperation = new OutputOpenExrMultiLayerMultiViewOperation(context.getScene(), - context.getRenderData(), - context.getbNodeTree(), - storage->base_path, - storage->format.exr_codec, - use_half_float, - context.getViewName()); + output_operation = new OutputOpenExrMultiLayerMultiViewOperation(context.get_scene(), + context.get_render_data(), + context.get_bnodetree(), + storage->base_path, + storage->format.exr_codec, + use_half_float, + context.get_view_name()); } else { - outputOperation = new OutputOpenExrMultiLayerOperation(context.getScene(), - context.getRenderData(), - context.getbNodeTree(), - storage->base_path, - storage->format.exr_codec, - use_half_float, - context.getViewName()); + output_operation = new OutputOpenExrMultiLayerOperation(context.get_scene(), + context.get_render_data(), + context.get_bnodetree(), + storage->base_path, + storage->format.exr_codec, + use_half_float, + context.get_view_name()); } - converter.addOperation(outputOperation); + converter.add_operation(output_operation); /* First add all inputs. Inputs are stored in a Vector and can be moved to a different * memory address during this time. */ - add_input_sockets(*outputOperation); + add_input_sockets(*output_operation); /* After adding the sockets the memory addresses will stick. */ - map_input_sockets(converter, *outputOperation); + map_input_sockets(converter, *output_operation); } else { /* single layer format */ - bool previewAdded = false; + bool preview_added = false; for (NodeInput *input : inputs) { - if (input->isLinked()) { + if (input->is_linked()) { NodeImageMultiFileSocket *sockdata = - (NodeImageMultiFileSocket *)input->getbNodeSocket()->storage; + (NodeImageMultiFileSocket *)input->get_bnode_socket()->storage; ImageFormatData *format = (sockdata->use_node_format ? &storage->format : &sockdata->format); char path[FILE_MAX]; @@ -108,50 +108,50 @@ void OutputFileNode::convertToOperations(NodeConverter &converter, /* combine file path for the input */ BLI_join_dirfile(path, FILE_MAX, storage->base_path, sockdata->path); - NodeOperation *outputOperation = nullptr; + NodeOperation *output_operation = nullptr; if (is_multiview && format->views_format == R_IMF_VIEWS_MULTIVIEW) { - outputOperation = new OutputOpenExrSingleLayerMultiViewOperation( - context.getRenderData(), - context.getbNodeTree(), - input->getDataType(), + output_operation = new OutputOpenExrSingleLayerMultiViewOperation( + context.get_render_data(), + context.get_bnodetree(), + input->get_data_type(), format, path, - context.getViewSettings(), - context.getDisplaySettings(), - context.getViewName(), + context.get_view_settings(), + context.get_display_settings(), + context.get_view_name(), sockdata->save_as_render); } else if ((!is_multiview) || (format->views_format == R_IMF_VIEWS_INDIVIDUAL)) { - outputOperation = new OutputSingleLayerOperation(context.getRenderData(), - context.getbNodeTree(), - input->getDataType(), - format, - path, - context.getViewSettings(), - context.getDisplaySettings(), - context.getViewName(), - sockdata->save_as_render); + output_operation = new OutputSingleLayerOperation(context.get_render_data(), + context.get_bnodetree(), + input->get_data_type(), + format, + path, + context.get_view_settings(), + context.get_display_settings(), + context.get_view_name(), + sockdata->save_as_render); } else { /* R_IMF_VIEWS_STEREO_3D */ - outputOperation = new OutputStereoOperation(context.getRenderData(), - context.getbNodeTree(), - input->getDataType(), - format, - path, - sockdata->layer, - context.getViewSettings(), - context.getDisplaySettings(), - context.getViewName(), - sockdata->save_as_render); + output_operation = new OutputStereoOperation(context.get_render_data(), + context.get_bnodetree(), + input->get_data_type(), + format, + path, + sockdata->layer, + context.get_view_settings(), + context.get_display_settings(), + context.get_view_name(), + sockdata->save_as_render); } - converter.addOperation(outputOperation); - converter.mapInputSocket(input, outputOperation->getInputSocket(0)); + converter.add_operation(output_operation); + converter.map_input_socket(input, output_operation->get_input_socket(0)); - if (!previewAdded) { - converter.addNodeInputPreview(input); - previewAdded = true; + if (!preview_added) { + converter.add_node_input_preview(input); + preview_added = true; } } } diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.h b/source/blender/compositor/nodes/COM_OutputFileNode.h index c64128a708f..4c5575cc6b9 100644 --- a/source/blender/compositor/nodes/COM_OutputFileNode.h +++ b/source/blender/compositor/nodes/COM_OutputFileNode.h @@ -32,9 +32,9 @@ namespace blender::compositor { */ class OutputFileNode : public Node { public: - OutputFileNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + OutputFileNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; private: void add_input_sockets(OutputOpenExrMultiLayerOperation &operation) const; diff --git a/source/blender/compositor/nodes/COM_PixelateNode.cc b/source/blender/compositor/nodes/COM_PixelateNode.cc index ae7169b2d98..251ef7b192a 100644 --- a/source/blender/compositor/nodes/COM_PixelateNode.cc +++ b/source/blender/compositor/nodes/COM_PixelateNode.cc @@ -22,28 +22,28 @@ namespace blender::compositor { -PixelateNode::PixelateNode(bNode *editorNode) : Node(editorNode) +PixelateNode::PixelateNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void PixelateNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void PixelateNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeOutput *outputSocket = this->getOutputSocket(0); - DataType datatype = inputSocket->getDataType(); + NodeInput *input_socket = this->get_input_socket(0); + NodeOutput *output_socket = this->get_output_socket(0); + DataType datatype = input_socket->get_data_type(); - if (inputSocket->isLinked()) { - NodeOutput *link = inputSocket->getLink(); - datatype = link->getDataType(); + if (input_socket->is_linked()) { + NodeOutput *link = input_socket->get_link(); + datatype = link->get_data_type(); } PixelateOperation *operation = new PixelateOperation(datatype); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_PixelateNode.h b/source/blender/compositor/nodes/COM_PixelateNode.h index 1a6555550cf..c52a73cafa6 100644 --- a/source/blender/compositor/nodes/COM_PixelateNode.h +++ b/source/blender/compositor/nodes/COM_PixelateNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class PixelateNode : public Node { public: - PixelateNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + PixelateNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cc b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cc index 716392f8bcf..0d2623f6e8b 100644 --- a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cc +++ b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cc @@ -22,50 +22,50 @@ namespace blender::compositor { -PlaneTrackDeformNode::PlaneTrackDeformNode(bNode *editorNode) : Node(editorNode) +PlaneTrackDeformNode::PlaneTrackDeformNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void PlaneTrackDeformNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void PlaneTrackDeformNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - MovieClip *clip = (MovieClip *)editorNode->id; - NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *)editorNode->storage; + bNode *editor_node = this->get_bnode(); + MovieClip *clip = (MovieClip *)editor_node->id; + NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *)editor_node->storage; - int frame_number = context.getFramenumber(); + int frame_number = context.get_framenumber(); - NodeInput *input_image = this->getInputSocket(0); - NodeOutput *output_warped_image = this->getOutputSocket(0); - NodeOutput *output_plane = this->getOutputSocket(1); + NodeInput *input_image = this->get_input_socket(0); + NodeOutput *output_warped_image = this->get_output_socket(0); + NodeOutput *output_plane = this->get_output_socket(1); PlaneTrackWarpImageOperation *warp_image_operation = new PlaneTrackWarpImageOperation(); - warp_image_operation->setMovieClip(clip); - warp_image_operation->setTrackingObject(data->tracking_object); - warp_image_operation->setPlaneTrackName(data->plane_track_name); - warp_image_operation->setFramenumber(frame_number); + warp_image_operation->set_movie_clip(clip); + warp_image_operation->set_tracking_object(data->tracking_object); + warp_image_operation->set_plane_track_name(data->plane_track_name); + warp_image_operation->set_framenumber(frame_number); if (data->flag & CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR) { - warp_image_operation->setMotionBlurSamples(data->motion_blur_samples); - warp_image_operation->setMotionBlurShutter(data->motion_blur_shutter); + warp_image_operation->set_motion_blur_samples(data->motion_blur_samples); + warp_image_operation->set_motion_blur_shutter(data->motion_blur_shutter); } - converter.addOperation(warp_image_operation); + converter.add_operation(warp_image_operation); - converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0)); - converter.mapOutputSocket(output_warped_image, warp_image_operation->getOutputSocket()); + converter.map_input_socket(input_image, warp_image_operation->get_input_socket(0)); + converter.map_output_socket(output_warped_image, warp_image_operation->get_output_socket()); PlaneTrackMaskOperation *plane_mask_operation = new PlaneTrackMaskOperation(); - plane_mask_operation->setMovieClip(clip); - plane_mask_operation->setTrackingObject(data->tracking_object); - plane_mask_operation->setPlaneTrackName(data->plane_track_name); - plane_mask_operation->setFramenumber(frame_number); + plane_mask_operation->set_movie_clip(clip); + plane_mask_operation->set_tracking_object(data->tracking_object); + plane_mask_operation->set_plane_track_name(data->plane_track_name); + plane_mask_operation->set_framenumber(frame_number); if (data->flag & CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR) { - plane_mask_operation->setMotionBlurSamples(data->motion_blur_samples); - plane_mask_operation->setMotionBlurShutter(data->motion_blur_shutter); + plane_mask_operation->set_motion_blur_samples(data->motion_blur_samples); + plane_mask_operation->set_motion_blur_shutter(data->motion_blur_shutter); } - converter.addOperation(plane_mask_operation); + converter.add_operation(plane_mask_operation); - converter.mapOutputSocket(output_plane, plane_mask_operation->getOutputSocket()); + converter.map_output_socket(output_plane, plane_mask_operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h index 307738fcaf0..16367423454 100644 --- a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h +++ b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h @@ -31,9 +31,9 @@ namespace blender::compositor { */ class PlaneTrackDeformNode : public Node { public: - PlaneTrackDeformNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + PlaneTrackDeformNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_PosterizeNode.cc b/source/blender/compositor/nodes/COM_PosterizeNode.cc index a69e4f17250..c055a954c01 100644 --- a/source/blender/compositor/nodes/COM_PosterizeNode.cc +++ b/source/blender/compositor/nodes/COM_PosterizeNode.cc @@ -21,20 +21,20 @@ namespace blender::compositor { -PosterizeNode::PosterizeNode(bNode *editorNode) : Node(editorNode) +PosterizeNode::PosterizeNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void PosterizeNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void PosterizeNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { PosterizeOperation *operation = new PosterizeOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_PosterizeNode.h b/source/blender/compositor/nodes/COM_PosterizeNode.h index bb9bef2bdd0..d19e598632a 100644 --- a/source/blender/compositor/nodes/COM_PosterizeNode.h +++ b/source/blender/compositor/nodes/COM_PosterizeNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class PosterizeNode : public Node { public: - PosterizeNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + PosterizeNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_RenderLayersNode.cc b/source/blender/compositor/nodes/COM_RenderLayersNode.cc index 87dccec7bfc..92033c3fbe8 100644 --- a/source/blender/compositor/nodes/COM_RenderLayersNode.cc +++ b/source/blender/compositor/nodes/COM_RenderLayersNode.cc @@ -23,66 +23,66 @@ namespace blender::compositor { -RenderLayersNode::RenderLayersNode(bNode *editorNode) : Node(editorNode) +RenderLayersNode::RenderLayersNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void RenderLayersNode::testSocketLink(NodeConverter &converter, - const CompositorContext &context, - NodeOutput *output, - RenderLayersProg *operation, - Scene *scene, - int layerId, - bool is_preview) const +void RenderLayersNode::test_socket_link(NodeConverter &converter, + const CompositorContext &context, + NodeOutput *output, + RenderLayersProg *operation, + Scene *scene, + int layer_id, + bool is_preview) const { - operation->setScene(scene); - operation->setLayerId(layerId); - operation->setRenderData(context.getRenderData()); - operation->setViewName(context.getViewName()); + operation->set_scene(scene); + operation->set_layer_id(layer_id); + operation->set_render_data(context.get_render_data()); + operation->set_view_name(context.get_view_name()); - converter.mapOutputSocket(output, operation->getOutputSocket()); - converter.addOperation(operation); + converter.map_output_socket(output, operation->get_output_socket()); + converter.add_operation(operation); if (is_preview) { /* only for image socket */ - converter.addPreview(operation->getOutputSocket()); + converter.add_preview(operation->get_output_socket()); } } -void RenderLayersNode::testRenderLink(NodeConverter &converter, - const CompositorContext &context, - Render *re) const +void RenderLayersNode::test_render_link(NodeConverter &converter, + const CompositorContext &context, + Render *re) const { - Scene *scene = (Scene *)this->getbNode()->id; - const short layerId = this->getbNode()->custom1; + Scene *scene = (Scene *)this->get_bnode()->id; + const short layer_id = this->get_bnode()->custom1; RenderResult *rr = RE_AcquireResultRead(re); if (rr == nullptr) { - missingRenderLink(converter); + missing_render_link(converter); return; } - ViewLayer *view_layer = (ViewLayer *)BLI_findlink(&scene->view_layers, layerId); + ViewLayer *view_layer = (ViewLayer *)BLI_findlink(&scene->view_layers, layer_id); if (view_layer == nullptr) { - missingRenderLink(converter); + missing_render_link(converter); return; } RenderLayer *rl = RE_GetRenderLayer(rr, view_layer->name); if (rl == nullptr) { - missingRenderLink(converter); + missing_render_link(converter); return; } - for (NodeOutput *output : getOutputSockets()) { - NodeImageLayer *storage = (NodeImageLayer *)output->getbNodeSocket()->storage; + for (NodeOutput *output : get_output_sockets()) { + NodeImageLayer *storage = (NodeImageLayer *)output->get_bnode_socket()->storage; RenderPass *rpass = (RenderPass *)BLI_findstring( &rl->passes, storage->pass_name, offsetof(RenderPass, name)); if (rpass == nullptr) { - missingSocketLink(converter, output); + missing_socket_link(converter, output); continue; } RenderLayersProg *operation; bool is_preview; if (STREQ(rpass->name, RE_PASSNAME_COMBINED) && - STREQ(output->getbNodeSocket()->name, "Alpha")) { + STREQ(output->get_bnode_socket()->name, "Alpha")) { operation = new RenderLayersAlphaProg(rpass->name, DataType::Value, rpass->channels); is_preview = false; } @@ -108,33 +108,33 @@ void RenderLayersNode::testRenderLink(NodeConverter &converter, break; } operation = new RenderLayersProg(rpass->name, type, rpass->channels); - is_preview = STREQ(output->getbNodeSocket()->name, "Image"); + is_preview = STREQ(output->get_bnode_socket()->name, "Image"); } - testSocketLink(converter, context, output, operation, scene, layerId, is_preview); + test_socket_link(converter, context, output, operation, scene, layer_id, is_preview); } } -void RenderLayersNode::missingSocketLink(NodeConverter &converter, NodeOutput *output) const +void RenderLayersNode::missing_socket_link(NodeConverter &converter, NodeOutput *output) const { NodeOperation *operation; - switch (output->getDataType()) { + switch (output->get_data_type()) { case DataType::Color: { const float color[4] = {0.0f, 0.0f, 0.0f, 0.0f}; SetColorOperation *color_operation = new SetColorOperation(); - color_operation->setChannels(color); + color_operation->set_channels(color); operation = color_operation; break; } case DataType::Vector: { const float vector[3] = {0.0f, 0.0f, 0.0f}; SetVectorOperation *vector_operation = new SetVectorOperation(); - vector_operation->setVector(vector); + vector_operation->set_vector(vector); operation = vector_operation; break; } case DataType::Value: { SetValueOperation *value_operation = new SetValueOperation(); - value_operation->setValue(0.0f); + value_operation->set_value(0.0f); operation = value_operation; break; } @@ -144,29 +144,29 @@ void RenderLayersNode::missingSocketLink(NodeConverter &converter, NodeOutput *o } } - converter.mapOutputSocket(output, operation->getOutputSocket()); - converter.addOperation(operation); + converter.map_output_socket(output, operation->get_output_socket()); + converter.add_operation(operation); } -void RenderLayersNode::missingRenderLink(NodeConverter &converter) const +void RenderLayersNode::missing_render_link(NodeConverter &converter) const { for (NodeOutput *output : outputs) { - missingSocketLink(converter, output); + missing_socket_link(converter, output); } } -void RenderLayersNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void RenderLayersNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - Scene *scene = (Scene *)this->getbNode()->id; + Scene *scene = (Scene *)this->get_bnode()->id; Render *re = (scene) ? RE_GetSceneRender(scene) : nullptr; if (re != nullptr) { - testRenderLink(converter, context, re); + test_render_link(converter, context, re); RE_ReleaseResult(re); } else { - missingRenderLink(converter); + missing_render_link(converter); } } diff --git a/source/blender/compositor/nodes/COM_RenderLayersNode.h b/source/blender/compositor/nodes/COM_RenderLayersNode.h index 4eb2427c8e0..33e61c58336 100644 --- a/source/blender/compositor/nodes/COM_RenderLayersNode.h +++ b/source/blender/compositor/nodes/COM_RenderLayersNode.h @@ -31,24 +31,24 @@ namespace blender::compositor { */ class RenderLayersNode : public Node { public: - RenderLayersNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + RenderLayersNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; private: - void testSocketLink(NodeConverter &converter, - const CompositorContext &context, - NodeOutput *output, - RenderLayersProg *operation, - Scene *scene, - int layerId, - bool is_preview) const; - void testRenderLink(NodeConverter &converter, - const CompositorContext &context, - Render *re) const; + void test_socket_link(NodeConverter &converter, + const CompositorContext &context, + NodeOutput *output, + RenderLayersProg *operation, + Scene *scene, + int layer_id, + bool is_preview) const; + void test_render_link(NodeConverter &converter, + const CompositorContext &context, + Render *re) const; - void missingSocketLink(NodeConverter &converter, NodeOutput *output) const; - void missingRenderLink(NodeConverter &converter) const; + void missing_socket_link(NodeConverter &converter, NodeOutput *output) const; + void missing_render_link(NodeConverter &converter) const; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_RotateNode.cc b/source/blender/compositor/nodes/COM_RotateNode.cc index 76c11a79d2f..64f49893335 100644 --- a/source/blender/compositor/nodes/COM_RotateNode.cc +++ b/source/blender/compositor/nodes/COM_RotateNode.cc @@ -23,39 +23,39 @@ namespace blender::compositor { -RotateNode::RotateNode(bNode *editorNode) : Node(editorNode) +RotateNode::RotateNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void RotateNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void RotateNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeInput *inputDegreeSocket = this->getInputSocket(1); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_socket = this->get_input_socket(0); + NodeInput *input_degree_socket = this->get_input_socket(1); + NodeOutput *output_socket = this->get_output_socket(0); RotateOperation *operation = new RotateOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - PixelSampler sampler = (PixelSampler)this->getbNode()->custom1; + PixelSampler sampler = (PixelSampler)this->get_bnode()->custom1; switch (context.get_execution_model()) { case eExecutionModel::Tiled: { SetSamplerOperation *sampler_op = new SetSamplerOperation(); - sampler_op->setSampler(sampler); - converter.addOperation(sampler_op); - converter.addLink(sampler_op->getOutputSocket(), operation->getInputSocket(0)); - converter.mapInputSocket(inputSocket, sampler_op->getInputSocket(0)); + sampler_op->set_sampler(sampler); + converter.add_operation(sampler_op); + converter.add_link(sampler_op->get_output_socket(), operation->get_input_socket(0)); + converter.map_input_socket(input_socket, sampler_op->get_input_socket(0)); break; } case eExecutionModel::FullFrame: { operation->set_sampler(sampler); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); break; } } - converter.mapInputSocket(inputDegreeSocket, operation->getInputSocket(1)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_degree_socket, operation->get_input_socket(1)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_RotateNode.h b/source/blender/compositor/nodes/COM_RotateNode.h index 5d8bcb2e3e4..fa50cd1f689 100644 --- a/source/blender/compositor/nodes/COM_RotateNode.h +++ b/source/blender/compositor/nodes/COM_RotateNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class RotateNode : public Node { public: - RotateNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + RotateNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ScaleNode.cc b/source/blender/compositor/nodes/COM_ScaleNode.cc index 1e33a8688a9..56f1d998db8 100644 --- a/source/blender/compositor/nodes/COM_ScaleNode.cc +++ b/source/blender/compositor/nodes/COM_ScaleNode.cc @@ -24,70 +24,72 @@ namespace blender::compositor { -ScaleNode::ScaleNode(bNode *editorNode) : Node(editorNode) +ScaleNode::ScaleNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ScaleNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void ScaleNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *bnode = this->getbNode(); + bNode *bnode = this->get_bnode(); - NodeInput *inputSocket = this->getInputSocket(0); - NodeInput *inputXSocket = this->getInputSocket(1); - NodeInput *inputYSocket = this->getInputSocket(2); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_socket = this->get_input_socket(0); + NodeInput *input_xsocket = this->get_input_socket(1); + NodeInput *input_ysocket = this->get_input_socket(2); + NodeOutput *output_socket = this->get_output_socket(0); switch (bnode->custom1) { case CMP_SCALE_RELATIVE: { ScaleRelativeOperation *operation = new ScaleRelativeOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapInputSocket(inputXSocket, operation->getInputSocket(1)); - converter.mapInputSocket(inputYSocket, operation->getInputSocket(2)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_input_socket(input_xsocket, operation->get_input_socket(1)); + converter.map_input_socket(input_ysocket, operation->get_input_socket(2)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); - operation->setVariableSize(inputXSocket->isLinked() || inputYSocket->isLinked()); + operation->set_variable_size(input_xsocket->is_linked() || input_ysocket->is_linked()); operation->set_scale_canvas_max_size(context.get_render_size() * 1.5f); break; } case CMP_SCALE_SCENEPERCENT: { - SetValueOperation *scaleFactorOperation = new SetValueOperation(); - scaleFactorOperation->setValue(context.getRenderPercentageAsFactor()); - converter.addOperation(scaleFactorOperation); + SetValueOperation *scale_factor_operation = new SetValueOperation(); + scale_factor_operation->set_value(context.get_render_percentage_as_factor()); + converter.add_operation(scale_factor_operation); ScaleRelativeOperation *operation = new ScaleRelativeOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1)); - converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(2)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.add_link(scale_factor_operation->get_output_socket(), + operation->get_input_socket(1)); + converter.add_link(scale_factor_operation->get_output_socket(), + operation->get_input_socket(2)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); - operation->setVariableSize(inputXSocket->isLinked() || inputYSocket->isLinked()); + operation->set_variable_size(input_xsocket->is_linked() || input_ysocket->is_linked()); operation->set_scale_canvas_max_size(context.get_render_size() * 1.5f); break; } case CMP_SCALE_RENDERPERCENT: { - const RenderData *rd = context.getRenderData(); - const float render_size_factor = context.getRenderPercentageAsFactor(); + const RenderData *rd = context.get_render_data(); + const float render_size_factor = context.get_render_percentage_as_factor(); ScaleFixedSizeOperation *operation = new ScaleFixedSizeOperation(); /* framing options */ - operation->setIsAspect((bnode->custom2 & CMP_SCALE_RENDERSIZE_FRAME_ASPECT) != 0); - operation->setIsCrop((bnode->custom2 & CMP_SCALE_RENDERSIZE_FRAME_CROP) != 0); - operation->setOffset(bnode->custom3, bnode->custom4); - operation->setNewWidth(rd->xsch * render_size_factor); - operation->setNewHeight(rd->ysch * render_size_factor); - converter.addOperation(operation); + operation->set_is_aspect((bnode->custom2 & CMP_SCALE_RENDERSIZE_FRAME_ASPECT) != 0); + operation->set_is_crop((bnode->custom2 & CMP_SCALE_RENDERSIZE_FRAME_CROP) != 0); + operation->set_offset(bnode->custom3, bnode->custom4); + operation->set_new_width(rd->xsch * render_size_factor); + operation->set_new_height(rd->ysch * render_size_factor); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); - operation->setVariableSize(inputXSocket->isLinked() || inputYSocket->isLinked()); + operation->set_variable_size(input_xsocket->is_linked() || input_ysocket->is_linked()); operation->set_scale_canvas_max_size(context.get_render_size() * 3.0f); break; @@ -95,14 +97,14 @@ void ScaleNode::convertToOperations(NodeConverter &converter, case CMP_SCALE_ABSOLUTE: { /* TODO: what is the use of this one.... perhaps some issues when the ui was updated... */ ScaleAbsoluteOperation *operation = new ScaleAbsoluteOperation(); - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapInputSocket(inputXSocket, operation->getInputSocket(1)); - converter.mapInputSocket(inputYSocket, operation->getInputSocket(2)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_input_socket(input_xsocket, operation->get_input_socket(1)); + converter.map_input_socket(input_ysocket, operation->get_input_socket(2)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); - operation->setVariableSize(inputXSocket->isLinked() || inputYSocket->isLinked()); + operation->set_variable_size(input_xsocket->is_linked() || input_ysocket->is_linked()); operation->set_scale_canvas_max_size(context.get_render_size() * 1.5f); break; diff --git a/source/blender/compositor/nodes/COM_ScaleNode.h b/source/blender/compositor/nodes/COM_ScaleNode.h index 186ffa8bdce..7800a7acb8b 100644 --- a/source/blender/compositor/nodes/COM_ScaleNode.h +++ b/source/blender/compositor/nodes/COM_ScaleNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ScaleNode : public Node { public: - ScaleNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ScaleNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SeparateColorNode.cc b/source/blender/compositor/nodes/COM_SeparateColorNode.cc index fcaf52c701d..046a813895e 100644 --- a/source/blender/compositor/nodes/COM_SeparateColorNode.cc +++ b/source/blender/compositor/nodes/COM_SeparateColorNode.cc @@ -22,102 +22,102 @@ namespace blender::compositor { -SeparateColorNode::SeparateColorNode(bNode *editorNode) : Node(editorNode) +SeparateColorNode::SeparateColorNode(bNode *editor_node) : Node(editor_node) { } -void SeparateColorNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void SeparateColorNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeInput *imageSocket = this->getInputSocket(0); - NodeOutput *outputRSocket = this->getOutputSocket(0); - NodeOutput *outputGSocket = this->getOutputSocket(1); - NodeOutput *outputBSocket = this->getOutputSocket(2); - NodeOutput *outputASocket = this->getOutputSocket(3); + NodeInput *image_socket = this->get_input_socket(0); + NodeOutput *output_rsocket = this->get_output_socket(0); + NodeOutput *output_gsocket = this->get_output_socket(1); + NodeOutput *output_bsocket = this->get_output_socket(2); + NodeOutput *output_asocket = this->get_output_socket(3); - NodeOperation *color_conv = getColorConverter(context); + NodeOperation *color_conv = get_color_converter(context); if (color_conv) { - converter.addOperation(color_conv); + converter.add_operation(color_conv); - converter.mapInputSocket(imageSocket, color_conv->getInputSocket(0)); + converter.map_input_socket(image_socket, color_conv->get_input_socket(0)); } { SeparateChannelOperation *operation = new SeparateChannelOperation(); - operation->setChannel(0); - converter.addOperation(operation); + operation->set_channel(0); + converter.add_operation(operation); if (color_conv) { - converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); + converter.add_link(color_conv->get_output_socket(), operation->get_input_socket(0)); } else { - converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); + converter.map_input_socket(image_socket, operation->get_input_socket(0)); } - converter.mapOutputSocket(outputRSocket, operation->getOutputSocket(0)); + converter.map_output_socket(output_rsocket, operation->get_output_socket(0)); } { SeparateChannelOperation *operation = new SeparateChannelOperation(); - operation->setChannel(1); - converter.addOperation(operation); + operation->set_channel(1); + converter.add_operation(operation); if (color_conv) { - converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); + converter.add_link(color_conv->get_output_socket(), operation->get_input_socket(0)); } else { - converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); + converter.map_input_socket(image_socket, operation->get_input_socket(0)); } - converter.mapOutputSocket(outputGSocket, operation->getOutputSocket(0)); + converter.map_output_socket(output_gsocket, operation->get_output_socket(0)); } { SeparateChannelOperation *operation = new SeparateChannelOperation(); - operation->setChannel(2); - converter.addOperation(operation); + operation->set_channel(2); + converter.add_operation(operation); if (color_conv) { - converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); + converter.add_link(color_conv->get_output_socket(), operation->get_input_socket(0)); } else { - converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); + converter.map_input_socket(image_socket, operation->get_input_socket(0)); } - converter.mapOutputSocket(outputBSocket, operation->getOutputSocket(0)); + converter.map_output_socket(output_bsocket, operation->get_output_socket(0)); } { SeparateChannelOperation *operation = new SeparateChannelOperation(); - operation->setChannel(3); - converter.addOperation(operation); + operation->set_channel(3); + converter.add_operation(operation); if (color_conv) { - converter.addLink(color_conv->getOutputSocket(), operation->getInputSocket(0)); + converter.add_link(color_conv->get_output_socket(), operation->get_input_socket(0)); } else { - converter.mapInputSocket(imageSocket, operation->getInputSocket(0)); + converter.map_input_socket(image_socket, operation->get_input_socket(0)); } - converter.mapOutputSocket(outputASocket, operation->getOutputSocket(0)); + converter.map_output_socket(output_asocket, operation->get_output_socket(0)); } } -NodeOperation *SeparateRGBANode::getColorConverter(const CompositorContext & /*context*/) const +NodeOperation *SeparateRGBANode::get_color_converter(const CompositorContext & /*context*/) const { return nullptr; /* no conversion needed */ } -NodeOperation *SeparateHSVANode::getColorConverter(const CompositorContext & /*context*/) const +NodeOperation *SeparateHSVANode::get_color_converter(const CompositorContext & /*context*/) const { return new ConvertRGBToHSVOperation(); } -NodeOperation *SeparateYCCANode::getColorConverter(const CompositorContext & /*context*/) const +NodeOperation *SeparateYCCANode::get_color_converter(const CompositorContext & /*context*/) const { ConvertRGBToYCCOperation *operation = new ConvertRGBToYCCOperation(); - bNode *editorNode = this->getbNode(); - operation->setMode(editorNode->custom1); + bNode *editor_node = this->get_bnode(); + operation->set_mode(editor_node->custom1); return operation; } -NodeOperation *SeparateYUVANode::getColorConverter(const CompositorContext & /*context*/) const +NodeOperation *SeparateYUVANode::get_color_converter(const CompositorContext & /*context*/) const { return new ConvertRGBToYUVOperation(); } diff --git a/source/blender/compositor/nodes/COM_SeparateColorNode.h b/source/blender/compositor/nodes/COM_SeparateColorNode.h index eaf543df51f..0dfcd676772 100644 --- a/source/blender/compositor/nodes/COM_SeparateColorNode.h +++ b/source/blender/compositor/nodes/COM_SeparateColorNode.h @@ -24,48 +24,48 @@ namespace blender::compositor { class SeparateColorNode : public Node { public: - SeparateColorNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + SeparateColorNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; protected: - virtual NodeOperation *getColorConverter(const CompositorContext &context) const = 0; + virtual NodeOperation *get_color_converter(const CompositorContext &context) const = 0; }; class SeparateRGBANode : public SeparateColorNode { public: - SeparateRGBANode(bNode *editorNode) : SeparateColorNode(editorNode) + SeparateRGBANode(bNode *editor_node) : SeparateColorNode(editor_node) { } - NodeOperation *getColorConverter(const CompositorContext &context) const override; + NodeOperation *get_color_converter(const CompositorContext &context) const override; }; class SeparateHSVANode : public SeparateColorNode { public: - SeparateHSVANode(bNode *editorNode) : SeparateColorNode(editorNode) + SeparateHSVANode(bNode *editor_node) : SeparateColorNode(editor_node) { } - NodeOperation *getColorConverter(const CompositorContext &context) const override; + NodeOperation *get_color_converter(const CompositorContext &context) const override; }; class SeparateYCCANode : public SeparateColorNode { public: - SeparateYCCANode(bNode *editorNode) : SeparateColorNode(editorNode) + SeparateYCCANode(bNode *editor_node) : SeparateColorNode(editor_node) { } - NodeOperation *getColorConverter(const CompositorContext &context) const override; + NodeOperation *get_color_converter(const CompositorContext &context) const override; }; class SeparateYUVANode : public SeparateColorNode { public: - SeparateYUVANode(bNode *editorNode) : SeparateColorNode(editorNode) + SeparateYUVANode(bNode *editor_node) : SeparateColorNode(editor_node) { } - NodeOperation *getColorConverter(const CompositorContext &context) const override; + NodeOperation *get_color_converter(const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SetAlphaNode.cc b/source/blender/compositor/nodes/COM_SetAlphaNode.cc index a3a8472ccc9..58b8df98bc8 100644 --- a/source/blender/compositor/nodes/COM_SetAlphaNode.cc +++ b/source/blender/compositor/nodes/COM_SetAlphaNode.cc @@ -22,11 +22,11 @@ namespace blender::compositor { -void SetAlphaNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void SetAlphaNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - const bNode *editorNode = this->getbNode(); - const NodeSetAlpha *storage = static_cast<const NodeSetAlpha *>(editorNode->storage); + const bNode *editor_node = this->get_bnode(); + const NodeSetAlpha *storage = static_cast<const NodeSetAlpha *>(editor_node->storage); NodeOperation *operation = nullptr; switch (storage->mode) { case CMP_NODE_SETALPHA_MODE_APPLY: @@ -37,15 +37,15 @@ void SetAlphaNode::convertToOperations(NodeConverter &converter, break; } - if (!this->getInputSocket(0)->isLinked() && this->getInputSocket(1)->isLinked()) { + if (!this->get_input_socket(0)->is_linked() && this->get_input_socket(1)->is_linked()) { operation->set_canvas_input_index(1); } - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SetAlphaNode.h b/source/blender/compositor/nodes/COM_SetAlphaNode.h index c8d340eb64b..9e369838bbe 100644 --- a/source/blender/compositor/nodes/COM_SetAlphaNode.h +++ b/source/blender/compositor/nodes/COM_SetAlphaNode.h @@ -28,11 +28,11 @@ namespace blender::compositor { */ class SetAlphaNode : public Node { public: - SetAlphaNode(bNode *editorNode) : Node(editorNode) + SetAlphaNode(bNode *editor_node) : Node(editor_node) { } - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SocketProxyNode.cc b/source/blender/compositor/nodes/COM_SocketProxyNode.cc index 1109dbaf735..e7c8a90a48b 100644 --- a/source/blender/compositor/nodes/COM_SocketProxyNode.cc +++ b/source/blender/compositor/nodes/COM_SocketProxyNode.cc @@ -22,81 +22,82 @@ namespace blender::compositor { -SocketProxyNode::SocketProxyNode(bNode *editorNode, - bNodeSocket *editorInput, - bNodeSocket *editorOutput, +SocketProxyNode::SocketProxyNode(bNode *editor_node, + bNodeSocket *editor_input, + bNodeSocket *editor_output, bool use_conversion) - : Node(editorNode, false), use_conversion_(use_conversion) + : Node(editor_node, false), use_conversion_(use_conversion) { DataType dt; dt = DataType::Value; - if (editorInput->type == SOCK_RGBA) { + if (editor_input->type == SOCK_RGBA) { dt = DataType::Color; } - if (editorInput->type == SOCK_VECTOR) { + if (editor_input->type == SOCK_VECTOR) { dt = DataType::Vector; } - this->addInputSocket(dt, editorInput); + this->add_input_socket(dt, editor_input); dt = DataType::Value; - if (editorOutput->type == SOCK_RGBA) { + if (editor_output->type == SOCK_RGBA) { dt = DataType::Color; } - if (editorOutput->type == SOCK_VECTOR) { + if (editor_output->type == SOCK_VECTOR) { dt = DataType::Vector; } - this->addOutputSocket(dt, editorOutput); + this->add_output_socket(dt, editor_output); } -void SocketProxyNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void SocketProxyNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeOperationOutput *proxy_output = converter.addInputProxy(getInputSocket(0), use_conversion_); - converter.mapOutputSocket(getOutputSocket(), proxy_output); + NodeOperationOutput *proxy_output = converter.add_input_proxy(get_input_socket(0), + use_conversion_); + converter.map_output_socket(get_output_socket(), proxy_output); } -SocketBufferNode::SocketBufferNode(bNode *editorNode, - bNodeSocket *editorInput, - bNodeSocket *editorOutput) - : Node(editorNode, false) +SocketBufferNode::SocketBufferNode(bNode *editor_node, + bNodeSocket *editor_input, + bNodeSocket *editor_output) + : Node(editor_node, false) { DataType dt; dt = DataType::Value; - if (editorInput->type == SOCK_RGBA) { + if (editor_input->type == SOCK_RGBA) { dt = DataType::Color; } - if (editorInput->type == SOCK_VECTOR) { + if (editor_input->type == SOCK_VECTOR) { dt = DataType::Vector; } - this->addInputSocket(dt, editorInput); + this->add_input_socket(dt, editor_input); dt = DataType::Value; - if (editorOutput->type == SOCK_RGBA) { + if (editor_output->type == SOCK_RGBA) { dt = DataType::Color; } - if (editorOutput->type == SOCK_VECTOR) { + if (editor_output->type == SOCK_VECTOR) { dt = DataType::Vector; } - this->addOutputSocket(dt, editorOutput); + this->add_output_socket(dt, editor_output); } -void SocketBufferNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void SocketBufferNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeOutput *output = this->getOutputSocket(0); - NodeInput *input = this->getInputSocket(0); + NodeOutput *output = this->get_output_socket(0); + NodeInput *input = this->get_input_socket(0); - DataType datatype = output->getDataType(); - WriteBufferOperation *writeOperation = new WriteBufferOperation(datatype); - ReadBufferOperation *readOperation = new ReadBufferOperation(datatype); - readOperation->setMemoryProxy(writeOperation->getMemoryProxy()); - converter.addOperation(writeOperation); - converter.addOperation(readOperation); + DataType datatype = output->get_data_type(); + WriteBufferOperation *write_operation = new WriteBufferOperation(datatype); + ReadBufferOperation *read_operation = new ReadBufferOperation(datatype); + read_operation->set_memory_proxy(write_operation->get_memory_proxy()); + converter.add_operation(write_operation); + converter.add_operation(read_operation); - converter.mapInputSocket(input, writeOperation->getInputSocket(0)); - converter.mapOutputSocket(output, readOperation->getOutputSocket()); + converter.map_input_socket(input, write_operation->get_input_socket(0)); + converter.map_output_socket(output, read_operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SocketProxyNode.h b/source/blender/compositor/nodes/COM_SocketProxyNode.h index 2b584b344f0..50079ed4718 100644 --- a/source/blender/compositor/nodes/COM_SocketProxyNode.h +++ b/source/blender/compositor/nodes/COM_SocketProxyNode.h @@ -28,18 +28,18 @@ namespace blender::compositor { */ class SocketProxyNode : public Node { public: - SocketProxyNode(bNode *editorNode, - bNodeSocket *editorInput, - bNodeSocket *editorOutput, + SocketProxyNode(bNode *editor_node, + bNodeSocket *editor_input, + bNodeSocket *editor_output, bool use_conversion); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; - bool getUseConversion() const + bool get_use_conversion() const { return use_conversion_; } - void setUseConversion(bool use_conversion) + void set_use_conversion(bool use_conversion) { use_conversion_ = use_conversion; } @@ -51,9 +51,9 @@ class SocketProxyNode : public Node { class SocketBufferNode : public Node { public: - SocketBufferNode(bNode *editorNode, bNodeSocket *editorInput, bNodeSocket *editorOutput); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + SocketBufferNode(bNode *editor_node, bNodeSocket *editor_input, bNodeSocket *editor_output); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SplitViewerNode.cc b/source/blender/compositor/nodes/COM_SplitViewerNode.cc index bdc927c59a5..c3234fad0fb 100644 --- a/source/blender/compositor/nodes/COM_SplitViewerNode.cc +++ b/source/blender/compositor/nodes/COM_SplitViewerNode.cc @@ -23,52 +23,53 @@ namespace blender::compositor { -SplitViewerNode::SplitViewerNode(bNode *editorNode) : Node(editorNode) +SplitViewerNode::SplitViewerNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void SplitViewerNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void SplitViewerNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - bool do_output = (editorNode->flag & NODE_DO_OUTPUT_RECALC || context.isRendering()) && - (editorNode->flag & NODE_DO_OUTPUT); + bNode *editor_node = this->get_bnode(); + bool do_output = (editor_node->flag & NODE_DO_OUTPUT_RECALC || context.is_rendering()) && + (editor_node->flag & NODE_DO_OUTPUT); - NodeInput *image1Socket = this->getInputSocket(0); - NodeInput *image2Socket = this->getInputSocket(1); - Image *image = (Image *)this->getbNode()->id; - ImageUser *imageUser = (ImageUser *)this->getbNode()->storage; + NodeInput *image1Socket = this->get_input_socket(0); + NodeInput *image2Socket = this->get_input_socket(1); + Image *image = (Image *)this->get_bnode()->id; + ImageUser *image_user = (ImageUser *)this->get_bnode()->storage; - SplitOperation *splitViewerOperation = new SplitOperation(); - splitViewerOperation->setSplitPercentage(this->getbNode()->custom1); - splitViewerOperation->setXSplit(!this->getbNode()->custom2); + SplitOperation *split_viewer_operation = new SplitOperation(); + split_viewer_operation->set_split_percentage(this->get_bnode()->custom1); + split_viewer_operation->set_xsplit(!this->get_bnode()->custom2); - converter.addOperation(splitViewerOperation); - converter.mapInputSocket(image1Socket, splitViewerOperation->getInputSocket(0)); - converter.mapInputSocket(image2Socket, splitViewerOperation->getInputSocket(1)); + converter.add_operation(split_viewer_operation); + converter.map_input_socket(image1Socket, split_viewer_operation->get_input_socket(0)); + converter.map_input_socket(image2Socket, split_viewer_operation->get_input_socket(1)); - ViewerOperation *viewerOperation = new ViewerOperation(); - viewerOperation->setImage(image); - viewerOperation->setImageUser(imageUser); - viewerOperation->setViewSettings(context.getViewSettings()); - viewerOperation->setDisplaySettings(context.getDisplaySettings()); - viewerOperation->setRenderData(context.getRenderData()); - viewerOperation->setViewName(context.getViewName()); + ViewerOperation *viewer_operation = new ViewerOperation(); + viewer_operation->set_image(image); + viewer_operation->set_image_user(image_user); + viewer_operation->set_view_settings(context.get_view_settings()); + viewer_operation->set_display_settings(context.get_display_settings()); + viewer_operation->set_render_data(context.get_render_data()); + viewer_operation->set_view_name(context.get_view_name()); /* defaults - the viewer node has these options but not exposed for split view * we could use the split to define an area of interest on one axis at least */ - viewerOperation->setChunkOrder(ChunkOrdering::Default); - viewerOperation->setCenterX(0.5f); - viewerOperation->setCenterY(0.5f); + viewer_operation->set_chunk_order(ChunkOrdering::Default); + viewer_operation->setCenterX(0.5f); + viewer_operation->setCenterY(0.5f); - converter.addOperation(viewerOperation); - converter.addLink(splitViewerOperation->getOutputSocket(), viewerOperation->getInputSocket(0)); + converter.add_operation(viewer_operation); + converter.add_link(split_viewer_operation->get_output_socket(), + viewer_operation->get_input_socket(0)); - converter.addPreview(splitViewerOperation->getOutputSocket()); + converter.add_preview(split_viewer_operation->get_output_socket()); if (do_output) { - converter.registerViewer(viewerOperation); + converter.register_viewer(viewer_operation); } } diff --git a/source/blender/compositor/nodes/COM_SplitViewerNode.h b/source/blender/compositor/nodes/COM_SplitViewerNode.h index 8a42775eb0d..579eca9d8e1 100644 --- a/source/blender/compositor/nodes/COM_SplitViewerNode.h +++ b/source/blender/compositor/nodes/COM_SplitViewerNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class SplitViewerNode : public Node { public: - SplitViewerNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + SplitViewerNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_Stabilize2dNode.cc b/source/blender/compositor/nodes/COM_Stabilize2dNode.cc index 48eeb337842..9892c4f5c05 100644 --- a/source/blender/compositor/nodes/COM_Stabilize2dNode.cc +++ b/source/blender/compositor/nodes/COM_Stabilize2dNode.cc @@ -25,145 +25,160 @@ namespace blender::compositor { -Stabilize2dNode::Stabilize2dNode(bNode *editorNode) : Node(editorNode) +Stabilize2dNode::Stabilize2dNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void Stabilize2dNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void Stabilize2dNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - NodeInput *imageInput = this->getInputSocket(0); - MovieClip *clip = (MovieClip *)editorNode->id; - bool invert = (editorNode->custom2 & CMP_NODEFLAG_STABILIZE_INVERSE) != 0; - const PixelSampler sampler = (PixelSampler)editorNode->custom1; - - MovieClipAttributeOperation *scaleAttribute = new MovieClipAttributeOperation(); - MovieClipAttributeOperation *angleAttribute = new MovieClipAttributeOperation(); - MovieClipAttributeOperation *xAttribute = new MovieClipAttributeOperation(); - MovieClipAttributeOperation *yAttribute = new MovieClipAttributeOperation(); - - scaleAttribute->setAttribute(MCA_SCALE); - scaleAttribute->setFramenumber(context.getFramenumber()); - scaleAttribute->setMovieClip(clip); - scaleAttribute->setInvert(invert); - - angleAttribute->setAttribute(MCA_ANGLE); - angleAttribute->setFramenumber(context.getFramenumber()); - angleAttribute->setMovieClip(clip); - angleAttribute->setInvert(invert); - - xAttribute->setAttribute(MCA_X); - xAttribute->setFramenumber(context.getFramenumber()); - xAttribute->setMovieClip(clip); - xAttribute->setInvert(invert); - - yAttribute->setAttribute(MCA_Y); - yAttribute->setFramenumber(context.getFramenumber()); - yAttribute->setMovieClip(clip); - yAttribute->setInvert(invert); - - converter.addOperation(scaleAttribute); - converter.addOperation(angleAttribute); - converter.addOperation(xAttribute); - converter.addOperation(yAttribute); + bNode *editor_node = this->get_bnode(); + NodeInput *image_input = this->get_input_socket(0); + MovieClip *clip = (MovieClip *)editor_node->id; + bool invert = (editor_node->custom2 & CMP_NODEFLAG_STABILIZE_INVERSE) != 0; + const PixelSampler sampler = (PixelSampler)editor_node->custom1; + + MovieClipAttributeOperation *scale_attribute = new MovieClipAttributeOperation(); + MovieClipAttributeOperation *angle_attribute = new MovieClipAttributeOperation(); + MovieClipAttributeOperation *x_attribute = new MovieClipAttributeOperation(); + MovieClipAttributeOperation *y_attribute = new MovieClipAttributeOperation(); + + scale_attribute->set_attribute(MCA_SCALE); + scale_attribute->set_framenumber(context.get_framenumber()); + scale_attribute->set_movie_clip(clip); + scale_attribute->set_invert(invert); + + angle_attribute->set_attribute(MCA_ANGLE); + angle_attribute->set_framenumber(context.get_framenumber()); + angle_attribute->set_movie_clip(clip); + angle_attribute->set_invert(invert); + + x_attribute->set_attribute(MCA_X); + x_attribute->set_framenumber(context.get_framenumber()); + x_attribute->set_movie_clip(clip); + x_attribute->set_invert(invert); + + y_attribute->set_attribute(MCA_Y); + y_attribute->set_framenumber(context.get_framenumber()); + y_attribute->set_movie_clip(clip); + y_attribute->set_invert(invert); + + converter.add_operation(scale_attribute); + converter.add_operation(angle_attribute); + converter.add_operation(x_attribute); + converter.add_operation(y_attribute); switch (context.get_execution_model()) { case eExecutionModel::Tiled: { - ScaleRelativeOperation *scaleOperation = new ScaleRelativeOperation(); - scaleOperation->setSampler(sampler); - RotateOperation *rotateOperation = new RotateOperation(); - rotateOperation->setDoDegree2RadConversion(false); - TranslateOperation *translateOperation = new TranslateOperation(); + ScaleRelativeOperation *scale_operation = new ScaleRelativeOperation(); + scale_operation->set_sampler(sampler); + RotateOperation *rotate_operation = new RotateOperation(); + rotate_operation->set_do_degree2_rad_conversion(false); + TranslateOperation *translate_operation = new TranslateOperation(); SetSamplerOperation *psoperation = new SetSamplerOperation(); - psoperation->setSampler(sampler); + psoperation->set_sampler(sampler); - converter.addOperation(scaleOperation); - converter.addOperation(translateOperation); - converter.addOperation(rotateOperation); - converter.addOperation(psoperation); + converter.add_operation(scale_operation); + converter.add_operation(translate_operation); + converter.add_operation(rotate_operation); + converter.add_operation(psoperation); - converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1)); - converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2)); + converter.add_link(scale_attribute->get_output_socket(), + scale_operation->get_input_socket(1)); + converter.add_link(scale_attribute->get_output_socket(), + scale_operation->get_input_socket(2)); - converter.addLink(angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1)); + converter.add_link(angle_attribute->get_output_socket(), + rotate_operation->get_input_socket(1)); - converter.addLink(xAttribute->getOutputSocket(), translateOperation->getInputSocket(1)); - converter.addLink(yAttribute->getOutputSocket(), translateOperation->getInputSocket(2)); + converter.add_link(x_attribute->get_output_socket(), + translate_operation->get_input_socket(1)); + converter.add_link(y_attribute->get_output_socket(), + translate_operation->get_input_socket(2)); - converter.mapOutputSocket(getOutputSocket(), psoperation->getOutputSocket()); + converter.map_output_socket(get_output_socket(), psoperation->get_output_socket()); if (invert) { /* Translate -> Rotate -> Scale. */ - converter.mapInputSocket(imageInput, translateOperation->getInputSocket(0)); + converter.map_input_socket(image_input, translate_operation->get_input_socket(0)); - converter.addLink(translateOperation->getOutputSocket(), - rotateOperation->getInputSocket(0)); - converter.addLink(rotateOperation->getOutputSocket(), scaleOperation->getInputSocket(0)); + converter.add_link(translate_operation->get_output_socket(), + rotate_operation->get_input_socket(0)); + converter.add_link(rotate_operation->get_output_socket(), + scale_operation->get_input_socket(0)); - converter.addLink(scaleOperation->getOutputSocket(), psoperation->getInputSocket(0)); + converter.add_link(scale_operation->get_output_socket(), psoperation->get_input_socket(0)); } else { /* Scale -> Rotate -> Translate. */ - converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0)); + converter.map_input_socket(image_input, scale_operation->get_input_socket(0)); - converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0)); - converter.addLink(rotateOperation->getOutputSocket(), - translateOperation->getInputSocket(0)); + converter.add_link(scale_operation->get_output_socket(), + rotate_operation->get_input_socket(0)); + converter.add_link(rotate_operation->get_output_socket(), + translate_operation->get_input_socket(0)); - converter.addLink(translateOperation->getOutputSocket(), psoperation->getInputSocket(0)); + converter.add_link(translate_operation->get_output_socket(), + psoperation->get_input_socket(0)); } break; } case eExecutionModel::FullFrame: { - ScaleRelativeOperation *scaleOperation = new ScaleRelativeOperation(); - scaleOperation->setSampler(sampler); - RotateOperation *rotateOperation = new RotateOperation(); - rotateOperation->setDoDegree2RadConversion(false); - rotateOperation->set_sampler(sampler); - TranslateOperation *translateOperation = new TranslateCanvasOperation(); - - converter.addOperation(scaleOperation); - converter.addOperation(translateOperation); - converter.addOperation(rotateOperation); - - converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(1)); - converter.addLink(scaleAttribute->getOutputSocket(), scaleOperation->getInputSocket(2)); - - converter.addLink(angleAttribute->getOutputSocket(), rotateOperation->getInputSocket(1)); - - converter.addLink(xAttribute->getOutputSocket(), translateOperation->getInputSocket(1)); - converter.addLink(yAttribute->getOutputSocket(), translateOperation->getInputSocket(2)); + ScaleRelativeOperation *scale_operation = new ScaleRelativeOperation(); + scale_operation->set_sampler(sampler); + RotateOperation *rotate_operation = new RotateOperation(); + rotate_operation->set_do_degree2_rad_conversion(false); + rotate_operation->set_sampler(sampler); + TranslateOperation *translate_operation = new TranslateCanvasOperation(); + + converter.add_operation(scale_operation); + converter.add_operation(translate_operation); + converter.add_operation(rotate_operation); + + converter.add_link(scale_attribute->get_output_socket(), + scale_operation->get_input_socket(1)); + converter.add_link(scale_attribute->get_output_socket(), + scale_operation->get_input_socket(2)); + + converter.add_link(angle_attribute->get_output_socket(), + rotate_operation->get_input_socket(1)); + + converter.add_link(x_attribute->get_output_socket(), + translate_operation->get_input_socket(1)); + converter.add_link(y_attribute->get_output_socket(), + translate_operation->get_input_socket(2)); NodeOperationInput *stabilization_socket = nullptr; if (invert) { /* Translate -> Rotate -> Scale. */ - stabilization_socket = translateOperation->getInputSocket(0); - converter.mapInputSocket(imageInput, translateOperation->getInputSocket(0)); + stabilization_socket = translate_operation->get_input_socket(0); + converter.map_input_socket(image_input, translate_operation->get_input_socket(0)); - converter.addLink(translateOperation->getOutputSocket(), - rotateOperation->getInputSocket(0)); - converter.addLink(rotateOperation->getOutputSocket(), scaleOperation->getInputSocket(0)); + converter.add_link(translate_operation->get_output_socket(), + rotate_operation->get_input_socket(0)); + converter.add_link(rotate_operation->get_output_socket(), + scale_operation->get_input_socket(0)); - converter.mapOutputSocket(getOutputSocket(), scaleOperation->getOutputSocket()); + converter.map_output_socket(get_output_socket(), scale_operation->get_output_socket()); } else { /* Scale -> Rotate -> Translate. */ - stabilization_socket = scaleOperation->getInputSocket(0); - converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0)); + stabilization_socket = scale_operation->get_input_socket(0); + converter.map_input_socket(image_input, scale_operation->get_input_socket(0)); - converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0)); - converter.addLink(rotateOperation->getOutputSocket(), - translateOperation->getInputSocket(0)); + converter.add_link(scale_operation->get_output_socket(), + rotate_operation->get_input_socket(0)); + converter.add_link(rotate_operation->get_output_socket(), + translate_operation->get_input_socket(0)); - converter.mapOutputSocket(getOutputSocket(), translateOperation->getOutputSocket()); + converter.map_output_socket(get_output_socket(), translate_operation->get_output_socket()); } - xAttribute->set_socket_input_resolution_for_stabilization(stabilization_socket); - yAttribute->set_socket_input_resolution_for_stabilization(stabilization_socket); - scaleAttribute->set_socket_input_resolution_for_stabilization(stabilization_socket); - angleAttribute->set_socket_input_resolution_for_stabilization(stabilization_socket); + x_attribute->set_socket_input_resolution_for_stabilization(stabilization_socket); + y_attribute->set_socket_input_resolution_for_stabilization(stabilization_socket); + scale_attribute->set_socket_input_resolution_for_stabilization(stabilization_socket); + angle_attribute->set_socket_input_resolution_for_stabilization(stabilization_socket); break; } } diff --git a/source/blender/compositor/nodes/COM_Stabilize2dNode.h b/source/blender/compositor/nodes/COM_Stabilize2dNode.h index 34ed8871e33..0c6afb272e9 100644 --- a/source/blender/compositor/nodes/COM_Stabilize2dNode.h +++ b/source/blender/compositor/nodes/COM_Stabilize2dNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class Stabilize2dNode : public Node { public: - Stabilize2dNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + Stabilize2dNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SunBeamsNode.cc b/source/blender/compositor/nodes/COM_SunBeamsNode.cc index 1e5aa0b8020..ba42b79f307 100644 --- a/source/blender/compositor/nodes/COM_SunBeamsNode.cc +++ b/source/blender/compositor/nodes/COM_SunBeamsNode.cc @@ -20,24 +20,24 @@ namespace blender::compositor { -SunBeamsNode::SunBeamsNode(bNode *editorNode) : Node(editorNode) +SunBeamsNode::SunBeamsNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void SunBeamsNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void SunBeamsNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *inputSocket = this->getInputSocket(0); - NodeOutput *outputSocket = this->getOutputSocket(0); - NodeSunBeams *data = (NodeSunBeams *)getbNode()->storage; + NodeInput *input_socket = this->get_input_socket(0); + NodeOutput *output_socket = this->get_output_socket(0); + NodeSunBeams *data = (NodeSunBeams *)get_bnode()->storage; SunBeamsOperation *operation = new SunBeamsOperation(); - operation->setData(*data); - converter.addOperation(operation); + operation->set_data(*data); + converter.add_operation(operation); - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SunBeamsNode.h b/source/blender/compositor/nodes/COM_SunBeamsNode.h index 8b68d3f4cb5..478b5ce39f8 100644 --- a/source/blender/compositor/nodes/COM_SunBeamsNode.h +++ b/source/blender/compositor/nodes/COM_SunBeamsNode.h @@ -27,9 +27,9 @@ namespace blender::compositor { */ class SunBeamsNode : public Node { public: - SunBeamsNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + SunBeamsNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SwitchNode.cc b/source/blender/compositor/nodes/COM_SwitchNode.cc index 4006d10dafb..d0bc0f6dea2 100644 --- a/source/blender/compositor/nodes/COM_SwitchNode.cc +++ b/source/blender/compositor/nodes/COM_SwitchNode.cc @@ -20,25 +20,25 @@ namespace blender::compositor { -SwitchNode::SwitchNode(bNode *editorNode) : Node(editorNode) +SwitchNode::SwitchNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void SwitchNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void SwitchNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - bool condition = this->getbNode()->custom1; + bool condition = this->get_bnode()->custom1; NodeOperationOutput *result; if (!condition) { - result = converter.addInputProxy(getInputSocket(0), false); + result = converter.add_input_proxy(get_input_socket(0), false); } else { - result = converter.addInputProxy(getInputSocket(1), false); + result = converter.add_input_proxy(get_input_socket(1), false); } - converter.mapOutputSocket(getOutputSocket(0), result); + converter.map_output_socket(get_output_socket(0), result); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SwitchNode.h b/source/blender/compositor/nodes/COM_SwitchNode.h index aa6caa2e59f..eafdeb4ac74 100644 --- a/source/blender/compositor/nodes/COM_SwitchNode.h +++ b/source/blender/compositor/nodes/COM_SwitchNode.h @@ -30,9 +30,9 @@ namespace blender::compositor { */ class SwitchNode : public Node { public: - SwitchNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + SwitchNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SwitchViewNode.cc b/source/blender/compositor/nodes/COM_SwitchViewNode.cc index 5bf854bb0a0..735ccaf3513 100644 --- a/source/blender/compositor/nodes/COM_SwitchViewNode.cc +++ b/source/blender/compositor/nodes/COM_SwitchViewNode.cc @@ -20,24 +20,24 @@ namespace blender::compositor { -SwitchViewNode::SwitchViewNode(bNode *editorNode) : Node(editorNode) +SwitchViewNode::SwitchViewNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void SwitchViewNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void SwitchViewNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { NodeOperationOutput *result; - const char *viewName = context.getViewName(); - bNode *bnode = this->getbNode(); + const char *view_name = context.get_view_name(); + bNode *bnode = this->get_bnode(); /* get the internal index of the socket with a matching name */ - int nr = BLI_findstringindex(&bnode->inputs, viewName, offsetof(bNodeSocket, name)); + int nr = BLI_findstringindex(&bnode->inputs, view_name, offsetof(bNodeSocket, name)); nr = MAX2(nr, 0); - result = converter.addInputProxy(getInputSocket(nr), false); - converter.mapOutputSocket(getOutputSocket(0), result); + result = converter.add_input_proxy(get_input_socket(nr), false); + converter.map_output_socket(get_output_socket(0), result); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_SwitchViewNode.h b/source/blender/compositor/nodes/COM_SwitchViewNode.h index ce6de52182c..227c076f181 100644 --- a/source/blender/compositor/nodes/COM_SwitchViewNode.h +++ b/source/blender/compositor/nodes/COM_SwitchViewNode.h @@ -30,9 +30,9 @@ namespace blender::compositor { */ class SwitchViewNode : public Node { public: - SwitchViewNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + SwitchViewNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TextureNode.cc b/source/blender/compositor/nodes/COM_TextureNode.cc index 4063e4b4bce..ca57680781f 100644 --- a/source/blender/compositor/nodes/COM_TextureNode.cc +++ b/source/blender/compositor/nodes/COM_TextureNode.cc @@ -21,39 +21,39 @@ namespace blender::compositor { -TextureNode::TextureNode(bNode *editorNode) : Node(editorNode) +TextureNode::TextureNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void TextureNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void TextureNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - Tex *texture = (Tex *)editorNode->id; + bNode *editor_node = this->get_bnode(); + Tex *texture = (Tex *)editor_node->id; TextureOperation *operation = new TextureOperation(); - const ColorManagedDisplaySettings *displaySettings = context.getDisplaySettings(); - bool sceneColorManage = !STREQ(displaySettings->display_device, "None"); - operation->setTexture(texture); - operation->setRenderData(context.getRenderData()); - operation->setSceneColorManage(sceneColorManage); - converter.addOperation(operation); - - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(1), operation->getOutputSocket()); - - converter.addPreview(operation->getOutputSocket()); - - TextureAlphaOperation *alphaOperation = new TextureAlphaOperation(); - alphaOperation->setTexture(texture); - alphaOperation->setRenderData(context.getRenderData()); - alphaOperation->setSceneColorManage(sceneColorManage); - converter.addOperation(alphaOperation); - - converter.mapInputSocket(getInputSocket(0), alphaOperation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), alphaOperation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(0), alphaOperation->getOutputSocket()); + const ColorManagedDisplaySettings *display_settings = context.get_display_settings(); + bool scene_color_manage = !STREQ(display_settings->display_device, "None"); + operation->set_texture(texture); + operation->set_render_data(context.get_render_data()); + operation->set_scene_color_manage(scene_color_manage); + converter.add_operation(operation); + + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(1), operation->get_output_socket()); + + converter.add_preview(operation->get_output_socket()); + + TextureAlphaOperation *alpha_operation = new TextureAlphaOperation(); + alpha_operation->set_texture(texture); + alpha_operation->set_render_data(context.get_render_data()); + alpha_operation->set_scene_color_manage(scene_color_manage); + converter.add_operation(alpha_operation); + + converter.map_input_socket(get_input_socket(0), alpha_operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), alpha_operation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(0), alpha_operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TextureNode.h b/source/blender/compositor/nodes/COM_TextureNode.h index b886e3b74e1..bd477e6c6e6 100644 --- a/source/blender/compositor/nodes/COM_TextureNode.h +++ b/source/blender/compositor/nodes/COM_TextureNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class TextureNode : public Node { public: - TextureNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + TextureNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TimeNode.cc b/source/blender/compositor/nodes/COM_TimeNode.cc index 37236959366..0d1532f62f9 100644 --- a/source/blender/compositor/nodes/COM_TimeNode.cc +++ b/source/blender/compositor/nodes/COM_TimeNode.cc @@ -24,20 +24,20 @@ namespace blender::compositor { -TimeNode::TimeNode(bNode *editorNode) : Node(editorNode) +TimeNode::TimeNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void TimeNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void TimeNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { SetValueOperation *operation = new SetValueOperation(); - bNode *node = this->getbNode(); + bNode *node = this->get_bnode(); /* stack order output: fac */ float fac = 0.0f; - const int framenumber = context.getFramenumber(); + const int framenumber = context.get_framenumber(); if (framenumber < node->custom1) { fac = 0.0f; @@ -46,15 +46,15 @@ void TimeNode::convertToOperations(NodeConverter &converter, fac = 1.0f; } else if (node->custom1 < node->custom2) { - fac = (context.getFramenumber() - node->custom1) / (float)(node->custom2 - node->custom1); + fac = (context.get_framenumber() - node->custom1) / (float)(node->custom2 - node->custom1); } BKE_curvemapping_init((CurveMapping *)node->storage); fac = BKE_curvemapping_evaluateF((CurveMapping *)node->storage, 0, fac); - operation->setValue(clamp_f(fac, 0.0f, 1.0f)); - converter.addOperation(operation); + operation->set_value(clamp_f(fac, 0.0f, 1.0f)); + converter.add_operation(operation); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TimeNode.h b/source/blender/compositor/nodes/COM_TimeNode.h index 5688e2cff03..5c5a0c98058 100644 --- a/source/blender/compositor/nodes/COM_TimeNode.h +++ b/source/blender/compositor/nodes/COM_TimeNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class TimeNode : public Node { public: - TimeNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + TimeNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TonemapNode.cc b/source/blender/compositor/nodes/COM_TonemapNode.cc index a2b3e84b604..54ba84d46bd 100644 --- a/source/blender/compositor/nodes/COM_TonemapNode.cc +++ b/source/blender/compositor/nodes/COM_TonemapNode.cc @@ -21,23 +21,23 @@ namespace blender::compositor { -TonemapNode::TonemapNode(bNode *editorNode) : Node(editorNode) +TonemapNode::TonemapNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void TonemapNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void TonemapNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeTonemap *data = (NodeTonemap *)this->getbNode()->storage; + NodeTonemap *data = (NodeTonemap *)this->get_bnode()->storage; TonemapOperation *operation = data->type == 1 ? new PhotoreceptorTonemapOperation() : new TonemapOperation(); - operation->setData(data); - converter.addOperation(operation); + operation->set_data(data); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket(0)); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket(0)); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TonemapNode.h b/source/blender/compositor/nodes/COM_TonemapNode.h index cac9004c32a..3c67472bf98 100644 --- a/source/blender/compositor/nodes/COM_TonemapNode.h +++ b/source/blender/compositor/nodes/COM_TonemapNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class TonemapNode : public Node { public: - TonemapNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + TonemapNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TrackPositionNode.cc b/source/blender/compositor/nodes/COM_TrackPositionNode.cc index f683eeb61c2..ced09d8535f 100644 --- a/source/blender/compositor/nodes/COM_TrackPositionNode.cc +++ b/source/blender/compositor/nodes/COM_TrackPositionNode.cc @@ -27,7 +27,7 @@ namespace blender::compositor { -TrackPositionNode::TrackPositionNode(bNode *editorNode) : Node(editorNode) +TrackPositionNode::TrackPositionNode(bNode *editor_node) : Node(editor_node) { /* pass */ } @@ -40,58 +40,58 @@ static TrackPositionOperation *create_motion_operation(NodeConverter &converter, int delta) { TrackPositionOperation *operation = new TrackPositionOperation(); - operation->setMovieClip(clip); - operation->setTrackingObject(trackpos_data->tracking_object); - operation->setTrackName(trackpos_data->track_name); - operation->setFramenumber(frame_number); - operation->setAxis(axis); - operation->setPosition(CMP_TRACKPOS_ABSOLUTE); - operation->setRelativeFrame(frame_number + delta); - operation->setSpeedOutput(true); - converter.addOperation(operation); + operation->set_movie_clip(clip); + operation->set_tracking_object(trackpos_data->tracking_object); + operation->set_track_name(trackpos_data->track_name); + operation->set_framenumber(frame_number); + operation->set_axis(axis); + operation->set_position(CMP_TRACKPOS_ABSOLUTE); + operation->set_relative_frame(frame_number + delta); + operation->set_speed_output(true); + converter.add_operation(operation); return operation; } -void TrackPositionNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void TrackPositionNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - MovieClip *clip = (MovieClip *)editorNode->id; - NodeTrackPosData *trackpos_data = (NodeTrackPosData *)editorNode->storage; + bNode *editor_node = this->get_bnode(); + MovieClip *clip = (MovieClip *)editor_node->id; + NodeTrackPosData *trackpos_data = (NodeTrackPosData *)editor_node->storage; - NodeOutput *outputX = this->getOutputSocket(0); - NodeOutput *outputY = this->getOutputSocket(1); - NodeOutput *outputSpeed = this->getOutputSocket(2); + NodeOutput *outputX = this->get_output_socket(0); + NodeOutput *outputY = this->get_output_socket(1); + NodeOutput *output_speed = this->get_output_socket(2); int frame_number; - if (editorNode->custom1 == CMP_TRACKPOS_ABSOLUTE_FRAME) { - frame_number = editorNode->custom2; + if (editor_node->custom1 == CMP_TRACKPOS_ABSOLUTE_FRAME) { + frame_number = editor_node->custom2; } else { - frame_number = context.getFramenumber(); + frame_number = context.get_framenumber(); } TrackPositionOperation *operationX = new TrackPositionOperation(); - operationX->setMovieClip(clip); - operationX->setTrackingObject(trackpos_data->tracking_object); - operationX->setTrackName(trackpos_data->track_name); - operationX->setFramenumber(frame_number); - operationX->setAxis(0); - operationX->setPosition(editorNode->custom1); - operationX->setRelativeFrame(editorNode->custom2); - converter.addOperation(operationX); - converter.mapOutputSocket(outputX, operationX->getOutputSocket()); + operationX->set_movie_clip(clip); + operationX->set_tracking_object(trackpos_data->tracking_object); + operationX->set_track_name(trackpos_data->track_name); + operationX->set_framenumber(frame_number); + operationX->set_axis(0); + operationX->set_position(editor_node->custom1); + operationX->set_relative_frame(editor_node->custom2); + converter.add_operation(operationX); + converter.map_output_socket(outputX, operationX->get_output_socket()); TrackPositionOperation *operationY = new TrackPositionOperation(); - operationY->setMovieClip(clip); - operationY->setTrackingObject(trackpos_data->tracking_object); - operationY->setTrackName(trackpos_data->track_name); - operationY->setFramenumber(frame_number); - operationY->setAxis(1); - operationY->setPosition(editorNode->custom1); - operationY->setRelativeFrame(editorNode->custom2); - converter.addOperation(operationY); - converter.mapOutputSocket(outputY, operationY->getOutputSocket()); + operationY->set_movie_clip(clip); + operationY->set_tracking_object(trackpos_data->tracking_object); + operationY->set_track_name(trackpos_data->track_name); + operationY->set_framenumber(frame_number); + operationY->set_axis(1); + operationY->set_position(editor_node->custom1); + operationY->set_relative_frame(editor_node->custom2); + converter.add_operation(operationY); + converter.map_output_socket(outputY, operationY->get_output_socket()); TrackPositionOperation *operationMotionPreX = create_motion_operation( converter, clip, trackpos_data, 0, frame_number, -1); @@ -103,12 +103,16 @@ void TrackPositionNode::convertToOperations(NodeConverter &converter, converter, clip, trackpos_data, 1, frame_number, 1); CombineChannelsOperation *combine_operation = new CombineChannelsOperation(); - converter.addOperation(combine_operation); - converter.addLink(operationMotionPreX->getOutputSocket(), combine_operation->getInputSocket(0)); - converter.addLink(operationMotionPreY->getOutputSocket(), combine_operation->getInputSocket(1)); - converter.addLink(operationMotionPostX->getOutputSocket(), combine_operation->getInputSocket(2)); - converter.addLink(operationMotionPostY->getOutputSocket(), combine_operation->getInputSocket(3)); - converter.mapOutputSocket(outputSpeed, combine_operation->getOutputSocket()); + converter.add_operation(combine_operation); + converter.add_link(operationMotionPreX->get_output_socket(), + combine_operation->get_input_socket(0)); + converter.add_link(operationMotionPreY->get_output_socket(), + combine_operation->get_input_socket(1)); + converter.add_link(operationMotionPostX->get_output_socket(), + combine_operation->get_input_socket(2)); + converter.add_link(operationMotionPostY->get_output_socket(), + combine_operation->get_input_socket(3)); + converter.map_output_socket(output_speed, combine_operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TrackPositionNode.h b/source/blender/compositor/nodes/COM_TrackPositionNode.h index 665ba36fe09..d0b1648b0c9 100644 --- a/source/blender/compositor/nodes/COM_TrackPositionNode.h +++ b/source/blender/compositor/nodes/COM_TrackPositionNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class TrackPositionNode : public Node { public: - TrackPositionNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + TrackPositionNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TransformNode.cc b/source/blender/compositor/nodes/COM_TransformNode.cc index a5b3c41de80..cd60e8c17db 100644 --- a/source/blender/compositor/nodes/COM_TransformNode.cc +++ b/source/blender/compositor/nodes/COM_TransformNode.cc @@ -24,79 +24,85 @@ namespace blender::compositor { -TransformNode::TransformNode(bNode *editorNode) : Node(editorNode) +TransformNode::TransformNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void TransformNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void TransformNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - NodeInput *imageInput = this->getInputSocket(0); - NodeInput *xInput = this->getInputSocket(1); - NodeInput *yInput = this->getInputSocket(2); - NodeInput *angleInput = this->getInputSocket(3); - NodeInput *scaleInput = this->getInputSocket(4); + NodeInput *image_input = this->get_input_socket(0); + NodeInput *x_input = this->get_input_socket(1); + NodeInput *y_input = this->get_input_socket(2); + NodeInput *angle_input = this->get_input_socket(3); + NodeInput *scale_input = this->get_input_socket(4); switch (context.get_execution_model()) { case eExecutionModel::Tiled: { - ScaleRelativeOperation *scaleOperation = new ScaleRelativeOperation(); - converter.addOperation(scaleOperation); + ScaleRelativeOperation *scale_operation = new ScaleRelativeOperation(); + converter.add_operation(scale_operation); - RotateOperation *rotateOperation = new RotateOperation(); - rotateOperation->setDoDegree2RadConversion(false); - converter.addOperation(rotateOperation); + RotateOperation *rotate_operation = new RotateOperation(); + rotate_operation->set_do_degree2_rad_conversion(false); + converter.add_operation(rotate_operation); - TranslateOperation *translateOperation = new TranslateOperation(); - converter.addOperation(translateOperation); + TranslateOperation *translate_operation = new TranslateOperation(); + converter.add_operation(translate_operation); SetSamplerOperation *sampler = new SetSamplerOperation(); - sampler->setSampler((PixelSampler)this->getbNode()->custom1); - converter.addOperation(sampler); + sampler->set_sampler((PixelSampler)this->get_bnode()->custom1); + converter.add_operation(sampler); - converter.mapInputSocket(imageInput, sampler->getInputSocket(0)); - converter.addLink(sampler->getOutputSocket(), scaleOperation->getInputSocket(0)); - converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(1)); - converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(2)); // xscale = yscale + converter.map_input_socket(image_input, sampler->get_input_socket(0)); + converter.add_link(sampler->get_output_socket(), scale_operation->get_input_socket(0)); + converter.map_input_socket(scale_input, scale_operation->get_input_socket(1)); + converter.map_input_socket(scale_input, + scale_operation->get_input_socket(2)); // xscale = yscale - converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0)); - converter.mapInputSocket(angleInput, rotateOperation->getInputSocket(1)); + converter.add_link(scale_operation->get_output_socket(), + rotate_operation->get_input_socket(0)); + converter.map_input_socket(angle_input, rotate_operation->get_input_socket(1)); - converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0)); - converter.mapInputSocket(xInput, translateOperation->getInputSocket(1)); - converter.mapInputSocket(yInput, translateOperation->getInputSocket(2)); + converter.add_link(rotate_operation->get_output_socket(), + translate_operation->get_input_socket(0)); + converter.map_input_socket(x_input, translate_operation->get_input_socket(1)); + converter.map_input_socket(y_input, translate_operation->get_input_socket(2)); - converter.mapOutputSocket(getOutputSocket(), translateOperation->getOutputSocket()); + converter.map_output_socket(get_output_socket(), translate_operation->get_output_socket()); break; } case eExecutionModel::FullFrame: { - ScaleRelativeOperation *scaleOperation = new ScaleRelativeOperation(); - converter.addOperation(scaleOperation); + ScaleRelativeOperation *scale_operation = new ScaleRelativeOperation(); + converter.add_operation(scale_operation); - RotateOperation *rotateOperation = new RotateOperation(); - rotateOperation->setDoDegree2RadConversion(false); - converter.addOperation(rotateOperation); + RotateOperation *rotate_operation = new RotateOperation(); + rotate_operation->set_do_degree2_rad_conversion(false); + converter.add_operation(rotate_operation); - TranslateOperation *translateOperation = new TranslateCanvasOperation(); - converter.addOperation(translateOperation); + TranslateOperation *translate_operation = new TranslateCanvasOperation(); + converter.add_operation(translate_operation); - PixelSampler sampler = (PixelSampler)this->getbNode()->custom1; - scaleOperation->setSampler(sampler); - rotateOperation->set_sampler(sampler); - scaleOperation->set_scale_canvas_max_size(context.get_render_size()); + PixelSampler sampler = (PixelSampler)this->get_bnode()->custom1; + scale_operation->set_sampler(sampler); + rotate_operation->set_sampler(sampler); + scale_operation->set_scale_canvas_max_size(context.get_render_size()); - converter.mapInputSocket(imageInput, scaleOperation->getInputSocket(0)); - converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(1)); - converter.mapInputSocket(scaleInput, scaleOperation->getInputSocket(2)); // xscale = yscale + converter.map_input_socket(image_input, scale_operation->get_input_socket(0)); + converter.map_input_socket(scale_input, scale_operation->get_input_socket(1)); + converter.map_input_socket(scale_input, + scale_operation->get_input_socket(2)); // xscale = yscale - converter.addLink(scaleOperation->getOutputSocket(), rotateOperation->getInputSocket(0)); - converter.mapInputSocket(angleInput, rotateOperation->getInputSocket(1)); + converter.add_link(scale_operation->get_output_socket(), + rotate_operation->get_input_socket(0)); + converter.map_input_socket(angle_input, rotate_operation->get_input_socket(1)); - converter.addLink(rotateOperation->getOutputSocket(), translateOperation->getInputSocket(0)); - converter.mapInputSocket(xInput, translateOperation->getInputSocket(1)); - converter.mapInputSocket(yInput, translateOperation->getInputSocket(2)); + converter.add_link(rotate_operation->get_output_socket(), + translate_operation->get_input_socket(0)); + converter.map_input_socket(x_input, translate_operation->get_input_socket(1)); + converter.map_input_socket(y_input, translate_operation->get_input_socket(2)); - converter.mapOutputSocket(getOutputSocket(), translateOperation->getOutputSocket()); + converter.map_output_socket(get_output_socket(), translate_operation->get_output_socket()); break; } } diff --git a/source/blender/compositor/nodes/COM_TransformNode.h b/source/blender/compositor/nodes/COM_TransformNode.h index 137e162256d..66255d63813 100644 --- a/source/blender/compositor/nodes/COM_TransformNode.h +++ b/source/blender/compositor/nodes/COM_TransformNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class TransformNode : public Node { public: - TransformNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + TransformNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_TranslateNode.cc b/source/blender/compositor/nodes/COM_TranslateNode.cc index 6dbd350fabf..b9f96d92942 100644 --- a/source/blender/compositor/nodes/COM_TranslateNode.cc +++ b/source/blender/compositor/nodes/COM_TranslateNode.cc @@ -24,53 +24,53 @@ namespace blender::compositor { -TranslateNode::TranslateNode(bNode *editorNode) : Node(editorNode) +TranslateNode::TranslateNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void TranslateNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void TranslateNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *bnode = this->getbNode(); + bNode *bnode = this->get_bnode(); NodeTranslateData *data = (NodeTranslateData *)bnode->storage; - NodeInput *inputSocket = this->getInputSocket(0); - NodeInput *inputXSocket = this->getInputSocket(1); - NodeInput *inputYSocket = this->getInputSocket(2); - NodeOutput *outputSocket = this->getOutputSocket(0); + NodeInput *input_socket = this->get_input_socket(0); + NodeInput *input_xsocket = this->get_input_socket(1); + NodeInput *input_ysocket = this->get_input_socket(2); + NodeOutput *output_socket = this->get_output_socket(0); TranslateOperation *operation = context.get_execution_model() == eExecutionModel::Tiled ? new TranslateOperation() : new TranslateCanvasOperation(); operation->set_wrapping(data->wrap_axis); if (data->relative) { - const RenderData *rd = context.getRenderData(); - const float render_size_factor = context.getRenderPercentageAsFactor(); + const RenderData *rd = context.get_render_data(); + const float render_size_factor = context.get_render_percentage_as_factor(); float fx = rd->xsch * render_size_factor; float fy = rd->ysch * render_size_factor; operation->setFactorXY(fx, fy); } - converter.addOperation(operation); - converter.mapInputSocket(inputXSocket, operation->getInputSocket(1)); - converter.mapInputSocket(inputYSocket, operation->getInputSocket(2)); - converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0)); + converter.add_operation(operation); + converter.map_input_socket(input_xsocket, operation->get_input_socket(1)); + converter.map_input_socket(input_ysocket, operation->get_input_socket(2)); + converter.map_output_socket(output_socket, operation->get_output_socket(0)); if (data->wrap_axis && context.get_execution_model() != eExecutionModel::FullFrame) { /* TODO: To be removed with tiled implementation. */ - WriteBufferOperation *writeOperation = new WriteBufferOperation(DataType::Color); - WrapOperation *wrapOperation = new WrapOperation(DataType::Color); - wrapOperation->setMemoryProxy(writeOperation->getMemoryProxy()); - wrapOperation->setWrapping(data->wrap_axis); + WriteBufferOperation *write_operation = new WriteBufferOperation(DataType::Color); + WrapOperation *wrap_operation = new WrapOperation(DataType::Color); + wrap_operation->set_memory_proxy(write_operation->get_memory_proxy()); + wrap_operation->set_wrapping(data->wrap_axis); - converter.addOperation(writeOperation); - converter.addOperation(wrapOperation); - converter.mapInputSocket(inputSocket, writeOperation->getInputSocket(0)); - converter.addLink(wrapOperation->getOutputSocket(), operation->getInputSocket(0)); + converter.add_operation(write_operation); + converter.add_operation(wrap_operation); + converter.map_input_socket(input_socket, write_operation->get_input_socket(0)); + converter.add_link(wrap_operation->get_output_socket(), operation->get_input_socket(0)); } else { - converter.mapInputSocket(inputSocket, operation->getInputSocket(0)); + converter.map_input_socket(input_socket, operation->get_input_socket(0)); } } diff --git a/source/blender/compositor/nodes/COM_TranslateNode.h b/source/blender/compositor/nodes/COM_TranslateNode.h index 0cea234bff8..5ccbb01f3f0 100644 --- a/source/blender/compositor/nodes/COM_TranslateNode.h +++ b/source/blender/compositor/nodes/COM_TranslateNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class TranslateNode : public Node { public: - TranslateNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + TranslateNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ValueNode.cc b/source/blender/compositor/nodes/COM_ValueNode.cc index 611353fceba..892a68dabcc 100644 --- a/source/blender/compositor/nodes/COM_ValueNode.cc +++ b/source/blender/compositor/nodes/COM_ValueNode.cc @@ -21,20 +21,20 @@ namespace blender::compositor { -ValueNode::ValueNode(bNode *editorNode) : Node(editorNode) +ValueNode::ValueNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ValueNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ValueNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { SetValueOperation *operation = new SetValueOperation(); - NodeOutput *output = this->getOutputSocket(0); - operation->setValue(output->getEditorValueFloat()); - converter.addOperation(operation); + NodeOutput *output = this->get_output_socket(0); + operation->set_value(output->get_editor_value_float()); + converter.add_operation(operation); - converter.mapOutputSocket(output, operation->getOutputSocket()); + converter.map_output_socket(output, operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ValueNode.h b/source/blender/compositor/nodes/COM_ValueNode.h index 1401b2c7e0a..d70013c48af 100644 --- a/source/blender/compositor/nodes/COM_ValueNode.h +++ b/source/blender/compositor/nodes/COM_ValueNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ValueNode : public Node { public: - ValueNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ValueNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_VectorBlurNode.cc b/source/blender/compositor/nodes/COM_VectorBlurNode.cc index 2bbfd3591c3..b3f32465a34 100644 --- a/source/blender/compositor/nodes/COM_VectorBlurNode.cc +++ b/source/blender/compositor/nodes/COM_VectorBlurNode.cc @@ -21,26 +21,26 @@ namespace blender::compositor { -VectorBlurNode::VectorBlurNode(bNode *editorNode) : Node(editorNode) +VectorBlurNode::VectorBlurNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void VectorBlurNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void VectorBlurNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *node = this->getbNode(); - NodeBlurData *vectorBlurSettings = (NodeBlurData *)node->storage; + bNode *node = this->get_bnode(); + NodeBlurData *vector_blur_settings = (NodeBlurData *)node->storage; VectorBlurOperation *operation = new VectorBlurOperation(); - operation->setVectorBlurSettings(vectorBlurSettings); - operation->setQuality(context.getQuality()); - converter.addOperation(operation); + operation->set_vector_blur_settings(vector_blur_settings); + operation->set_quality(context.get_quality()); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); - converter.mapOutputSocket(getOutputSocket(), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2)); + converter.map_output_socket(get_output_socket(), operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_VectorBlurNode.h b/source/blender/compositor/nodes/COM_VectorBlurNode.h index 8c98a0b81a1..fb8a70ab2ec 100644 --- a/source/blender/compositor/nodes/COM_VectorBlurNode.h +++ b/source/blender/compositor/nodes/COM_VectorBlurNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class VectorBlurNode : public Node { public: - VectorBlurNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + VectorBlurNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_VectorCurveNode.cc b/source/blender/compositor/nodes/COM_VectorCurveNode.cc index 2b26056296d..d064c5787fd 100644 --- a/source/blender/compositor/nodes/COM_VectorCurveNode.cc +++ b/source/blender/compositor/nodes/COM_VectorCurveNode.cc @@ -21,20 +21,20 @@ namespace blender::compositor { -VectorCurveNode::VectorCurveNode(bNode *editorNode) : Node(editorNode) +VectorCurveNode::VectorCurveNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void VectorCurveNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void VectorCurveNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { VectorCurveOperation *operation = new VectorCurveOperation(); - operation->setCurveMapping((CurveMapping *)this->getbNode()->storage); - converter.addOperation(operation); + operation->set_curve_mapping((CurveMapping *)this->get_bnode()->storage); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); } } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_VectorCurveNode.h b/source/blender/compositor/nodes/COM_VectorCurveNode.h index ee4df5d3a42..901bd6f64b9 100644 --- a/source/blender/compositor/nodes/COM_VectorCurveNode.h +++ b/source/blender/compositor/nodes/COM_VectorCurveNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class VectorCurveNode : public Node { public: - VectorCurveNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + VectorCurveNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ViewLevelsNode.cc b/source/blender/compositor/nodes/COM_ViewLevelsNode.cc index 605ff9357ab..79d535fc58a 100644 --- a/source/blender/compositor/nodes/COM_ViewLevelsNode.cc +++ b/source/blender/compositor/nodes/COM_ViewLevelsNode.cc @@ -21,41 +21,41 @@ namespace blender::compositor { -ViewLevelsNode::ViewLevelsNode(bNode *editorNode) : Node(editorNode) +ViewLevelsNode::ViewLevelsNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ViewLevelsNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ViewLevelsNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - NodeInput *input = this->getInputSocket(0); - if (input->isLinked()) { + NodeInput *input = this->get_input_socket(0); + if (input->is_linked()) { /* Add preview to input-socket. */ /* calculate mean operation */ { CalculateMeanOperation *operation = new CalculateMeanOperation(); - operation->setSetting(this->getbNode()->custom1); + operation->set_setting(this->get_bnode()->custom1); - converter.addOperation(operation); - converter.mapInputSocket(input, operation->getInputSocket(0)); - converter.mapOutputSocket(this->getOutputSocket(0), operation->getOutputSocket()); + converter.add_operation(operation); + converter.map_input_socket(input, operation->get_input_socket(0)); + converter.map_output_socket(this->get_output_socket(0), operation->get_output_socket()); } /* calculate standard deviation operation */ { CalculateStandardDeviationOperation *operation = new CalculateStandardDeviationOperation(); - operation->setSetting(this->getbNode()->custom1); + operation->set_setting(this->get_bnode()->custom1); - converter.addOperation(operation); - converter.mapInputSocket(input, operation->getInputSocket(0)); - converter.mapOutputSocket(this->getOutputSocket(1), operation->getOutputSocket()); + converter.add_operation(operation); + converter.map_input_socket(input, operation->get_input_socket(0)); + converter.map_output_socket(this->get_output_socket(1), operation->get_output_socket()); } } else { - converter.addOutputValue(getOutputSocket(0), 0.0f); - converter.addOutputValue(getOutputSocket(1), 0.0f); + converter.add_output_value(get_output_socket(0), 0.0f); + converter.add_output_value(get_output_socket(1), 0.0f); } } diff --git a/source/blender/compositor/nodes/COM_ViewLevelsNode.h b/source/blender/compositor/nodes/COM_ViewLevelsNode.h index 055d871498e..5415bbb2ee9 100644 --- a/source/blender/compositor/nodes/COM_ViewLevelsNode.h +++ b/source/blender/compositor/nodes/COM_ViewLevelsNode.h @@ -28,9 +28,9 @@ namespace blender::compositor { */ class ViewLevelsNode : public Node { public: - ViewLevelsNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ViewLevelsNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ViewerNode.cc b/source/blender/compositor/nodes/COM_ViewerNode.cc index 38ea37a28d6..7efb23b849d 100644 --- a/source/blender/compositor/nodes/COM_ViewerNode.cc +++ b/source/blender/compositor/nodes/COM_ViewerNode.cc @@ -22,61 +22,61 @@ namespace blender::compositor { -ViewerNode::ViewerNode(bNode *editorNode) : Node(editorNode) +ViewerNode::ViewerNode(bNode *editor_node) : Node(editor_node) { /* pass */ } -void ViewerNode::convertToOperations(NodeConverter &converter, - const CompositorContext &context) const +void ViewerNode::convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const { - bNode *editorNode = this->getbNode(); - bool do_output = (editorNode->flag & NODE_DO_OUTPUT_RECALC || context.isRendering()) && - (editorNode->flag & NODE_DO_OUTPUT); - bool ignore_alpha = (editorNode->custom2 & CMP_NODE_OUTPUT_IGNORE_ALPHA) != 0; + bNode *editor_node = this->get_bnode(); + bool do_output = (editor_node->flag & NODE_DO_OUTPUT_RECALC || context.is_rendering()) && + (editor_node->flag & NODE_DO_OUTPUT); + bool ignore_alpha = (editor_node->custom2 & CMP_NODE_OUTPUT_IGNORE_ALPHA) != 0; - NodeInput *imageSocket = this->getInputSocket(0); - NodeInput *alphaSocket = this->getInputSocket(1); - NodeInput *depthSocket = this->getInputSocket(2); - Image *image = (Image *)this->getbNode()->id; - ImageUser *imageUser = (ImageUser *)this->getbNode()->storage; - ViewerOperation *viewerOperation = new ViewerOperation(); - viewerOperation->setbNodeTree(context.getbNodeTree()); - viewerOperation->setImage(image); - viewerOperation->setImageUser(imageUser); - viewerOperation->setChunkOrder((ChunkOrdering)editorNode->custom1); - viewerOperation->setCenterX(editorNode->custom3); - viewerOperation->setCenterY(editorNode->custom4); + NodeInput *image_socket = this->get_input_socket(0); + NodeInput *alpha_socket = this->get_input_socket(1); + NodeInput *depth_socket = this->get_input_socket(2); + Image *image = (Image *)this->get_bnode()->id; + ImageUser *image_user = (ImageUser *)this->get_bnode()->storage; + ViewerOperation *viewer_operation = new ViewerOperation(); + viewer_operation->set_bnodetree(context.get_bnodetree()); + viewer_operation->set_image(image); + viewer_operation->set_image_user(image_user); + viewer_operation->set_chunk_order((ChunkOrdering)editor_node->custom1); + viewer_operation->setCenterX(editor_node->custom3); + viewer_operation->setCenterY(editor_node->custom4); /* alpha socket gives either 1 or a custom alpha value if "use alpha" is enabled */ - viewerOperation->setUseAlphaInput(ignore_alpha || alphaSocket->isLinked()); - viewerOperation->setRenderData(context.getRenderData()); - viewerOperation->setViewName(context.getViewName()); + viewer_operation->set_use_alpha_input(ignore_alpha || alpha_socket->is_linked()); + viewer_operation->set_render_data(context.get_render_data()); + viewer_operation->set_view_name(context.get_view_name()); - viewerOperation->setViewSettings(context.getViewSettings()); - viewerOperation->setDisplaySettings(context.getDisplaySettings()); + viewer_operation->set_view_settings(context.get_view_settings()); + viewer_operation->set_display_settings(context.get_display_settings()); - viewerOperation->set_canvas_input_index(0); - if (!imageSocket->isLinked()) { - if (alphaSocket->isLinked()) { - viewerOperation->set_canvas_input_index(1); + viewer_operation->set_canvas_input_index(0); + if (!image_socket->is_linked()) { + if (alpha_socket->is_linked()) { + viewer_operation->set_canvas_input_index(1); } } - converter.addOperation(viewerOperation); - converter.mapInputSocket(imageSocket, viewerOperation->getInputSocket(0)); + converter.add_operation(viewer_operation); + converter.map_input_socket(image_socket, viewer_operation->get_input_socket(0)); /* only use alpha link if "use alpha" is enabled */ if (ignore_alpha) { - converter.addInputValue(viewerOperation->getInputSocket(1), 1.0f); + converter.add_input_value(viewer_operation->get_input_socket(1), 1.0f); } else { - converter.mapInputSocket(alphaSocket, viewerOperation->getInputSocket(1)); + converter.map_input_socket(alpha_socket, viewer_operation->get_input_socket(1)); } - converter.mapInputSocket(depthSocket, viewerOperation->getInputSocket(2)); + converter.map_input_socket(depth_socket, viewer_operation->get_input_socket(2)); - converter.addNodeInputPreview(imageSocket); + converter.add_node_input_preview(image_socket); if (do_output) { - converter.registerViewer(viewerOperation); + converter.register_viewer(viewer_operation); } } diff --git a/source/blender/compositor/nodes/COM_ViewerNode.h b/source/blender/compositor/nodes/COM_ViewerNode.h index 544a5e6a504..ce9076666bc 100644 --- a/source/blender/compositor/nodes/COM_ViewerNode.h +++ b/source/blender/compositor/nodes/COM_ViewerNode.h @@ -29,9 +29,9 @@ namespace blender::compositor { */ class ViewerNode : public Node { public: - ViewerNode(bNode *editorNode); - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + ViewerNode(bNode *editor_node); + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor diff --git a/source/blender/compositor/nodes/COM_ZCombineNode.cc b/source/blender/compositor/nodes/COM_ZCombineNode.cc index 5f7fec53808..52cb1451ba1 100644 --- a/source/blender/compositor/nodes/COM_ZCombineNode.cc +++ b/source/blender/compositor/nodes/COM_ZCombineNode.cc @@ -24,31 +24,31 @@ namespace blender::compositor { -void ZCombineNode::convertToOperations(NodeConverter &converter, - const CompositorContext & /*context*/) const +void ZCombineNode::convert_to_operations(NodeConverter &converter, + const CompositorContext & /*context*/) const { - if (this->getbNode()->custom2) { + if (this->get_bnode()->custom2) { ZCombineOperation *operation = nullptr; - if (this->getbNode()->custom1) { + if (this->get_bnode()->custom1) { operation = new ZCombineAlphaOperation(); } else { operation = new ZCombineOperation(); } - converter.addOperation(operation); + converter.add_operation(operation); - converter.mapInputSocket(getInputSocket(0), operation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(1), operation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), operation->getInputSocket(2)); - converter.mapInputSocket(getInputSocket(3), operation->getInputSocket(3)); - converter.mapOutputSocket(getOutputSocket(0), operation->getOutputSocket()); + converter.map_input_socket(get_input_socket(0), operation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(1), operation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), operation->get_input_socket(2)); + converter.map_input_socket(get_input_socket(3), operation->get_input_socket(3)); + converter.map_output_socket(get_output_socket(0), operation->get_output_socket()); MathMinimumOperation *zoperation = new MathMinimumOperation(); - converter.addOperation(zoperation); + converter.add_operation(zoperation); - converter.mapInputSocket(getInputSocket(1), zoperation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(3), zoperation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(1), zoperation->getOutputSocket()); + converter.map_input_socket(get_input_socket(1), zoperation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(3), zoperation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(1), zoperation->get_output_socket()); } else { /* XXX custom1 is "use_alpha", what on earth is this supposed to do here?!? */ @@ -56,40 +56,42 @@ void ZCombineNode::convertToOperations(NodeConverter &converter, /* Step 1 create mask. */ NodeOperation *maskoperation; - if (this->getbNode()->custom1) { + if (this->get_bnode()->custom1) { maskoperation = new MathGreaterThanOperation(); } else { maskoperation = new MathLessThanOperation(); } - converter.addOperation(maskoperation); + converter.add_operation(maskoperation); - converter.mapInputSocket(getInputSocket(1), maskoperation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(3), maskoperation->getInputSocket(1)); + converter.map_input_socket(get_input_socket(1), maskoperation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(3), maskoperation->get_input_socket(1)); /* Step 2 anti alias mask bit of an expensive operation, but does the trick. */ AntiAliasOperation *antialiasoperation = new AntiAliasOperation(); - converter.addOperation(antialiasoperation); + converter.add_operation(antialiasoperation); - converter.addLink(maskoperation->getOutputSocket(), antialiasoperation->getInputSocket(0)); + converter.add_link(maskoperation->get_output_socket(), + antialiasoperation->get_input_socket(0)); /* use mask to blend between the input colors. */ - ZCombineMaskOperation *zcombineoperation = this->getbNode()->custom1 ? + ZCombineMaskOperation *zcombineoperation = this->get_bnode()->custom1 ? new ZCombineMaskAlphaOperation() : new ZCombineMaskOperation(); - converter.addOperation(zcombineoperation); + converter.add_operation(zcombineoperation); - converter.addLink(antialiasoperation->getOutputSocket(), zcombineoperation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(0), zcombineoperation->getInputSocket(1)); - converter.mapInputSocket(getInputSocket(2), zcombineoperation->getInputSocket(2)); - converter.mapOutputSocket(getOutputSocket(0), zcombineoperation->getOutputSocket()); + converter.add_link(antialiasoperation->get_output_socket(), + zcombineoperation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(0), zcombineoperation->get_input_socket(1)); + converter.map_input_socket(get_input_socket(2), zcombineoperation->get_input_socket(2)); + converter.map_output_socket(get_output_socket(0), zcombineoperation->get_output_socket()); MathMinimumOperation *zoperation = new MathMinimumOperation(); - converter.addOperation(zoperation); + converter.add_operation(zoperation); - converter.mapInputSocket(getInputSocket(1), zoperation->getInputSocket(0)); - converter.mapInputSocket(getInputSocket(3), zoperation->getInputSocket(1)); - converter.mapOutputSocket(getOutputSocket(1), zoperation->getOutputSocket()); + converter.map_input_socket(get_input_socket(1), zoperation->get_input_socket(0)); + converter.map_input_socket(get_input_socket(3), zoperation->get_input_socket(1)); + converter.map_output_socket(get_output_socket(1), zoperation->get_output_socket()); } } diff --git a/source/blender/compositor/nodes/COM_ZCombineNode.h b/source/blender/compositor/nodes/COM_ZCombineNode.h index 82f2f30fb3c..4761b336fc1 100644 --- a/source/blender/compositor/nodes/COM_ZCombineNode.h +++ b/source/blender/compositor/nodes/COM_ZCombineNode.h @@ -28,11 +28,11 @@ namespace blender::compositor { */ class ZCombineNode : public Node { public: - ZCombineNode(bNode *editorNode) : Node(editorNode) + ZCombineNode(bNode *editor_node) : Node(editor_node) { } - void convertToOperations(NodeConverter &converter, - const CompositorContext &context) const override; + void convert_to_operations(NodeConverter &converter, + const CompositorContext &context) const override; }; } // namespace blender::compositor |