[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43269] branches/tile/source/blender/ compositor: Separate Combine YCbCr nodes + fix for YUV

Dalai Felinto dfelinto at gmail.com
Tue Jan 10 23:16:04 CET 2012


Revision: 43269
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43269
Author:   dfelinto
Date:     2012-01-10 22:15:50 +0000 (Tue, 10 Jan 2012)
Log Message:
-----------
Separate Combine YCbCr nodes + fix for YUV
------------------------------------------
YUV was missing in COM_Converter.cpp

Sep/Comb YCC could even inherit each other (given the setMode function is th same). But I think it's fine to duplicate that. Thoughts?

Also, I'm not using m_privateprops C++ like naming. As we are not doing this in the other nodes.

reviewed/approved 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_CombineYCCANode.cpp
    branches/tile/source/blender/compositor/nodes/COM_CombineYCCANode.h
    branches/tile/source/blender/compositor/nodes/COM_SeparateYCCANode.cpp
    branches/tile/source/blender/compositor/nodes/COM_SeparateYCCANode.h
    branches/tile/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.cpp
    branches/tile/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h
    branches/tile/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.cpp
    branches/tile/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h

Modified: branches/tile/source/blender/compositor/CMakeLists.txt
===================================================================
--- branches/tile/source/blender/compositor/CMakeLists.txt	2012-01-10 21:38:51 UTC (rev 43268)
+++ branches/tile/source/blender/compositor/CMakeLists.txt	2012-01-10 22:15:50 UTC (rev 43269)
@@ -228,6 +228,10 @@
 		nodes/COM_SeparateYUVANode.h
 		nodes/COM_CombineYUVANode.cpp
 		nodes/COM_CombineYUVANode.h
+		nodes/COM_SeparateYCCANode.cpp
+		nodes/COM_SeparateYCCANode.h
+		nodes/COM_CombineYCCANode.cpp
+		nodes/COM_CombineYCCANode.h
 
 		nodes/COM_NormalNode.cpp
 		nodes/COM_NormalNode.h
@@ -351,6 +355,10 @@
 		operations/COM_ZCombineOperation.cpp
 		operations/COM_ZCombineOperation.h
 
+	operations/COM_ConvertRGBToYCCOperation.h
+	operations/COM_ConvertRGBToYCCOperation.cpp
+	operations/COM_ConvertYCCToRGBOperation.h
+	operations/COM_ConvertYCCToRGBOperation.cpp
 	operations/COM_ConvertRGBToYUVOperation.h
 	operations/COM_ConvertRGBToYUVOperation.cpp
 	operations/COM_ConvertYUVToRGBOperation.h

Modified: branches/tile/source/blender/compositor/intern/COM_Converter.cpp
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_Converter.cpp	2012-01-10 21:38:51 UTC (rev 43268)
+++ branches/tile/source/blender/compositor/intern/COM_Converter.cpp	2012-01-10 22:15:50 UTC (rev 43269)
@@ -47,6 +47,10 @@
 #include "COM_CombineRGBANode.h"
 #include "COM_SeparateHSVANode.h"
 #include "COM_CombineHSVANode.h"
+#include "COM_SeparateYUVANode.h"
+#include "COM_CombineYUVANode.h"
+#include "COM_SeparateYCCANode.h"
+#include "COM_CombineYCCANode.h"
 #include "COM_AlphaOverNode.h"
 #include "COM_ColorBalanceNode.h"
 #include "COM_ViewerNode.h"
@@ -150,6 +154,18 @@
 	case CMP_NODE_COMBHSVA:
 		node = new CombineHSVANode(bNode);
 		break;
+	case CMP_NODE_SEPYUVA:
+		node = new SeparateYUVANode(bNode);
+		break;
+	case CMP_NODE_COMBYUVA:
+		node = new CombineYUVANode(bNode);
+		break;
+	case CMP_NODE_SEPYCCA:
+		node = new SeparateYCCANode(bNode);
+		break;
+	case CMP_NODE_COMBYCCA:
+		node = new CombineYCCANode(bNode);
+		break;
 	case CMP_NODE_ALPHAOVER:
 		node = new AlphaOverNode(bNode);
 		break;

Added: branches/tile/source/blender/compositor/nodes/COM_CombineYCCANode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_CombineYCCANode.cpp	                        (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_CombineYCCANode.cpp	2012-01-10 22:15:50 UTC (rev 43269)
@@ -0,0 +1,42 @@
+/*
+ * 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_CombineYCCANode.h"
+#include "COM_ConvertYCCToRGBOperation.h"
+
+CombineYCCANode::CombineYCCANode(bNode *editorNode): CombineRGBANode(editorNode) {
+}
+
+void CombineYCCANode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) {
+	ConvertYCCToRGBOperation *operation = new ConvertYCCToRGBOperation();
+	OutputSocket *outputSocket = this->getOutputSocket(0);
+
+	bNode *node = this->getbNode();
+	operation->setMode(node->custom1);
+
+	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_CombineYCCANode.cpp
___________________________________________________________________
Added: svn:eol
   + native

Added: branches/tile/source/blender/compositor/nodes/COM_CombineYCCANode.h
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_CombineYCCANode.h	                        (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_CombineYCCANode.h	2012-01-10 22:15:50 UTC (rev 43269)
@@ -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_CombineYCCANode_h
+#define _COM_CombineYCCANode_h
+
+#include "COM_Node.h"
+#include "DNA_node_types.h"
+#include "COM_CombineRGBANode.h"
+/**
+  * @brief CombineYCCANode
+  * @ingroup Node
+  */
+class CombineYCCANode : public CombineRGBANode {
+public:
+	CombineYCCANode(bNode *editorNode);
+	void convertToOperations(ExecutionSystem *graph, CompositorContext *context);
+};
+#endif


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

Added: branches/tile/source/blender/compositor/nodes/COM_SeparateYCCANode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_SeparateYCCANode.cpp	                        (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_SeparateYCCANode.cpp	2012-01-10 22:15:50 UTC (rev 43269)
@@ -0,0 +1,44 @@
+/*
+ * 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_SeparateYCCANode.h"
+#include "COM_SeparateChannelOperation.h"
+#include "COM_ExecutionSystem.h"
+#include "COM_SetValueOperation.h"
+#include "COM_ConvertRGBToYCCOperation.h"
+
+SeparateYCCANode::SeparateYCCANode(bNode *editorNode): SeparateRGBANode(editorNode) {
+}
+
+void SeparateYCCANode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) {
+	ConvertRGBToYCCOperation *operation = new ConvertRGBToYCCOperation();
+	InputSocket *inputSocket = this->getInputSocket(0);
+
+	bNode *node = this->getbNode();
+	operation->setMode(node->custom1);
+
+	if (inputSocket->isConnected()) {
+		inputSocket->relinkConnections(operation->getInputSocket(0));
+		addLink(graph, operation->getOutputSocket(), inputSocket);
+	}
+	graph->addOperation(operation);
+	SeparateRGBANode::convertToOperations(graph, context);
+}


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

Added: branches/tile/source/blender/compositor/nodes/COM_SeparateYCCANode.h
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_SeparateYCCANode.h	                        (rev 0)
+++ branches/tile/source/blender/compositor/nodes/COM_SeparateYCCANode.h	2012-01-10 22:15:50 UTC (rev 43269)
@@ -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:
+ *		Dalai Felinto
+ */
+
+#ifndef _COM_SeparateYCCANode_h
+#define _COM_SeparateYCCANode_h
+
+#include "COM_Node.h"
+#include "DNA_node_types.h"
+#include "COM_SeparateRGBANode.h"
+
+/**
+  * @brief SeparateYCCANode
+  * @ingroup Node
+  */
+class SeparateYCCANode : public SeparateRGBANode {
+public:
+	SeparateYCCANode(bNode *editorNode);
+	void convertToOperations(ExecutionSystem *graph, CompositorContext *context);
+};
+#endif


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

Added: branches/tile/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.cpp
===================================================================
--- branches/tile/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.cpp	                        (rev 0)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list