From 8d2e79aaab565044f86c9fd1a2d47a565f2bcb62 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Thu, 5 Sep 2013 10:45:21 +0000 Subject: Fix #36113, Translate's wrapping has 1 pixel gap in X and Y after scale node. The issue with wrapping is that it requires correct interpolation of the border pixels. Since interpolation is done at the far left end of the node tree in buffer/image/etc read operations, the wrapping setting can not be used directly in those operations (otherwise in-line translate operations would cause conflicts). To make wrapping work correctly we need to add a buffer in front of the translate operation, which can then be interpolated correctly based on wrapping. The WrapOperation becomes a variant of ReadBufferOperation, which uses its wrapping setting to determine the correct "extend" mode for interpolation of the buffer. --- .../compositor/operations/COM_ReadBufferOperation.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/compositor/operations/COM_ReadBufferOperation.cpp') diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp index 369e575e976..3aeef6bf409 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp @@ -66,6 +66,21 @@ void ReadBufferOperation::executePixel(float output[4], float x, float y, PixelS } } +void ReadBufferOperation::executePixelExtend(float output[4], float x, float y, PixelSampler sampler, + MemoryBufferExtend extend_x, MemoryBufferExtend extend_y) +{ + if (m_single_value) { + /* write buffer has a single value stored at (0,0) */ + m_buffer->read(output, 0, 0); + } + else if (sampler == COM_PS_NEAREST) { + m_buffer->read(output, x, y, extend_x, extend_y); + } + else { + m_buffer->readBilinear(output, x, y, extend_x, extend_y); + } +} + void ReadBufferOperation::executePixel(float output[4], float x, float y, float dx, float dy, PixelSampler sampler) { if (m_single_value) { -- cgit v1.2.3