[cairo-commit] test/buffer-diff.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Aug 22 19:01:04 PDT 2006


 test/buffer-diff.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

New commits:
diff-tree 96c8f92883322a785fa9fa55de93b8eb56afab64 (from 988b5dcb7e50d9e08ff94cb98f6d9c91915bb9b4)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 22 22:00:58 2006 -0400

    [test] bufferdiff: take abs of the pixel diffs.  Oops!

diff --git a/test/buffer-diff.c b/test/buffer-diff.c
index 5463c29..45942c4 100644
--- a/test/buffer-diff.c
+++ b/test/buffer-diff.c
@@ -28,6 +28,7 @@
 #endif
 
 #include <stdio.h>
+#include <stdlib.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -93,7 +94,7 @@ buffer_diff_core (unsigned char *_buf_a,
 		    unsigned char value_a = (row_a[x] >> (channel*8));
 		    unsigned char value_b = (row_b[x] >> (channel*8));
 		    unsigned int diff;
-		    diff = value_a - value_b;
+		    diff = abs (value_a - value_b);
 		    diff *= 4; /* emphasize */
 		    if (diff > 255)
 		      diff = 255;


More information about the cairo-commit mailing list