Commit bc159e1c authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/tools/gimpiscissorstool.c (gradmap_tile_validate) (find_max_gradient)

2007-06-25  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpiscissorstool.c (gradmap_tile_validate)
	(find_max_gradient) minor code cleanup.


svn path=/trunk/; revision=22829
parent 8755f459
2007-06-25 Sven Neumann <sven@gimp.org>
 
* app/tools/gimpiscissorstool.c (gradmap_tile_validate): minor
code cleanup.
* app/tools/gimpiscissorstool.c (gradmap_tile_validate)
(find_max_gradient) minor code cleanup.
 
2007-06-22 Sven Neumann <sven@gimp.org>
 
......@@ -1874,13 +1874,12 @@ find_max_gradient (GimpIscissorsTool *iscissors,
gint endx, endy;
gint sx, sy, cx, cy;
gint x1, y1, x2, y2;
void *pr;
guint8 *gradient;
gfloat g, max_gradient;
gpointer pr;
gfloat max_gradient;
/* Initialise the gradient map tile manager for this image if we
* don't already have one. */
if (!iscissors->gradient_map)
if (! iscissors->gradient_map)
iscissors->gradient_map = gradient_map_new (image);
radius = GRADIENT_SEARCH >> 1;
......@@ -1911,17 +1910,23 @@ find_max_gradient (GimpIscissorsTool *iscissors,
{
endx = srcPR.x + srcPR.w;
endy = srcPR.y + srcPR.h;
for (i = srcPR.y; i < endy; i++)
{
gradient = srcPR.data + srcPR.rowstride * (i - srcPR.y);
const guint8 *gradient = srcPR.data + srcPR.rowstride * (i - srcPR.y);
for (j = srcPR.x; j < endx; j++)
{
g = *gradient;
gfloat g = *gradient;
gradient += COST_WIDTH;
g *= distance_weights [(i-y1) * GRADIENT_SEARCH + (j-x1)];
if (g > max_gradient)
{
max_gradient = g;
*x = j;
*y = i;
}
......
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