[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46271] branches/tile/source/blender/ compositor/operations: TileBranch

Jeroen Bakker j.bakker at atmind.nl
Fri May 4 13:59:21 CEST 2012


Revision: 46271
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46271
Author:   jbakker
Date:     2012-05-04 11:59:20 +0000 (Fri, 04 May 2012)
Log Message:
-----------
TileBranch
 * fix for [#31227] Bilateral blur is moving picture by 1-2 pix to right and up
 the number of iterations was not affecting the blur.

 - At Mind - 

Modified Paths:
--------------
    branches/tile/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp
    branches/tile/source/blender/compositor/operations/COM_BilateralBlurOperation.h

Modified: branches/tile/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp
===================================================================
--- branches/tile/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp	2012-05-04 11:50:11 UTC (rev 46270)
+++ branches/tile/source/blender/compositor/operations/COM_BilateralBlurOperation.cpp	2012-05-04 11:59:20 UTC (rev 46271)
@@ -40,6 +40,7 @@
 void BilateralBlurOperation::initExecution() {
 	this->inputColorProgram = getInputSocketReader(0);
 	this->inputDeterminatorProgram = getInputSocketReader(1);
+	this->space = this->data->sigma_space + this->data->iter;
 	QualityStepHelper::initExecution(COM_QH_INCREASE);
 }
 
@@ -50,12 +51,12 @@
 	float tempColor[4];
 	float blurColor[4];
 	float blurDivider;
-	float sigmaspace = this->data->sigma_space;
+	float space = this->space;
 	float sigmacolor = this->data->sigma_color;
-	int minx = x - sigmaspace;
-	int maxx = x + sigmaspace;
-	int miny = y - sigmaspace;
-	int maxy = y + sigmaspace;
+	int minx = floor(x - space);
+	int maxx = ceil(x + space);
+	int miny = floor(y - space);
+	int maxy = ceil(y + space);
 	float deltaColor;
 	this->inputDeterminatorProgram->read(determinatorReferenceColor, x, y, inputBuffers, data);
 	
@@ -102,10 +103,10 @@
 bool BilateralBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) {
 	rcti newInput;
 
-	newInput.xmax = input->xmax + (this->data->sigma_space);
-	newInput.xmin = input->xmin - (this->data->sigma_space);
-	newInput.ymax = input->ymax + (this->data->sigma_space);
-	newInput.ymin = input->ymin - (this->data->sigma_space);
+	newInput.xmax = input->xmax + (this->space);
+	newInput.xmin = input->xmin - (this->space);
+	newInput.ymax = input->ymax + (this->space);
+	newInput.ymin = input->ymin - (this->space);
 
 	return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }

Modified: branches/tile/source/blender/compositor/operations/COM_BilateralBlurOperation.h
===================================================================
--- branches/tile/source/blender/compositor/operations/COM_BilateralBlurOperation.h	2012-05-04 11:50:11 UTC (rev 46270)
+++ branches/tile/source/blender/compositor/operations/COM_BilateralBlurOperation.h	2012-05-04 11:59:20 UTC (rev 46271)
@@ -30,6 +30,7 @@
 	SocketReader* inputColorProgram;
 	SocketReader* inputDeterminatorProgram;
 	NodeBilateralBlurData* data;
+	float space;
 
 public:
 	BilateralBlurOperation();




More information about the Bf-blender-cvs mailing list