[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53374] trunk/blender/source/blender: Convert alpha node: rename "key alpha" to "straight alpha" for consistency .
Brecht Van Lommel
brechtvanlommel at pandora.be
Fri Dec 28 15:46:36 CET 2012
Revision: 53374
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53374
Author: blendix
Date: 2012-12-28 14:46:32 +0000 (Fri, 28 Dec 2012)
Log Message:
-----------
Convert alpha node: rename "key alpha" to "straight alpha" for consistency.
Modified Paths:
--------------
trunk/blender/source/blender/compositor/CMakeLists.txt
trunk/blender/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp
trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
Added Paths:
-----------
trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToStraightOperation.cpp
trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToStraightOperation.h
trunk/blender/source/blender/compositor/operations/COM_ConvertStraightToPremulOperation.cpp
trunk/blender/source/blender/compositor/operations/COM_ConvertStraightToPremulOperation.h
Removed Paths:
-------------
trunk/blender/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.cpp
trunk/blender/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h
trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp
trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h
Modified: trunk/blender/source/blender/compositor/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/compositor/CMakeLists.txt 2012-12-28 14:21:30 UTC (rev 53373)
+++ trunk/blender/source/blender/compositor/CMakeLists.txt 2012-12-28 14:46:32 UTC (rev 53374)
@@ -491,10 +491,10 @@
operations/COM_ColorMatteOperation.h
operations/COM_ChannelMatteOperation.cpp
operations/COM_ChannelMatteOperation.h
- operations/COM_ConvertPremulToKeyOperation.cpp
- operations/COM_ConvertPremulToKeyOperation.h
- operations/COM_ConvertKeyToPremulOperation.cpp
- operations/COM_ConvertKeyToPremulOperation.h
+ operations/COM_ConvertPremulToStraightOperation.cpp
+ operations/COM_ConvertPremulToStraightOperation.h
+ operations/COM_ConvertStraightToPremulOperation.cpp
+ operations/COM_ConvertStraightToPremulOperation.h
operations/COM_ReadBufferOperation.cpp
operations/COM_ReadBufferOperation.h
Modified: trunk/blender/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp 2012-12-28 14:21:30 UTC (rev 53373)
+++ trunk/blender/source/blender/compositor/nodes/COM_ConvertAlphaNode.cpp 2012-12-28 14:46:32 UTC (rev 53374)
@@ -20,8 +20,8 @@
*/
#include "COM_ConvertAlphaNode.h"
-#include "COM_ConvertPremulToKeyOperation.h"
-#include "COM_ConvertKeyToPremulOperation.h"
+#include "COM_ConvertPremulToStraightOperation.h"
+#include "COM_ConvertStraightToPremulOperation.h"
#include "COM_ExecutionSystem.h"
void ConvertAlphaNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
@@ -31,10 +31,10 @@
/* value hardcoded in rna_nodetree.c */
if (node->custom1 == 1) {
- operation = new ConvertPremulToKeyOperation();
+ operation = new ConvertPremulToStraightOperation();
}
else {
- operation = new ConvertKeyToPremulOperation();
+ operation = new ConvertStraightToPremulOperation();
}
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
Deleted: trunk/blender/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.cpp 2012-12-28 14:21:30 UTC (rev 53373)
+++ trunk/blender/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.cpp 2012-12-28 14:46:32 UTC (rev 53374)
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012, 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_ConvertKeyToPremulOperation.h"
-#include "BLI_math.h"
-
-ConvertKeyToPremulOperation::ConvertKeyToPremulOperation() : NodeOperation()
-{
- this->addInputSocket(COM_DT_COLOR);
- this->addOutputSocket(COM_DT_COLOR);
-
- this->m_inputColor = NULL;
-}
-
-void ConvertKeyToPremulOperation::initExecution()
-{
- this->m_inputColor = getInputSocketReader(0);
-}
-
-void ConvertKeyToPremulOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
-{
- float inputValue[4];
- float alpha;
-
- this->m_inputColor->read(inputValue, x, y, sampler);
- alpha = inputValue[3];
-
- mul_v3_v3fl(output, inputValue, alpha);
-
- /* never touches the alpha */
- output[3] = alpha;
-}
-
-void ConvertKeyToPremulOperation::deinitExecution()
-{
- this->m_inputColor = NULL;
-}
Deleted: trunk/blender/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h 2012-12-28 14:21:30 UTC (rev 53373)
+++ trunk/blender/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h 2012-12-28 14:46:32 UTC (rev 53374)
@@ -1,49 +0,0 @@
-/*
- * Copyright 2012, 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_ConvertKeyToPremulOperation_h
-#define _COM_ConvertKeyToPremulOperation_h
-#include "COM_NodeOperation.h"
-
-
-/**
- * this program converts an input color to an output value.
- * it assumes we are in sRGB color space.
- */
-class ConvertKeyToPremulOperation : public NodeOperation {
-private:
- SocketReader *m_inputColor;
-public:
- /**
- * Default constructor
- */
- ConvertKeyToPremulOperation();
-
- /**
- * the inner loop of this program
- */
- void executePixel(float output[4], float x, float y, PixelSampler sampler);
-
- void initExecution();
- void deinitExecution();
-
-};
-#endif
Deleted: trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp 2012-12-28 14:21:30 UTC (rev 53373)
+++ trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp 2012-12-28 14:46:32 UTC (rev 53374)
@@ -1,60 +0,0 @@
-/*
- * Copyright 2012, 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_ConvertPremulToKeyOperation.h"
-#include "BLI_math.h"
-
-ConvertPremulToKeyOperation::ConvertPremulToKeyOperation() : NodeOperation()
-{
- this->addInputSocket(COM_DT_COLOR);
- this->addOutputSocket(COM_DT_COLOR);
-
- this->m_inputColor = NULL;
-}
-
-void ConvertPremulToKeyOperation::initExecution()
-{
- this->m_inputColor = getInputSocketReader(0);
-}
-
-void ConvertPremulToKeyOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
-{
- float inputValue[4];
- float alpha;
-
- this->m_inputColor->read(inputValue, x, y, sampler);
- alpha = inputValue[3];
-
- if (fabsf(alpha) < 1e-5f) {
- zero_v3(output);
- }
- else {
- mul_v3_v3fl(output, inputValue, 1.0f / alpha);
- }
-
- /* never touches the alpha */
- output[3] = alpha;
-}
-
-void ConvertPremulToKeyOperation::deinitExecution()
-{
- this->m_inputColor = NULL;
-}
Deleted: trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h 2012-12-28 14:21:30 UTC (rev 53373)
+++ trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h 2012-12-28 14:46:32 UTC (rev 53374)
@@ -1,48 +0,0 @@
-/*
- * Copyright 2012, 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_ConvertPremulToKeyOperation_h
-#define _COM_ConvertPremulToKeyOperation_h
-#include "COM_NodeOperation.h"
-
-
-/**
- * this program converts an input color to an output value.
- * it assumes we are in sRGB color space.
- */
-class ConvertPremulToKeyOperation : public NodeOperation {
-private:
- SocketReader *m_inputColor;
-public:
- /**
- * Default constructor
- */
- ConvertPremulToKeyOperation();
-
- /**
- * the inner loop of this program
- */
- void executePixel(float output[4], float x, float y, PixelSampler sampler);
-
- void initExecution();
- void deinitExecution();
-};
-#endif
Copied: trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToStraightOperation.cpp (from rev 53373, trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.cpp)
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_ConvertPremulToStraightOperation.cpp (rev 0)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list