Fix T40383: Keying node doesn't work

We should actually re-consider whether zero-sized kernels are allowed
for edge detection.
This commit is contained in:
Sergey Sharybin 2014-05-28 14:28:21 +06:00
parent 94b2852947
commit 5a7b049a94
Notes: blender-bot 2023-02-14 10:48:33 +01:00
Referenced by issue #40383, Keying node doesn't work
1 changed files with 5 additions and 1 deletions

View File

@ -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) {