diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-10 16:20:10 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-10 16:20:10 +0400 |
commit | 75cbb07507fa39a1c65296321839cdfd245cc8d6 (patch) | |
tree | afebd7b2614e2e86119a7d240ad0623edf5d69fd /source/blender/compositor/operations/COM_CompositorOperation.cpp | |
parent | d0f4a2396b38c122b7e56de83532515ae8fa4381 (diff) |
Added option to composite/viewer nodes which specifys whether alpha input
is straight or not (premultiplied is default).
This is useful in cases when you want to check on output of such nodes
as keying which does have straight alpha output.
Also added missing do_version code to previous compo do_versions.
Diffstat (limited to 'source/blender/compositor/operations/COM_CompositorOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_CompositorOperation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp index e6a49082a71..7cb3a614022 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.cpp +++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp @@ -49,6 +49,8 @@ CompositorOperation::CompositorOperation() : NodeOperation() this->m_alphaInput = NULL; this->m_depthInput = NULL; + this->m_straightAlpha = false; + this->m_sceneName[0] = '\0'; } @@ -141,6 +143,10 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber) if (this->m_alphaInput != NULL) { this->m_alphaInput->read(&(color[3]), x, y, COM_PS_NEAREST); } + + if (this->m_straightAlpha) + straight_to_premul_v4(color); + copy_v4_v4(buffer + offset4, color); if (this->m_depthInput != NULL) { |