From f84fb12f5d72433780a96c3cc4381399f153cf1a Mon Sep 17 00:00:00 2001 From: Manuel Castilla Date: Tue, 28 Sep 2021 19:33:06 +0200 Subject: Compositor: Add support for canvas compositing This commit adds functionality for operations that require pixel translation or resizing on "Full Frame" mode, allowing to adjust their canvas. It fixes most cropping issues in translate, scale, rotate and transform nodes by adjusting their canvas to the result, instead of the input canvas. Operations output buffer is still always on (0,0) position for easier image algorithm implementation, even when the canvas is not. Current limitations (will be addressed on bcon2): - Displayed translation in Viewer node is limited to 6000px. - When scaling up the canvas size is limited to the scene resolution size x 1.5 . From that point it crops. If none of these limitations are hit, the Viewer node displays the full input with any translation. Differential Revision: https://developer.blender.org/D12466 --- source/blender/compositor/intern/COM_FullFrameExecutionModel.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/compositor/intern/COM_FullFrameExecutionModel.h') diff --git a/source/blender/compositor/intern/COM_FullFrameExecutionModel.h b/source/blender/compositor/intern/COM_FullFrameExecutionModel.h index f75d4f1afdc..66dfb8f052c 100644 --- a/source/blender/compositor/intern/COM_FullFrameExecutionModel.h +++ b/source/blender/compositor/intern/COM_FullFrameExecutionModel.h @@ -61,8 +61,10 @@ class FullFrameExecutionModel : public ExecutionModel { void determine_areas_to_render_and_reads(); void render_operations(); void render_output_dependencies(NodeOperation *output_op); - Vector get_input_buffers(NodeOperation *op); - MemoryBuffer *create_operation_buffer(NodeOperation *op); + Vector get_input_buffers(NodeOperation *op, + const int output_x, + const int output_y); + MemoryBuffer *create_operation_buffer(NodeOperation *op, const int output_x, const int output_y); void render_operation(NodeOperation *op); void operation_finished(NodeOperation *operation); -- cgit v1.2.3