diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2006-08-01 15:20:39 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2006-08-01 15:20:39 -0400 |
commit | 5a23fd70a0af5c2b0cb990b89ebc5ed7a01aae82 (patch) | |
tree | 643584622741efad27ae4041f6d28030efd93185 /test/buffer-diff.c | |
parent | d85f30e789c74cc8f1d83ba609d8b02886686440 (diff) |
Change the way diff images highlight differences.
Previously it was using the equation 128+diff/3, which results in
lots of gray and de-emphasized difference. Now it's using
MIN(255,diff*4) which more emphasizes the real difference.
Diffstat (limited to 'test/buffer-diff.c')
-rw-r--r-- | test/buffer-diff.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/buffer-diff.c b/test/buffer-diff.c index ed50cb6a..0244ecd0 100644 --- a/test/buffer-diff.c +++ b/test/buffer-diff.c @@ -92,9 +92,12 @@ buffer_diff_core (unsigned char *_buf_a, for (channel = 0; channel < 4; channel++) { unsigned char value_a = (row_a[x] >> (channel*8)); unsigned char value_b = (row_b[x] >> (channel*8)); - double diff; + unsigned char diff; diff = value_a - value_b; - diff_pixel |= (unsigned char)(128 + diff / 3.0) << (channel*8); + diff *= 4; /* emphasize */ + if (diff > 255) + diff = 255; + diff_pixel |= diff << (channel*8); } pixels_changed++; |