diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-09 10:45:01 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-09 10:48:42 +0300 |
commit | 2ae0f1e70be543b37f426dc1b7d8a44b05301faf (patch) | |
tree | acb1ff112941faf9cced6a3183e71faf688777ef | |
parent | 36df8cc1e5be695fef4aeafc2c6b9aee92f5d56a (diff) |
Fix T43908: Mask render bug, one pixel black line
This was a regression caused by attempts to fix T42844 and there were
some red-herrings which lead me to the wrong way to fix it. It's some
deeper issue than just interpolation offset, it's mainly how the node
resolution is being mapped to each other.
It could be actually a part of canvas awareness project..
8 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index e0c542108a1..322e4bc388b 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -259,7 +259,7 @@ public: float u = x; float v = y; this->wrap_pixel(u, v, extend_x, extend_y); - BLI_bilinear_interpolation_fl(this->m_buffer, result, this->m_width, this->m_height, this->m_num_channels, u - 0.5f, v - 0.5f); + BLI_bilinear_interpolation_fl(this->m_buffer, result, this->m_width, this->m_height, this->m_num_channels, u, v); } void readEWA(float *result, const float uv[2], const float derivatives[2][2], PixelSampler sampler); diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp index c2c6a129d56..e3438bcbd15 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.cpp +++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp @@ -185,7 +185,7 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber) for (y = y1; y < y2 && (!breaked); y++) { for (x = x1; x < x2 && (!breaked); x++) { - float input_x = (float)x + dx + 0.5f, input_y = (float)y + dy + 0.5f; + int input_x = x + dx, input_y = y + dy; this->m_imageInput->readSampled(color, input_x, input_y, COM_PS_NEAREST); if (this->m_useAlphaInput) { diff --git a/source/blender/compositor/operations/COM_ImageOperation.cpp b/source/blender/compositor/operations/COM_ImageOperation.cpp index ff0ffe27b42..2733c483146 100644 --- a/source/blender/compositor/operations/COM_ImageOperation.cpp +++ b/source/blender/compositor/operations/COM_ImageOperation.cpp @@ -119,10 +119,10 @@ static void sampleImageAtLocation(ImBuf *ibuf, float x, float y, PixelSampler sa nearest_interpolation_color(ibuf, NULL, color, x, y); break; case COM_PS_BILINEAR: - bilinear_interpolation_color(ibuf, NULL, color, x - 0.5f, y - 0.5f); + bilinear_interpolation_color(ibuf, NULL, color, x, y); break; case COM_PS_BICUBIC: - bicubic_interpolation_color(ibuf, NULL, color, x - 0.5f, y - 0.5f); + bicubic_interpolation_color(ibuf, NULL, color, x, y); break; } } @@ -133,10 +133,10 @@ static void sampleImageAtLocation(ImBuf *ibuf, float x, float y, PixelSampler sa nearest_interpolation_color(ibuf, byte_color, NULL, x, y); break; case COM_PS_BILINEAR: - bilinear_interpolation_color(ibuf, byte_color, NULL, x - 0.5f, y - 0.5f); + bilinear_interpolation_color(ibuf, byte_color, NULL, x, y); break; case COM_PS_BICUBIC: - bicubic_interpolation_color(ibuf, byte_color, NULL, x - 0.5f, y - 0.5f); + bicubic_interpolation_color(ibuf, byte_color, NULL, x, y); break; } rgba_uchar_to_float(color, byte_color); diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.cpp b/source/blender/compositor/operations/COM_MovieClipOperation.cpp index 2ed498d1303..9a184ae1216 100644 --- a/source/blender/compositor/operations/COM_MovieClipOperation.cpp +++ b/source/blender/compositor/operations/COM_MovieClipOperation.cpp @@ -103,10 +103,10 @@ void MovieClipBaseOperation::executePixelSampled(float output[4], float x, float nearest_interpolation_color(ibuf, NULL, output, x, y); break; case COM_PS_BILINEAR: - bilinear_interpolation_color(ibuf, NULL, output, x - 0.5f, y - 0.5f); + bilinear_interpolation_color(ibuf, NULL, output, x, y); break; case COM_PS_BICUBIC: - bicubic_interpolation_color(ibuf, NULL, output, x - 0.5f, y - 0.5f); + bicubic_interpolation_color(ibuf, NULL, output, x, y); break; } } diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp index 35ab20fb122..23fba5a7999 100644 --- a/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp +++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.cpp @@ -54,10 +54,10 @@ void MultilayerColorOperation::executePixelSampled(float output[4], float x, flo nearest_interpolation_color(this->m_buffer, NULL, output, x, y); break; case COM_PS_BILINEAR: - bilinear_interpolation_color(this->m_buffer, NULL, output, x - 0.5f, y - 0.5f); + bilinear_interpolation_color(this->m_buffer, NULL, output, x, y); break; case COM_PS_BICUBIC: - bicubic_interpolation_color(this->m_buffer, NULL, output, x - 0.5f, y - 0.5f); + bicubic_interpolation_color(this->m_buffer, NULL, output, x, y); break; } } diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cpp b/source/blender/compositor/operations/COM_RenderLayersProg.cpp index 121998b5569..409fa68bacf 100644 --- a/source/blender/compositor/operations/COM_RenderLayersProg.cpp +++ b/source/blender/compositor/operations/COM_RenderLayersProg.cpp @@ -104,11 +104,11 @@ void RenderLayersBaseProg::doInterpolation(float output[4], float x, float y, Pi } case COM_PS_BILINEAR: - BLI_bilinear_interpolation_fl(this->m_inputBuffer, output, width, height, this->m_elementsize, x - 0.5f, y - 0.5f); + BLI_bilinear_interpolation_fl(this->m_inputBuffer, output, width, height, this->m_elementsize, x, y); break; case COM_PS_BICUBIC: - BLI_bicubic_interpolation_fl(this->m_inputBuffer, output, width, height, this->m_elementsize, x - 0.5f, y - 0.5f); + BLI_bicubic_interpolation_fl(this->m_inputBuffer, output, width, height, this->m_elementsize, x, y); break; } } diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp index defad164567..53c0acd781a 100644 --- a/source/blender/compositor/operations/COM_ViewerOperation.cpp +++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp @@ -100,12 +100,12 @@ void ViewerOperation::executeRegion(rcti *rect, unsigned int tileNumber) for (y = y1; y < y2 && (!breaked); y++) { for (x = x1; x < x2; x++) { - this->m_imageInput->readSampled(&(buffer[offset4]), (float)x + 0.5f, (float)y + 0.5f, COM_PS_NEAREST); + this->m_imageInput->readSampled(&(buffer[offset4]), x, y, COM_PS_NEAREST); if (this->m_useAlphaInput) { - this->m_alphaInput->readSampled(alpha, (float)x + 0.5f, (float)y + 0.5f, COM_PS_NEAREST); + this->m_alphaInput->readSampled(alpha, x, y, COM_PS_NEAREST); buffer[offset4 + 3] = alpha[0]; } - this->m_depthInput->readSampled(depth, (float)x + 0.5f, (float)y + 0.5f, COM_PS_NEAREST); + this->m_depthInput->readSampled(depth, x, y, COM_PS_NEAREST); depthbuffer[offset] = depth[0]; offset ++; diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp index 58bded75fdb..fccff2a33bf 100644 --- a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp @@ -74,7 +74,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber) for (y = y1; y < y2 && (!breaked); y++) { int offset4 = (y * memoryBuffer->getWidth() + x1) * num_channels; for (x = x1; x < x2; x++) { - this->m_input->read(&(buffer[offset4]), (float)x + 0.5f, (float)y + 0.5f, data); + this->m_input->read(&(buffer[offset4]), x, y, data); offset4 += num_channels; } if (isBreaked()) { @@ -99,7 +99,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber) for (y = y1; y < y2 && (!breaked); y++) { int offset4 = (y * memoryBuffer->getWidth() + x1) * num_channels; for (x = x1; x < x2; x++) { - this->m_input->readSampled(&(buffer[offset4]), (float)x + 0.5f, (float)y + 0.5f, COM_PS_NEAREST); + this->m_input->readSampled(&(buffer[offset4]), x, y, COM_PS_NEAREST); offset4 += num_channels; } if (isBreaked()) { |