[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43205] branches/tile/source/blender/ compositor: Separate+Combine YUV + Luminance Matte node for Tile

Dalai Felinto dfelinto at gmail.com
Fri Jan 6 20:13:28 CET 2012


Revision: 43205
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43205
Author:   dfelinto
Date:     2012-01-06 19:13:20 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
Separate+Combine YUV + Luminance Matte node for Tile
reviewed by Jeroen Bakker

Modified Paths:
--------------
    branches/tile/source/blender/compositor/CMakeLists.txt
    branches/tile/source/blender/compositor/intern/COM_Converter.cpp

Added Paths:
-----------
    branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.cpp
    branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.h
    branches/tile/source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp
    branches/tile/source/blender/compositor/nodes/COM_LuminanceMatteNode.h
    branches/tile/source/blender/compositor/nodes/COM_SeparateYUVANode.cpp
    branches/tile/source/blender/compositor/nodes/COM_SeparateYUVANode.h
    branches/tile/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.cpp
    branches/tile/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h
    branches/tile/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.cpp
    branches/tile/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h
    branches/tile/source/blender/compositor/operations/COM_LuminanceMatteOperation.cpp
    branches/tile/source/blender/compositor/operations/COM_LuminanceMatteOperation.h

Modified: branches/tile/source/blender/compositor/CMakeLists.txt
===================================================================
--- branches/tile/source/blender/compositor/CMakeLists.txt	2012-01-06 18:40:48 UTC (rev 43204)
+++ branches/tile/source/blender/compositor/CMakeLists.txt	2012-01-06 19:13:20 UTC (rev 43205)
@@ -155,6 +155,8 @@
 
 		nodes/COM_DifferenceMatteNode.cpp
 		nodes/COM_DifferenceMatteNode.h
+		nodes/COM_LuminanceMatteNode.cpp
+		nodes/COM_LuminanceMatteNode.h
 		nodes/COM_LensDistortionNode.cpp
 		nodes/COM_LensDistortionNode.h
 
@@ -220,6 +222,10 @@
 		nodes/COM_SeparateHSVANode.h
 		nodes/COM_CombineHSVANode.cpp
 		nodes/COM_CombineHSVANode.h
+		nodes/COM_SeparateYUVANode.cpp
+		nodes/COM_SeparateYUVANode.h
+		nodes/COM_CombineYUVANode.cpp
+		nodes/COM_CombineYUVANode.h
 
 		nodes/COM_NormalNode.cpp
 		nodes/COM_NormalNode.h
@@ -343,6 +349,10 @@
 		operations/COM_ZCombineOperation.cpp
 		operations/COM_ZCombineOperation.h
 
+	operations/COM_ConvertRGBToYUVOperation.h
+	operations/COM_ConvertRGBToYUVOperation.cpp
+	operations/COM_ConvertYUVToRGBOperation.h
+	operations/COM_ConvertYUVToRGBOperation.cpp
 	operations/COM_ConvertRGBToHSVOperation.h
 	operations/COM_ConvertRGBToHSVOperation.cpp
 	operations/COM_ConvertHSVToRGBOperation.h
@@ -361,6 +371,8 @@
 	operations/COM_HueSaturationValueCorrectOperation.h
 	operations/COM_DifferenceMatteOperation.h
 	operations/COM_DifferenceMatteOperation.cpp
+	operations/COM_LuminanceMatteOperation.h
+	operations/COM_LuminanceMatteOperation.cpp
 
 	operations/COM_ReadBufferOperation.cpp
 	operations/COM_ReadBufferOperation.h

Modified: branches/tile/source/blender/compositor/intern/COM_Converter.cpp
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_Converter.cpp	2012-01-06 18:40:48 UTC (rev 43204)
+++ branches/tile/source/blender/compositor/intern/COM_Converter.cpp	2012-01-06 19:13:20 UTC (rev 43205)
@@ -70,6 +70,7 @@
 #include "COM_GammaNode.h"
 #include "COM_ColorRampNode.h"
 #include "COM_DifferenceMatteNode.h"
+#include "COM_LuminanceMatteNode.h"
 #include "COM_BlurNode.h"
 #include "COM_BokehBlurNode.h"
 #include "COM_DilateErodeNode.h"
@@ -214,6 +215,9 @@
 	case CMP_NODE_DIFF_MATTE:
 		node = new DifferenceMatteNode(bNode);
 		break;
+	case CMP_NODE_LUMA_MATTE:
+		node = new LuminanceMatteNode(bNode);
+		break;
 	case CMP_NODE_BLUR:
 		node = new BlurNode(bNode);
 		break;

Added: branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.cpp	                        (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.cpp	2012-01-06 19:13:20 UTC (rev 43205)
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor:
+ *		Dalai Felinto
+ */
+
+#include "COM_CombineYUVANode.h"
+#include "COM_ConvertYUVToRGBOperation.h"
+
+CombineYUVANode::CombineYUVANode(bNode *editorNode): CombineRGBANode(editorNode) {
+}
+
+void CombineYUVANode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) {
+	ConvertYUVToRGBOperation *operation = new ConvertYUVToRGBOperation();
+	OutputSocket *outputSocket = this->getOutputSocket(0);
+	if (outputSocket->isConnected()) {
+		outputSocket->relinkConnections(operation->getOutputSocket());
+		addLink(graph, outputSocket, operation->getInputSocket(0));
+	}
+	graph->addOperation(operation);
+	CombineRGBANode::convertToOperations(graph, context);
+}


Property changes on: branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.cpp
___________________________________________________________________
Added: svn:eol
   + native

Added: branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.h
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.h	                        (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.h	2012-01-06 19:13:20 UTC (rev 43205)
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor:
+ *		Dalai Felinto
+ */
+
+#ifndef _COM_CombineYUVANode_h
+#define _COM_CombineYUVANode_h
+
+#include "COM_Node.h"
+#include "DNA_node_types.h"
+#include "COM_CombineRGBANode.h"
+/**
+  * @brief CombineYUVANode
+  * @ingroup Node
+  */
+class CombineYUVANode : public CombineRGBANode {
+public:
+	CombineYUVANode(bNode *editorNode);
+	void convertToOperations(ExecutionSystem *graph, CompositorContext *context);
+};
+#endif


Property changes on: branches/tile/source/blender/compositor/nodes/COM_CombineYUVANode.h
___________________________________________________________________
Added: svn:eol
   + native

Added: branches/tile/source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp	                        (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp	2012-01-06 19:13:20 UTC (rev 43205)
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor:
+ *		Dalai Felinto
+ */
+
+#include "COM_LuminanceMatteNode.h"
+#include "BKE_node.h"
+#include "COM_LuminanceMatteOperation.h"
+#include "COM_ConvertRGBToYUVOperation.h"
+#include "COM_SetAlphaOperation.h"
+
+LuminanceMatteNode::LuminanceMatteNode(bNode *editorNode): Node(editorNode)
+{}
+
+void LuminanceMatteNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) {
+	InputSocket *inputSocket = this->getInputSocket(0);
+	OutputSocket *outputSocketImage = this->getOutputSocket(0);
+	OutputSocket *outputSocketMatte = this->getOutputSocket(1);
+
+	ConvertRGBToYUVOperation *rgbToYUV = new ConvertRGBToYUVOperation();
+	LuminanceMatteOperation *operationSet = new LuminanceMatteOperation();
+	bNode* editorsnode = getbNode();
+	operationSet->setSettings((NodeChroma*)editorsnode->storage);
+
+	inputSocket->relinkConnections(rgbToYUV->getInputSocket(0), true, 0, graph);
+	addLink(graph, rgbToYUV->getOutputSocket(), operationSet->getInputSocket(0));
+
+	if (outputSocketMatte->isConnected()) {
+		outputSocketMatte->relinkConnections(operationSet->getOutputSocket(0));
+	}
+
+	graph->addOperation(rgbToYUV);
+	graph->addOperation(operationSet);
+
+	SetAlphaOperation *operation = new SetAlphaOperation();
+	addLink(graph, rgbToYUV->getInputSocket(0)->getConnection()->getFromSocket(), operation->getInputSocket(0));
+	addLink(graph, operationSet->getOutputSocket(), operation->getInputSocket(1));
+	graph->addOperation(operation);
+	addPreviewOperation(graph, operation->getOutputSocket(), 9);
+
+	if (outputSocketImage->isConnected()) {
+		outputSocketImage->relinkConnections(operation->getOutputSocket());
+	}
+}


Property changes on: branches/tile/source/blender/compositor/nodes/COM_LuminanceMatteNode.cpp
___________________________________________________________________
Added: svn:eol
   + native

Added: branches/tile/source/blender/compositor/nodes/COM_LuminanceMatteNode.h
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_LuminanceMatteNode.h	                        (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_LuminanceMatteNode.h	2012-01-06 19:13:20 UTC (rev 43205)
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor:

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list