mirror of https://github.com/GNOME/gimp.git
fixed implementations.
2005-07-15 Sven Neumann <sven@gimp.org> * app/paint-funcs/paint-funcs.c (erode_region) (dilate_region): fixed implementations.
This commit is contained in:
parent
873dec37d7
commit
395c6dbf70
|
@ -1,3 +1,10 @@
|
|||
2005-07-15 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/paint-funcs/paint-funcs.c (erode_region) (dilate_region):
|
||||
fixed implementations.
|
||||
|
||||
* app/base/siox.c (create_signature): moved comment to the right place.
|
||||
|
||||
2005-07-15 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimpviewrendererpalette.c
|
||||
|
|
|
@ -541,9 +541,9 @@ create_signature (lab *input,
|
|||
clusters2 = g_new0 (ArrayList, 1);
|
||||
|
||||
stagetwo (centroids,
|
||||
SIOX_DIMS, 0, clusters2, limits, clusters1size, length, 0.1);
|
||||
SIOX_DIMS, 0, clusters2, limits, clusters1size, length,
|
||||
0.1 /* magic constant, see paper by tomasi */);
|
||||
|
||||
/* see paper by tomasi */
|
||||
rval = list_to_array (clusters2, returnlength);
|
||||
|
||||
free_list (clusters2);
|
||||
|
|
|
@ -3414,15 +3414,11 @@ erode_region (PixelRegion *region)
|
|||
{
|
||||
gint min = 255;
|
||||
|
||||
if (buf[0][x] < min) min = buf[0][x];
|
||||
if (buf[0][x+1] < min) min = buf[0][x+1];
|
||||
if (buf[0][x+2] < min) min = buf[0][x+2];
|
||||
if (buf[1][x] < min) min = buf[1][x];
|
||||
if (buf[1][x+1] < min) min = buf[1][x+1];
|
||||
if (buf[1][x+2] < min) min = buf[1][x+2];
|
||||
if (buf[2][x] < min) min = buf[2][x];
|
||||
if (buf[2][x+1] < min) min = buf[2][x+1];
|
||||
if (buf[2][x+2] < min) min = buf[2][x+2];
|
||||
|
||||
out[x] = min;
|
||||
}
|
||||
|
@ -3482,15 +3478,11 @@ dilate_region (PixelRegion *region)
|
|||
{
|
||||
gint max = 0;
|
||||
|
||||
if (buf[0][x] < max) max = buf[0][x];
|
||||
if (buf[0][x+1] < max) max = buf[0][x+1];
|
||||
if (buf[0][x+2] < max) max = buf[0][x+2];
|
||||
if (buf[1][x] < max) max = buf[1][x];
|
||||
if (buf[1][x+1] < max) max = buf[1][x+1];
|
||||
if (buf[1][x+2] < max) max = buf[1][x+2];
|
||||
if (buf[2][x] < max) max = buf[2][x];
|
||||
if (buf[2][x+1] < max) max = buf[2][x+1];
|
||||
if (buf[2][x+2] < max) max = buf[2][x+2];
|
||||
if (buf[0][x+1] > max) max = buf[0][x+1];
|
||||
if (buf[1][x] > max) max = buf[1][x];
|
||||
if (buf[1][x+1] > max) max = buf[1][x+1];
|
||||
if (buf[1][x+2] > max) max = buf[1][x+2];
|
||||
if (buf[2][x+1] > max) max = buf[2][x+1];
|
||||
|
||||
out[x] = max;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue