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:
authorManuel Castilla <manzanillawork@gmail.com>2021-09-12 21:00:03 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-09-12 21:00:03 +0300
commit313ea8a28e8a7a95d723fd4c46ab349ed08bea0f (patch)
tree994277f03e4efa6fd802a999c54910e5e2b188e5 /source/blender/compositor/intern/COM_SharedOperationBuffers.cc
parenta0a9499a3a6bc8001c59c7b547ca7a7781415c9a (diff)
Compositor: Add support for canvas compositingtemp-compositor-canvas
This patch adds functionality for operations that require pixels translation or resizing on "Full Frame" mode, allowing to adjust their canvas within the output canvas. It fixes current cropping issues in translate, scale, rotate and transform nodes by adjusting their canvas to the result, instead of the input canvas. Only the scale node canvas is limited to the scene output resolution size for performance reasons as there are many operations that require their whole input to be rendered. Operations output buffer is still always on (0,0) position for easier image algorithm implementation, even when operation canvas is not.
Diffstat (limited to 'source/blender/compositor/intern/COM_SharedOperationBuffers.cc')
-rw-r--r--source/blender/compositor/intern/COM_SharedOperationBuffers.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/compositor/intern/COM_SharedOperationBuffers.cc b/source/blender/compositor/intern/COM_SharedOperationBuffers.cc
index 7e0486b0f54..55153bd4f0a 100644
--- a/source/blender/compositor/intern/COM_SharedOperationBuffers.cc
+++ b/source/blender/compositor/intern/COM_SharedOperationBuffers.cc
@@ -76,9 +76,17 @@ void SharedOperationBuffers::register_read(NodeOperation *read_op)
/**
* Get registered areas given operation needs to render.
*/
-blender::Span<rcti> SharedOperationBuffers::get_areas_to_render(NodeOperation *op)
+Vector<rcti> SharedOperationBuffers::get_areas_to_render(NodeOperation *op,
+ const int offset_x,
+ const int offset_y)
{
- return get_buffer_data(op).render_areas.as_span();
+ Span<rcti> render_areas = get_buffer_data(op).render_areas.as_span();
+ Vector<rcti> dst_areas;
+ for (rcti dst : render_areas) {
+ BLI_rcti_translate(&dst, offset_x, offset_y);
+ dst_areas.append(std::move(dst));
+ }
+ return dst_areas;
}
/**