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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/compositor/nodes/COM_ScaleNode.cc')
-rw-r--r--source/blender/compositor/nodes/COM_ScaleNode.cc82
1 files changed, 42 insertions, 40 deletions
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;