round pixel values instead if just casting the float to an integer. Fixes
2007-04-25 Sven Neumann <sven@gimp.org> * app/paint-funcs/paint-funcs.c (convolve_region): round pixel values instead if just casting the float to an integer. Fixes bug #432978. svn path=/trunk/; revision=22322
This commit is contained in:

committed by
Sven Neumann

parent
8bfd436f31
commit
681764e4e8
@ -1,3 +1,8 @@
|
|||||||
|
2007-04-25 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/paint-funcs/paint-funcs.c (convolve_region): round pixel values
|
||||||
|
instead if just casting the float to an integer. Fixes bug #432978.
|
||||||
|
|
||||||
2007-04-25 Sven Neumann <sven@gimp.org>
|
2007-04-25 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/paint-funcs/paint-funcs.c: whitespace cleanup.
|
* app/paint-funcs/paint-funcs.c: whitespace cleanup.
|
||||||
|
@ -2389,7 +2389,7 @@ convolve_region (PixelRegion *srcR,
|
|||||||
guchar *src, *s_row, *s;
|
guchar *src, *s_row, *s;
|
||||||
guchar *dest, *d;
|
guchar *dest, *d;
|
||||||
const gfloat *m;
|
const gfloat *m;
|
||||||
gdouble total [4];
|
gdouble total[4];
|
||||||
gint b, bytes;
|
gint b, bytes;
|
||||||
gint alpha, a_byte;
|
gint alpha, a_byte;
|
||||||
gint length;
|
gint length;
|
||||||
@ -2523,7 +2523,7 @@ convolve_region (PixelRegion *srcR,
|
|||||||
if (total [b] < 0)
|
if (total [b] < 0)
|
||||||
*d++ = 0;
|
*d++ = 0;
|
||||||
else
|
else
|
||||||
*d++ = (total [b] > 255.0) ? 255 : (guchar) total [b];
|
*d++ = (total [b] > 255.0) ? 255 : (guchar) ROUND (total [b]);
|
||||||
}
|
}
|
||||||
|
|
||||||
s_row += bytes;
|
s_row += bytes;
|
||||||
@ -2564,7 +2564,7 @@ convolve_region (PixelRegion *srcR,
|
|||||||
if (total [b] < 0.0)
|
if (total [b] < 0.0)
|
||||||
*d++ = 0.0;
|
*d++ = 0.0;
|
||||||
else
|
else
|
||||||
*d++ = (total [b] > 255.0) ? 255 : (guchar) total [b];
|
*d++ = (total [b] > 255.0) ? 255 : (guchar) ROUND (total [b]);
|
||||||
}
|
}
|
||||||
|
|
||||||
s_row += bytes;
|
s_row += bytes;
|
||||||
|
Reference in New Issue
Block a user