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:
Sven Neumann 2005-07-15 19:07:38 +00:00 committed by Sven Neumann
parent 873dec37d7
commit 395c6dbf70
3 changed files with 14 additions and 15 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;
}