From 0fd39da3a96adfe30e5260f72ecc8c6d8b68b98f Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Fri, 9 Sep 2022 14:10:38 +0200 Subject: Realtime Compositor: Implement scale node This patch implements the Scale node for the realtime compositor. Differential Revision: https://developer.blender.org/D15758 Reviewed By: Clement Foucault --- source/blender/compositor/nodes/COM_ScaleNode.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/blender/compositor') diff --git a/source/blender/compositor/nodes/COM_ScaleNode.cc b/source/blender/compositor/nodes/COM_ScaleNode.cc index 4813e49cd11..1d613a030d7 100644 --- a/source/blender/compositor/nodes/COM_ScaleNode.cc +++ b/source/blender/compositor/nodes/COM_ScaleNode.cc @@ -25,7 +25,7 @@ void ScaleNode::convert_to_operations(NodeConverter &converter, NodeOutput *output_socket = this->get_output_socket(0); switch (bnode->custom1) { - case CMP_SCALE_RELATIVE: { + case CMP_NODE_SCALE_RELATIVE: { ScaleRelativeOperation *operation = new ScaleRelativeOperation(); converter.add_operation(operation); @@ -39,7 +39,7 @@ void ScaleNode::convert_to_operations(NodeConverter &converter, break; } - case CMP_SCALE_SCENEPERCENT: { + case CMP_NODE_SCALE_RENDER_PERCENT: { SetValueOperation *scale_factor_operation = new SetValueOperation(); scale_factor_operation->set_value(context.get_render_percentage_as_factor()); converter.add_operation(scale_factor_operation); @@ -59,13 +59,14 @@ void ScaleNode::convert_to_operations(NodeConverter &converter, break; } - case CMP_SCALE_RENDERPERCENT: { + case CMP_NODE_SCALE_RENDER_SIZE: { 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->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_is_aspect( + ELEM(bnode->custom2, CMP_NODE_SCALE_RENDER_SIZE_FIT, CMP_NODE_SCALE_RENDER_SIZE_CROP)); + operation->set_is_crop(bnode->custom2 == CMP_NODE_SCALE_RENDER_SIZE_CROP); 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); @@ -79,7 +80,7 @@ void ScaleNode::convert_to_operations(NodeConverter &converter, break; } - case CMP_SCALE_ABSOLUTE: { + case CMP_NODE_SCALE_ABSOLUTE: { /* TODO: what is the use of this one.... perhaps some issues when the ui was updated... */ ScaleAbsoluteOperation *operation = new ScaleAbsoluteOperation(); converter.add_operation(operation); -- cgit v1.2.3