Commit 395c6dbf authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

fixed implementations.

2005-07-15  Sven Neumann  <sven@gimp.org>

	* app/paint-funcs/paint-funcs.c (erode_region) (dilate_region):
	fixed implementations.
parent 873dec37
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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment