diff options
Diffstat (limited to 'source/blender/compositor/nodes/COM_BoxMaskNode.cc')
-rw-r--r-- | source/blender/compositor/nodes/COM_BoxMaskNode.cc | 57 |
1 files changed, 29 insertions, 28 deletions
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 |