plug-ins/common/borderaverage.c plug-ins/common/convmatrix.c

2002-05-03  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/borderaverage.c
	* plug-ins/common/convmatrix.c
	* plug-ins/common/nlfilt.c
	* plug-ins/common/papertile.c
	* plug-ins/common/vpropagate.c: applied a patch from iccii@hotmail.com
        that adds missing calls to gimp_tile_cache_ntiles() to speed up the
        plug-ins considerably (bug #78358).

	* plug-ins/common/colorify.c: fix for drawables with alpha from
	iccii@hotmail.com.
This commit is contained in:
Sven Neumann 2002-05-03 16:12:40 +00:00 committed by Sven Neumann
parent 701bf09431
commit 3258c5f189
7 changed files with 33 additions and 4 deletions

View File

@ -1,3 +1,16 @@
2002-05-03 Sven Neumann <sven@gimp.org>
* plug-ins/common/borderaverage.c
* plug-ins/common/convmatrix.c
* plug-ins/common/nlfilt.c
* plug-ins/common/papertile.c
* plug-ins/common/vpropagate.c: applied a patch from iccii@hotmail.com
that adds missing calls to gimp_tile_cache_ntiles() to speed up the
plug-ins considerably (bug #78358).
* plug-ins/common/colorify.c: fix for drawables with alpha from
iccii@hotmail.com.
2002-05-03 Sven Neumann <sven@gimp.org>
* plug-ins/tools/tool-safe-mode.c: removed another warning.

View File

@ -243,6 +243,8 @@ borderaverage (GimpDrawable *drawable,
height = drawable->height;
bytes = drawable->bpp;
gimp_tile_cache_ntiles (2 * ((x2 - x1) / gimp_tile_width () + 1));
/* allocate row buffer */
buffer = g_new (guchar, (x2 - x1) * bytes);

View File

@ -199,6 +199,8 @@ run (gchar *name,
}
}
gimp_drawable_detach (drawable);
values[0].data.d_status = status;
}
@ -212,6 +214,7 @@ colorify (GimpDrawable *drawable)
gint max_progress;
gint sel_x1, sel_x2, sel_y1, sel_y2;
gint sel_width, sel_height;
gint has_alpha;
gint x, y;
gint i;
@ -231,13 +234,13 @@ colorify (GimpDrawable *drawable)
sel_width = sel_x2 - sel_x1;
sel_height = sel_y2 - sel_y1;
has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
max_progress = sel_width * sel_height;
if (max_progress <= 0)
return;
gimp_tile_cache_ntiles (2 * (sel_width / gimp_tile_width()) + 1);
gimp_pixel_rgn_init (&src_rgn, drawable,
sel_x1, sel_y1, sel_width, sel_height, FALSE, FALSE);
gimp_pixel_rgn_init (&dest_rgn, drawable,
@ -265,13 +268,15 @@ colorify (GimpDrawable *drawable)
d[1] = final_green_lookup[lum];
d[2] = final_blue_lookup[lum];
if (has_alpha)
d[3] = s[3];
s += src_rgn.bpp;
d += dest_rgn.bpp;
}
src += src_rgn.rowstride;
dest += dest_rgn.rowstride;
}
/* Update progress */

View File

@ -581,7 +581,8 @@ doit (void)
srcrow[4] = temprow;
my_get_row (&srcPR, srcrow[4], sx1 - 2, row + 3, w + 4);
gimp_progress_update ((double) (row - sy1) / h);
if (row % 10 == 0)
gimp_progress_update ((double) (row - sy1) / h);
}
/* put the final rows in the buffer in place */

View File

@ -265,6 +265,8 @@ pluginCore (struct piArgs *argp)
exrowsize = (width + 2) * Bpp;
p_update = width / 20 + 1;
gimp_tile_cache_ntiles (2 * (width / gimp_tile_width () + 1));
gimp_pixel_rgn_init (&srcPr, drw, 0, 0, width, height, FALSE, FALSE);
gimp_pixel_rgn_init (&dstPr, drw, 0, 0, width, height, TRUE, TRUE);

View File

@ -875,6 +875,8 @@ plugin_run (gchar *name,
p.selection.width = p.selection.x1 - p.selection.x0;
p.selection.height = p.selection.y1 - p.selection.y0;
gimp_tile_cache_ntiles (2 * (p.selection.width / gimp_tile_width () + 1));
if (gimp_drawable_is_rgb (p.drawable->drawable_id))
{
switch (p.run_mode)
@ -936,6 +938,8 @@ plugin_run (gchar *name,
}
}
gimp_drawable_detach (p.drawable);
{
static GimpParam return_value[1];
return_value[0].type = GIMP_PDB_STATUS;

View File

@ -411,6 +411,8 @@ value_propagate_body (gint drawable_id)
height = drawable->height;
bytes = drawable->bpp;
gimp_tile_cache_ntiles (2 * ((endx - begx) / gimp_tile_width() + 1));
prev_row = g_new (guchar, (endx - begx + 2) * bytes);
cur_row = g_new (guchar, (endx - begx + 2) * bytes);
next_row = g_new (guchar, (endx - begx + 2) * bytes);