[Bf-blender-cvs] [d516fed] master: Fix T38488: Single pixel line artifact with Rotate and Wrapped Translate nodes.

Lukas Tönne noreply at git.blender.org
Tue Feb 18 19:07:22 CET 2014


Commit: d516fedba3ce57b2ca7bd537b64b31bd0ca3c6bb
Author: Lukas Tönne
Date:   Tue Feb 18 18:55:35 2014 +0100
https://developer.blender.org/rBd516fedba3ce57b2ca7bd537b64b31bd0ca3c6bb

Fix T38488: Single pixel line artifact with Rotate and Wrapped Translate
nodes.

The Rotate node was calculating the center with a 1 pixel offset, which
effectively shifts the image by 1 pixel on one or both axis for
right-angle (90 degree) rotations.

Note that the wrapping feature for translate nodes can still produce
undesirable results for non-quadratic images. This is because of how
the resolution calculation works atm: the Rotate node will keep the
resolution of the input image, even if the resulting image is then
cropped or leaves empty margins. There is no easy way to fix that
without redesign.

===================================================================

M	source/blender/compositor/operations/COM_RotateOperation.cpp

===================================================================

diff --git a/source/blender/compositor/operations/COM_RotateOperation.cpp b/source/blender/compositor/operations/COM_RotateOperation.cpp
index c6ad87b..6aca9fe 100644
--- a/source/blender/compositor/operations/COM_RotateOperation.cpp
+++ b/source/blender/compositor/operations/COM_RotateOperation.cpp
@@ -38,8 +38,8 @@ void RotateOperation::initExecution()
 {
 	this->m_imageSocket = this->getInputSocketReader(0);
 	this->m_degreeSocket = this->getInputSocketReader(1);
-	this->m_centerX = this->getWidth() / 2.0;
-	this->m_centerY = this->getHeight() / 2.0;
+	this->m_centerX = (getWidth() - 1) / 2.0;
+	this->m_centerY = (getHeight() - 1) / 2.0;
 }
 
 void RotateOperation::deinitExecution()




More information about the Bf-blender-cvs mailing list