Update Frame.cpp

This commit is contained in:
Jonathan Thomas
2019-06-08 12:52:35 -05:00
committed by GitHub
parent 3f926f45df
commit 722d672f58

View File

@@ -491,9 +491,9 @@ bool Frame::CheckPixel(int row, int col, int red, int green, int blue, int alpha
// Check pixel color
const unsigned char* pixels = GetPixels(row);
if (pixels[col_pos + 0] >= (red - threshold) && pixels[col_pos + 0] <= (red + threshold) &&
pixels[col_pos + 0] >= (green - threshold) && pixels[col_pos + 0] <= (green + threshold) &&
pixels[col_pos + 0] >= (blue - threshold) && pixels[col_pos + 0] <= (blue + threshold) &&
pixels[col_pos + 0] >= (alpha - threshold) && pixels[col_pos + 0] <= (alpha + threshold)) {
pixels[col_pos + 1] >= (green - threshold) && pixels[col_pos + 1] <= (green + threshold) &&
pixels[col_pos + 2] >= (blue - threshold) && pixels[col_pos + 2] <= (blue + threshold) &&
pixels[col_pos + 3] >= (alpha - threshold) && pixels[col_pos + 3] <= (alpha + threshold)) {
// Pixel color matches successfully
return true;
} else {