[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49149] branches/soc-2011-tomato: Merging r49146 through r49148 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Mon Jul 23 20:28:01 CEST 2012


Revision: 49149
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49149
Author:   nazgul
Date:     2012-07-23 18:28:00 +0000 (Mon, 23 Jul 2012)
Log Message:
-----------
Merging r49146 through r49148 from trunk into soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49146
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49148

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.h

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49145
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49148

Modified: branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp	2012-07-23 18:27:06 UTC (rev 49148)
+++ branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp	2012-07-23 18:28:00 UTC (rev 49149)
@@ -30,6 +30,8 @@
 #include "COM_KeyingDespillOperation.h"
 #include "COM_KeyingClipOperation.h"
 
+#include "COM_MathBaseOperation.h"
+
 #include "COM_SeparateChannelOperation.h"
 #include "COM_CombineChannelsOperation.h"
 #include "COM_ConvertRGBToYCCOperation.h"
@@ -239,8 +241,6 @@
 	keyingOperation->setScreenBalance(keying_data->screen_balance);
 
 	inputScreen->relinkConnections(keyingOperation->getInputSocket(1), 1, graph);
-	inputGarbageMatte->relinkConnections(keyingOperation->getInputSocket(2), 2, graph);
-	inputCoreMatte->relinkConnections(keyingOperation->getInputSocket(3), 3, graph);
 
 	if (keying_data->blur_pre) {
 		/* chroma preblur operation for input of keying operation  */
@@ -256,18 +256,54 @@
 
 	postprocessedMatte = keyingOperation->getOutputSocket();
 
+	/* black / white clipping */
 	if (keying_data->clip_black > 0.0f || keying_data->clip_white < 1.0f) {
 		postprocessedMatte = setupClip(graph, postprocessedMatte,
 		                               keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance,
 		                               keying_data->clip_black, keying_data->clip_white, false);
 	}
 
+	/* output edge matte */
 	if (outputEdges->isConnected()) {
 		edgesMatte = setupClip(graph, postprocessedMatte,
 		                       keying_data->edge_kernel_radius, keying_data->edge_kernel_tolerance,
 		                       keying_data->clip_black, keying_data->clip_white, true);
 	}
 
+	/* apply garbage matte */
+	if (inputGarbageMatte->isConnected()) {
+		SetValueOperation *valueOperation = new SetValueOperation();
+		MathSubtractOperation *subtractOperation = new MathSubtractOperation();
+		MathMinimumOperation *minOperation = new MathMinimumOperation();
+
+		valueOperation->setValue(1.0f);
+
+		addLink(graph, valueOperation->getOutputSocket(), subtractOperation->getInputSocket(0));
+		inputGarbageMatte->relinkConnections(subtractOperation->getInputSocket(1), 0, graph);
+
+		addLink(graph, subtractOperation->getOutputSocket(), minOperation->getInputSocket(0));
+		addLink(graph, postprocessedMatte, minOperation->getInputSocket(1));
+
+		postprocessedMatte = minOperation->getOutputSocket();
+
+		graph->addOperation(valueOperation);
+		graph->addOperation(subtractOperation);
+		graph->addOperation(minOperation);
+	}
+
+	/* apply core matte */
+	if (inputCoreMatte->isConnected()) {
+		MathMaximumOperation *maxOperation = new MathMaximumOperation();
+
+		inputCoreMatte->relinkConnections(maxOperation->getInputSocket(0), 0, graph);
+
+		addLink(graph, postprocessedMatte, maxOperation->getInputSocket(1));
+
+		postprocessedMatte = maxOperation->getOutputSocket();
+
+		graph->addOperation(maxOperation);
+	}
+
 	/* apply blur on matte if needed */
 	if (keying_data->blur_post)
 		postprocessedMatte = setupPostBlur(graph, postprocessedMatte, keying_data->blur_post);

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.cpp	2012-07-23 18:27:06 UTC (rev 49148)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.cpp	2012-07-23 18:28:00 UTC (rev 49149)
@@ -57,45 +57,33 @@
 {
 	this->addInputSocket(COM_DT_COLOR);
 	this->addInputSocket(COM_DT_COLOR);
-	this->addInputSocket(COM_DT_VALUE);
-	this->addInputSocket(COM_DT_VALUE);
 	this->addOutputSocket(COM_DT_VALUE);
 
 	this->m_screenBalance = 0.5f;
 
 	this->m_pixelReader = NULL;
 	this->m_screenReader = NULL;
-	this->m_garbageReader = NULL;
-	this->m_coreReader = NULL;
 }
 
 void KeyingOperation::initExecution()
 {
 	this->m_pixelReader = this->getInputSocketReader(0);
 	this->m_screenReader = this->getInputSocketReader(1);
-	this->m_garbageReader = this->getInputSocketReader(2);
-	this->m_coreReader = this->getInputSocketReader(3);
 }
 
 void KeyingOperation::deinitExecution()
 {
 	this->m_pixelReader = NULL;
 	this->m_screenReader = NULL;
-	this->m_garbageReader = NULL;
-	this->m_coreReader = NULL;
 }
 
 void KeyingOperation::executePixel(float *color, float x, float y, PixelSampler sampler)
 {
 	float pixelColor[4];
 	float screenColor[4];
-	float garbageValue[4];
-	float coreValue[4];
 
 	this->m_pixelReader->read(pixelColor, x, y, sampler);
 	this->m_screenReader->read(screenColor, x, y, sampler);
-	this->m_garbageReader->read(garbageValue, x, y, sampler);
-	this->m_coreReader->read(coreValue, x, y, sampler);
 
 	int primary_channel = get_pixel_primary_channel(screenColor);
 
@@ -130,10 +118,4 @@
 			color[0] = distance;
 		}
 	}
-
-	/* apply garbage matte */
-	color[0] = MIN2(color[0], 1.0f - garbageValue[0]);
-
-	/* apply core matte */
-	color[0] = MAX2(color[0], coreValue[0]);
 }

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.h	2012-07-23 18:27:06 UTC (rev 49148)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingOperation.h	2012-07-23 18:28:00 UTC (rev 49149)
@@ -38,8 +38,6 @@
 protected:
 	SocketReader *m_pixelReader;
 	SocketReader *m_screenReader;
-	SocketReader *m_garbageReader;
-	SocketReader *m_coreReader;
 
 	float m_screenBalance;
 


Property changes on: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49145
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49148


Property changes on: branches/soc-2011-tomato/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-49145
   + /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-49148




More information about the Bf-blender-cvs mailing list