[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48257] branches/soc-2011-tomato: Merging r48255 through r48256 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Mon Jun 25 10:24:13 CEST 2012


Revision: 48257
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48257
Author:   nazgul
Date:     2012-06-25 08:24:12 +0000 (Mon, 25 Jun 2012)
Log Message:
-----------
Merging r48255 through r48256 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp
    branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.h
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingBlurOperation.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-48254
   + /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-48256

Modified: branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp	2012-06-25 08:21:55 UTC (rev 48256)
+++ branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.cpp	2012-06-25 08:24:12 UTC (rev 48257)
@@ -66,13 +66,21 @@
 			addLink(graph, separateOperation->getOutputSocket(0), combineOperation->getInputSocket(channel));
 		}
 		else {
-			KeyingBlurOperation *blurOperation = new KeyingBlurOperation();
+			KeyingBlurOperation *blurXOperation = new KeyingBlurOperation();
+			KeyingBlurOperation *blurYOperation = new KeyingBlurOperation();
 
-			blurOperation->setSize(size);
+			blurXOperation->setSize(size);
+			blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X);
 
-			addLink(graph, separateOperation->getOutputSocket(0), blurOperation->getInputSocket(0));
-			addLink(graph, blurOperation->getOutputSocket(0), combineOperation->getInputSocket(channel));
-			graph->addOperation(blurOperation);
+			blurYOperation->setSize(size);
+			blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y);
+
+			addLink(graph, separateOperation->getOutputSocket(), blurXOperation->getInputSocket(0));
+			addLink(graph, blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0));
+			addLink(graph, blurYOperation->getOutputSocket(0), combineOperation->getInputSocket(channel));
+
+			graph->addOperation(blurXOperation);
+			graph->addOperation(blurYOperation);
 		}
 	}
 
@@ -86,17 +94,24 @@
 	return convertYCCToRGBOperation->getOutputSocket(0);
 }
 
-OutputSocket *KeyingNode::setupPostBlur(ExecutionSystem *graph, OutputSocket *postBLurInput, int size)
+OutputSocket *KeyingNode::setupPostBlur(ExecutionSystem *graph, OutputSocket *postBlurInput, int size)
 {
-	KeyingBlurOperation *blurOperation = new KeyingBlurOperation();
+	KeyingBlurOperation *blurXOperation = new KeyingBlurOperation();
+	KeyingBlurOperation *blurYOperation = new KeyingBlurOperation();
 
-	blurOperation->setSize(size);
+	blurXOperation->setSize(size);
+	blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X);
 
-	addLink(graph, postBLurInput, blurOperation->getInputSocket(0));
+	blurYOperation->setSize(size);
+	blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y);
 
-	graph->addOperation(blurOperation);
+	addLink(graph, postBlurInput, blurXOperation->getInputSocket(0));
+	addLink(graph, blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0));
 
-	return blurOperation->getOutputSocket();
+	graph->addOperation(blurXOperation);
+	graph->addOperation(blurYOperation);
+
+	return blurYOperation->getOutputSocket();
 }
 
 OutputSocket *KeyingNode::setupDilateErode(ExecutionSystem *graph, OutputSocket *dilateErodeInput, int distance)

Modified: branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.h	2012-06-25 08:21:55 UTC (rev 48256)
+++ branches/soc-2011-tomato/source/blender/compositor/nodes/COM_KeyingNode.h	2012-06-25 08:24:12 UTC (rev 48257)
@@ -30,7 +30,7 @@
 class KeyingNode : public Node {
 protected:
 	OutputSocket *setupPreBlur(ExecutionSystem *graph, InputSocket *inputImage, int size, OutputSocket **originalImage);
-	OutputSocket *setupPostBlur(ExecutionSystem *graph, OutputSocket *postBLurInput, int size);
+	OutputSocket *setupPostBlur(ExecutionSystem *graph, OutputSocket *postBlurInput, int size);
 	OutputSocket *setupDilateErode(ExecutionSystem *graph, OutputSocket *dilateErodeInput, int distance);
 	OutputSocket *setupDespill(ExecutionSystem *graph, OutputSocket *despillInput, OutputSocket *inputSrceen, float factor);
 	OutputSocket *setupClip(ExecutionSystem *graph, OutputSocket *clipInput, int kernelRadius, float kernelTolerance,

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp	2012-06-25 08:21:55 UTC (rev 48256)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp	2012-06-25 08:24:12 UTC (rev 48257)
@@ -33,7 +33,8 @@
 	this->addInputSocket(COM_DT_VALUE);
 	this->addOutputSocket(COM_DT_VALUE);
 
-	this->size = 0.0f;
+	this->size = 0;
+	this->axis = 0;
 
 	this->setComplex(true);
 }
@@ -53,23 +54,35 @@
 	int bufferWidth = inputBuffer->getWidth();
 	int bufferHeight = inputBuffer->getHeight();
 
-	int i, j, count = 0;
+	int i, count = 0;
 
 	float average = 0.0f;
 
-	for (i = -this->size + 1; i < this->size; i++) {
-		for (j = -this->size + 1; j < this->size; j++) {
-			int cx = x + j, cy = y + i;
+	if (this->axis == 0) {
+		for (i = -this->size + 1; i < this->size; i++) {
+			int cx = x + i;
 
-			if (cx >= 0 && cx < bufferWidth && cy >= 0 && cy < bufferHeight) {
-				int bufferIndex = (cy * bufferWidth + cx) * 4;
+			if (cx >= 0 && cx < bufferWidth) {
+				int bufferIndex = (y * bufferWidth + cx) * 4;
 
 				average += buffer[bufferIndex];
 				count++;
 			}
 		}
 	}
+	else {
+		for (i = -this->size + 1; i < this->size; i++) {
+			int cy = y + i;
 
+			if (cy >= 0 && cy < bufferHeight) {
+				int bufferIndex = (cy * bufferWidth + x) * 4;
+
+				average += buffer[bufferIndex];
+				count++;
+			}
+		}
+	}
+
 	average /= (float) count;
 
 	color[0] = average;
@@ -79,10 +92,18 @@
 {
 	rcti newInput;
 
-	newInput.xmin = input->xmin - this->size;
-	newInput.ymin = input->ymin - this->size;
-	newInput.xmax = input->xmax + this->size;
-	newInput.ymax = input->ymax + this->size;
+	if (this->axis == 0) {
+		newInput.xmin = input->xmin - this->size;
+		newInput.ymin = input->ymin;
+		newInput.xmax = input->xmax + this->size;
+		newInput.ymax = input->ymax;
+	}
+	else {
+		newInput.xmin = input->xmin;
+		newInput.ymin = input->ymin - this->size;
+		newInput.xmax = input->xmax;
+		newInput.ymax = input->ymax + this->size;
+	}
 
 	return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
 }

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingBlurOperation.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingBlurOperation.h	2012-06-25 08:21:55 UTC (rev 48256)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_KeyingBlurOperation.h	2012-06-25 08:24:12 UTC (rev 48257)
@@ -32,11 +32,18 @@
 class KeyingBlurOperation : public NodeOperation {
 protected:
 	int size;
+	int axis;
 
 public:
+	enum BlurAxis {
+		BLUR_AXIS_X = 0,
+		BLUR_AXIS_Y = 1
+	};
+
 	KeyingBlurOperation();
 
-	void setSize(float value) {this->size = value;}
+	void setSize(int value) {this->size = value;}
+	void setAxis(int value) {this->axis = value;}
 
 	void *initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
 


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-48254
   + /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-48256


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-48254
   + /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-48256




More information about the Bf-blender-cvs mailing list