diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-05-28 12:28:21 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-05-28 12:29:24 +0400 |
commit | 5a7b049a940bc120c5e9734f3ae2545c8ccc93f0 (patch) | |
tree | 88a217572a1d098bc7bfeb3351bb6f08f4098ce3 /source/blender/compositor/operations/COM_KeyingClipOperation.cpp | |
parent | 94b2852947aba90850890d0b614c1684a94ab1fd (diff) |
Fix T40383: Keying node doesn't work
We should actually re-consider whether zero-sized kernels are allowed
for edge detection.
Diffstat (limited to 'source/blender/compositor/operations/COM_KeyingClipOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_KeyingClipOperation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingClipOperation.cpp b/source/blender/compositor/operations/COM_KeyingClipOperation.cpp index da6a94f8813..d9eb7b588a8 100644 --- a/source/blender/compositor/operations/COM_KeyingClipOperation.cpp +++ b/source/blender/compositor/operations/COM_KeyingClipOperation.cpp @@ -71,7 +71,11 @@ void KeyingClipOperation::executePixel(float output[4], int x, int y, void *data end_y = min_ff(y + delta - 1, bufferHeight - 1); int count = 0, totalCount = (end_x - start_x + 1) * (end_y - start_y + 1) - 1; - int thresholdCount = (float) totalCount * 0.9f + 0.5f; + int thresholdCount = ceil((float) totalCount * 0.9f); + + if (delta == 0) { + ok = true; + } for (int cx = start_x; ok == false && cx <= end_x; ++cx) { for (int cy = start_y; ok == false && cy <= end_y; ++cy) { |