mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 01:48:07 +02:00
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.
This commit is contained in:
parent
d85f30e789
commit
5a23fd70a0
1 changed files with 5 additions and 2 deletions
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue