[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51573] trunk/blender/source/blender/ compositor/operations/COM_CropOperation.cpp: Updated crop image setting to make every pixel outside the crop black as

Jeroen Bakker j.bakker at atmind.nl
Wed Oct 24 10:59:39 CEST 2012


Revision: 51573
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51573
Author:   jbakker
Date:     2012-10-24 08:59:36 +0000 (Wed, 24 Oct 2012)
Log Message:
-----------
Updated crop image setting to make every pixel outside the crop black as
it is expected.

Fix for [#32955] Compositer "Crop" node option "Crop Image Size" doesn't
really crop the input image

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/operations/COM_CropOperation.cpp

Modified: trunk/blender/source/blender/compositor/operations/COM_CropOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_CropOperation.cpp	2012-10-24 08:36:10 UTC (rev 51572)
+++ trunk/blender/source/blender/compositor/operations/COM_CropOperation.cpp	2012-10-24 08:59:36 UTC (rev 51573)
@@ -114,5 +114,12 @@
 
 void CropImageOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
 {
-	this->m_inputOperation->read(output, (x + this->m_xmin), (y + this->m_ymin), sampler);
+	if (x >= 0 && x < getWidth() && y >= 0 && y < getHeight()) 
+	{
+		this->m_inputOperation->read(output, (x + this->m_xmin), (y + this->m_ymin), sampler);
+	}
+	else
+	{
+		zero_v4(output);
+	}
 }




More information about the Bf-blender-cvs mailing list