Revision: 5197
http://skim-app.svn.sourceforge.net/skim-app/?rev=5197&view=rev
Author: hofman
Date: 2009-02-07 22:16:03 +0000 (Sat, 07 Feb 2009)
Log Message:
-----------
fix comparison of unsigned chars
Modified Paths:
--------------
trunk/NSBitmapImageRep_SKExtensions.m
Modified: trunk/NSBitmapImageRep_SKExtensions.m
===================================================================
--- trunk/NSBitmapImageRep_SKExtensions.m 2009-02-07 22:08:57 UTC (rev
5196)
+++ trunk/NSBitmapImageRep_SKExtensions.m 2009-02-07 22:16:03 UTC (rev
5197)
@@ -42,14 +42,14 @@
// allow for a slight margin around the image; maybe caused by a shadow (found
this in testing)
static const int MARGIN = 2;
-static const unsigned EPSILON = 2;
+static const unsigned char EPSILON = 2;
static const int THRESHOLD = 8;
static inline BOOL differentPixels( const unsigned char *p1, const unsigned
char *p2, unsigned count )
{
unsigned i;
for (i = 0; i < count; i++) {
- if (abs(p2[i] - p1[i]) > EPSILON)
+ if ((p2[i] > p1[i] && p2[i] - p1[i] > EPSILON) || (p1[i] > p2[i] &&
p1[i] - p2[i] > EPSILON))
return YES;
}
return NO;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit