[Bf-blender-cvs] [5a7b049] master: Fix T40383: Keying node doesn't work

Sergey Sharybin noreply at git.blender.org
Wed May 28 10:29:34 CEST 2014


Commit: 5a7b049a940bc120c5e9734f3ae2545c8ccc93f0
Author: Sergey Sharybin
Date:   Wed May 28 14:28:21 2014 +0600
https://developer.blender.org/rB5a7b049a940bc120c5e9734f3ae2545c8ccc93f0

Fix T40383: Keying node doesn't work

We should actually re-consider whether zero-sized kernels are allowed
for edge detection.

===================================================================

M	source/blender/compositor/operations/COM_KeyingClipOperation.cpp

===================================================================

diff --git a/source/blender/compositor/operations/COM_KeyingClipOperation.cpp b/source/blender/compositor/operations/COM_KeyingClipOperation.cpp
index da6a94f..d9eb7b5 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) {




More information about the Bf-blender-cvs mailing list