[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50534] trunk/blender/source/blender/ compositor: Fix for [#32536] Mixing with translated images in compositor produces

Jeroen Bakker j.bakker at atmind.nl
Tue Sep 11 18:57:06 CEST 2012


Revision: 50534
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50534
Author:   jbakker
Date:     2012-09-11 16:57:05 +0000 (Tue, 11 Sep 2012)
Log Message:
-----------
Fix for [#32536] Mixing with translated images in compositor produces
garbage strips for each tile

Promoted the behaviour of combine channels to node operation so that all
nodes use the same implementation. (CombineChannel had a better
implementation)

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_CombineChannelsOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_CombineChannelsOperation.h

Modified: trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp	2012-09-11 16:28:01 UTC (rev 50533)
+++ trunk/blender/source/blender/compositor/intern/COM_NodeOperation.cpp	2012-09-11 16:57:05 UTC (rev 50534)
@@ -124,19 +124,26 @@
 		return false;
 	}
 	else {
-		unsigned int index;
-		vector<InputSocket *> &inputsockets = this->getInputSockets();
-	
-		for (index = 0; index < inputsockets.size(); index++) {
-			InputSocket *inputsocket = inputsockets[index];
-			if (inputsocket->isConnected()) {
-				NodeOperation *inputoperation = (NodeOperation *)inputsocket->getConnection()->getFromNode();
-				bool result = inputoperation->determineDependingAreaOfInterest(input, readOperation, output);
-				if (result) {
-					return true;
+		rcti tempOutput;
+		bool first = true;
+		for (int i = 0 ; i < getNumberOfInputSockets() ; i ++) {
+			NodeOperation * inputOperation = this->getInputOperation(i);
+			if (inputOperation && inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
+				if (first) {
+					output->xmin = tempOutput.xmin;
+					output->ymin = tempOutput.ymin;
+					output->xmax = tempOutput.xmax;
+					output->ymax = tempOutput.ymax;
+					first = false;
 				}
+				else {
+					output->xmin = MIN2(output->xmin, tempOutput.xmin);
+					output->ymin = MIN2(output->ymin, tempOutput.ymin);
+					output->xmax = MAX2(output->xmax, tempOutput.xmax);
+					output->ymax = MAX2(output->ymax, tempOutput.ymax);
+				}
 			}
 		}
-		return false;
+		return !first;
 	}
 }

Modified: trunk/blender/source/blender/compositor/operations/COM_CombineChannelsOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_CombineChannelsOperation.cpp	2012-09-11 16:28:01 UTC (rev 50533)
+++ trunk/blender/source/blender/compositor/operations/COM_CombineChannelsOperation.cpp	2012-09-11 16:57:05 UTC (rev 50534)
@@ -37,31 +37,6 @@
 	this->m_inputChannel4Operation = NULL;
 }
 
-bool CombineChannelsOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) 
-{
-	rcti tempOutput;
-	bool first = true;
-	for (int i = 0 ; i < 4 ; i ++) {
-		NodeOperation * inputOperation = this->getInputOperation(i);
-		if (inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
-			if (first) {
-				output->xmin = tempOutput.xmin;
-				output->ymin = tempOutput.ymin;
-				output->xmax = tempOutput.xmax;
-				output->ymax = tempOutput.ymax;
-				first = false;
-			}
-			else {
-				output->xmin = MIN2(output->xmin, tempOutput.xmin);
-				output->ymin = MIN2(output->ymin, tempOutput.ymin);
-				output->xmax = MAX2(output->xmax, tempOutput.xmax);
-				output->ymax = MAX2(output->ymax, tempOutput.ymax);
-			}
-		}
-	}
-	return !first;
-}
-
 void CombineChannelsOperation::initExecution()
 {
 	this->m_inputChannel1Operation = this->getInputSocketReader(0);
@@ -82,7 +57,6 @@
 void CombineChannelsOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
 {
 	float input[4];
-	/// @todo: remove if statements
 	if (this->m_inputChannel1Operation) {
 		this->m_inputChannel1Operation->read(input, x, y, sampler);
 		output[0] = input[0];

Modified: trunk/blender/source/blender/compositor/operations/COM_CombineChannelsOperation.h
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_CombineChannelsOperation.h	2012-09-11 16:28:01 UTC (rev 50533)
+++ trunk/blender/source/blender/compositor/operations/COM_CombineChannelsOperation.h	2012-09-11 16:57:05 UTC (rev 50534)
@@ -37,8 +37,6 @@
 	
 	void initExecution();
 	void deinitExecution();
-	
-	bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
 };
 
 #endif




More information about the Bf-blender-cvs mailing list