From 00e51c9708642efff7c23f235921a324e1df9a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20V=C3=B6llinger?= Date: Tue, 31 Dec 2013 15:22:29 +0100 Subject: Rewrite of black border detection. --- Pixel.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Pixel.h') diff --git a/Pixel.h b/Pixel.h index 9d9adf6..55a684f 100644 --- a/Pixel.h +++ b/Pixel.h @@ -26,9 +26,19 @@ struct Pixel { - unsigned char b; - unsigned char g; - unsigned char r; - unsigned char a; + unsigned char b; + unsigned char g; + unsigned char r; + unsigned char a; + + int isBlack(int threshold = 3) { + + if (r > threshold || g > threshold || b > threshold) { + return false; + } + return true; + } + }; + #endif \ No newline at end of file -- cgit v1.2.3