Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-03-19 11:46:32 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-03-19 11:46:32 +0400
commitdc3ce6db6a7e6a5dc53ece60bc0486b28c7de749 (patch)
tree12315bd516437e69b8ddd3189a9940d6d81f7daf /source/blender/compositor/operations/COM_MovieClipOperation.cpp
parent460d21af6f31881a3c1f74da75a2196fe7deadfe (diff)
Added alpha output to movie clip compositor node
Pretty much straightforward change, made in the same way as texture input node. Shall not be any regressions or crashes when mixing usage of 2.66 and current trunk.
Diffstat (limited to 'source/blender/compositor/operations/COM_MovieClipOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_MovieClipOperation.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/source/blender/compositor/operations/COM_MovieClipOperation.cpp b/source/blender/compositor/operations/COM_MovieClipOperation.cpp
index 74761f00e1f..a74f2c7299b 100644
--- a/source/blender/compositor/operations/COM_MovieClipOperation.cpp
+++ b/source/blender/compositor/operations/COM_MovieClipOperation.cpp
@@ -30,9 +30,8 @@ extern "C" {
}
#include "BKE_image.h"
-MovieClipOperation::MovieClipOperation() : NodeOperation()
+MovieClipBaseOperation::MovieClipBaseOperation() : NodeOperation()
{
- this->addOutputSocket(COM_DT_COLOR);
this->m_movieClip = NULL;
this->m_movieClipBuffer = NULL;
this->m_movieClipUser = NULL;
@@ -42,7 +41,7 @@ MovieClipOperation::MovieClipOperation() : NodeOperation()
}
-void MovieClipOperation::initExecution()
+void MovieClipBaseOperation::initExecution()
{
if (this->m_movieClip) {
BKE_movieclip_user_set_frame(this->m_movieClipUser, this->m_framenumber);
@@ -63,7 +62,7 @@ void MovieClipOperation::initExecution()
}
}
-void MovieClipOperation::deinitExecution()
+void MovieClipBaseOperation::deinitExecution()
{
if (this->m_movieClipBuffer) {
IMB_freeImBuf(this->m_movieClipBuffer);
@@ -72,7 +71,7 @@ void MovieClipOperation::deinitExecution()
}
}
-void MovieClipOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
+void MovieClipBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
{
resolution[0] = 0;
resolution[1] = 0;
@@ -87,7 +86,7 @@ void MovieClipOperation::determineResolution(unsigned int resolution[2], unsigne
}
}
-void MovieClipOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
+void MovieClipBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
{
if (this->m_movieClipBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
zero_v4(output);
@@ -106,3 +105,22 @@ void MovieClipOperation::executePixel(float output[4], float x, float y, PixelSa
}
}
}
+
+MovieClipOperation::MovieClipOperation() : MovieClipBaseOperation()
+{
+ this->addOutputSocket(COM_DT_COLOR);
+}
+
+MovieClipAlphaOperation::MovieClipAlphaOperation() : MovieClipBaseOperation()
+{
+ this->addOutputSocket(COM_DT_VALUE);
+}
+
+void MovieClipAlphaOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
+{
+ MovieClipBaseOperation::executePixel(output, x, y, sampler);
+ output[0] = output[3];
+ output[1] = 0.0f;
+ output[2] = 0.0f;
+ output[3] = 0.0f;
+}