From 5a7b049a940bc120c5e9734f3ae2545c8ccc93f0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 28 May 2014 14:28:21 +0600 Subject: Fix T40383: Keying node doesn't work We should actually re-consider whether zero-sized kernels are allowed for edge detection. --- source/blender/compositor/operations/COM_KeyingClipOperation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender/compositor') 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) { -- cgit v1.2.3