diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-10 18:53:36 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-10 18:53:36 +0400 |
commit | ba8154e24a8565be692275ba23ed28f0891b7136 (patch) | |
tree | 95ae9e61d5a4a7713f46f952fab61dc3435efe72 /source/blender/compositor/nodes/COM_KeyingNode.cpp | |
parent | 76ee9783a13ed9e1eb0d4415239ffebdab0a10b7 (diff) |
Keying screen: small fixes and improvements from tomato
- Fixed issues with calculating matte with balance != 0.5
It used to be used concave combination of minimal and maximal
channel values which could be inpredictable.
Use concave combination of two non-major channels sorted
by their index, so such combination would always use the same
coefficients for particular non-major channels.
- Added despill balance slider which defines balance between
non-major channels used for calculating average of two
colors. Difference between average value and pixel value of
major screen channel defines amount of despill. Balance of
0.5 gives the same behavior as it was before this slider
was added.
---
svn merge -r48678:48679 -r48789:48790 ^/branches/soc-2011-tomato
Diffstat (limited to 'source/blender/compositor/nodes/COM_KeyingNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_KeyingNode.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/compositor/nodes/COM_KeyingNode.cpp b/source/blender/compositor/nodes/COM_KeyingNode.cpp index 7c39765fbf1..efd50a44a51 100644 --- a/source/blender/compositor/nodes/COM_KeyingNode.cpp +++ b/source/blender/compositor/nodes/COM_KeyingNode.cpp @@ -184,11 +184,13 @@ OutputSocket *KeyingNode::setupFeather(ExecutionSystem *graph, CompositorContext return operationy->getOutputSocket(); } -OutputSocket *KeyingNode::setupDespill(ExecutionSystem *graph, OutputSocket *despillInput, OutputSocket *inputScreen, float factor) +OutputSocket *KeyingNode::setupDespill(ExecutionSystem *graph, OutputSocket *despillInput, OutputSocket *inputScreen, + float factor, float colorBalance) { KeyingDespillOperation *despillOperation = new KeyingDespillOperation(); despillOperation->setDespillFactor(factor); + despillOperation->setColorBalance(colorBalance); addLink(graph, despillInput, despillOperation->getInputSocket(0)); addLink(graph, inputScreen, despillOperation->getInputSocket(1)); @@ -292,7 +294,8 @@ void KeyingNode::convertToOperations(ExecutionSystem *graph, CompositorContext * if (keying_data->despill_factor > 0.0f) { postprocessedImage = setupDespill(graph, postprocessedImage, keyingOperation->getInputSocket(1)->getConnection()->getFromSocket(), - keying_data->despill_factor); + keying_data->despill_factor, + keying_data->despill_balance); } /* connect result to output sockets */ |