Bill Skaggs <weskaggs@primate.ucdavis.edu>

* plug-ins/common/cartoon.c
	* plug-ins/common/cubism.c
	* plug-ins/common/displace.c
	* plug-ins/common/dog.c
	* plug-ins/common/emboss.c
	* plug-ins/common/engrave.c
	* plug-ins/common/gauss.c
	* plug-ins/common/glasstile.c
	* plug-ins/common/neon.c
	* plug-ins/common/noisify.c
	* plug-ins/common/oilify.c
	* plug-ins/common/photocopy.c
	* plug-ins/common/ripple.c
	* plug-ins/common/sharpen.c
	* plug-ins/common/shift.c
	* plug-ins/common/sobel.c
	* plug-ins/common/softglow.c
	* plug-ins/common/spread.c
	* plug-ins/common/tileit.c
	* plug-ins/common/whirlpinch.c: make sure tile cache is allocated
	before preview is shown -- significant speedup in some cases,
	minimal in others.

	* plug-ins/common/sel_gauss.c: give it a tile cache (didn't
	have one).  Still very slow but a little better.
This commit is contained in:
William Skaggs 2004-12-23 23:58:35 +00:00
parent 6e1ff6f29d
commit b3eba64977
21 changed files with 55 additions and 54 deletions

View File

@ -170,6 +170,9 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
*nreturn_vals = 1;
*return_vals = values;
@ -211,8 +214,6 @@ run (const gchar *name,
{
gimp_progress_init ("Cartoon...");
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
cartoon (drawable, NULL);

View File

@ -187,6 +187,10 @@ run (const gchar *name,
/* get the active drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set cache size */
/* asking for a lot here but seems to give a speedup -- WES 12-23-04 */
gimp_tile_cache_ntiles (2 * drawable->ntile_rows * drawable->ntile_cols);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
@ -227,8 +231,6 @@ run (const gchar *name,
(gimp_drawable_is_rgb (drawable->drawable_id) ||
gimp_drawable_is_gray (drawable->drawable_id)))
{
/* set cache size */
gimp_tile_cache_ntiles (SQR (4 * cvals.tile_size * cvals.tile_saturation) / SQR (gimp_tile_width ()));
cubism (drawable, NULL);

View File

@ -179,6 +179,9 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
*nreturn_vals = 1;
*return_vals = values;
@ -227,9 +230,6 @@ run (const gchar *name,
{
gimp_progress_init (_("Displacing..."));
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
/* run the displace effect */
displace (drawable, NULL);

View File

@ -172,6 +172,11 @@ run (const gchar *name,
image_ID = param[1].data.d_image;
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size so that the gaussian blur works well */
gimp_tile_cache_ntiles (2 *
(MAX (drawable->width, drawable->height) /
gimp_tile_width () + 1));
if (strcmp (name, "plug_in_dog") == 0)
{
switch (run_mode)
@ -221,10 +226,6 @@ run (const gchar *name,
{
gimp_progress_init (_("DoG Edge Detect"));
/* set the tile cache size so that the gaussian blur works well */
gimp_tile_cache_ntiles (2 *
(MAX (drawable->width, drawable->height) /
gimp_tile_width () + 1));
/* run the Difference of Gaussians */
gimp_image_undo_group_start (image_ID);

View File

@ -155,6 +155,8 @@ run (const gchar *name,
INIT_I18N ();
drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_tile_cache_ntiles (drawable->ntile_cols);
rvals[0].type = GIMP_PDB_STATUS;
rvals[0].data.d_status = GIMP_PDB_SUCCESS;
@ -373,8 +375,6 @@ emboss (GimpDrawable *drawable,
if (!preview)
gimp_progress_init (_("Emboss"));
gimp_tile_cache_ntiles ((width + gimp_tile_width () - 1) / gimp_tile_width ());
/* first row */
gimp_pixel_rgn_get_rect (&src, srcbuf, x1, y1, width, 3);
memcpy (srcbuf, srcbuf + rowsize, rowsize);

View File

@ -138,6 +138,7 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
switch (run_mode)
{
@ -179,7 +180,6 @@ run (const gchar *name,
if (status == GIMP_PDB_SUCCESS)
{
gimp_progress_init (_("Engraving..."));
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
engrave (drawable, NULL);

View File

@ -271,6 +271,12 @@ run (const gchar *name,
image_ID = param[1].data.d_image;
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size so that the gaussian blur works well */
gimp_tile_cache_ntiles (2 *
(MAX (drawable->width, drawable->height) /
gimp_tile_width () + 1));
if (strcmp (name, "plug_in_gauss") == 0)
{
switch (run_mode)
@ -406,11 +412,6 @@ run (const gchar *name,
{
gimp_progress_init (_("Gaussian Blur..."));
/* set the tile cache size so that the gaussian blur works well */
gimp_tile_cache_ntiles (2 *
(MAX (drawable->width, drawable->height) /
gimp_tile_width () + 1));
/* run the gaussian blur */
gauss (drawable,
bvals.horizontal, bvals.vertical,

View File

@ -160,6 +160,7 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_tile_cache_ntiles (2 * (drawable->ntile_cols));
switch (run_mode)
{
@ -206,8 +207,6 @@ run (const gchar *name,
gimp_drawable_is_gray (drawable->drawable_id))
{
gimp_progress_init (_("Glass Tile..."));
gimp_tile_cache_ntiles (2 *
(drawable->width / gimp_tile_width () + 1));
glasstile (drawable, NULL);

View File

@ -158,6 +158,9 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size so that the gaussian blur works well */
gimp_tile_cache_ntiles (2 * (MAX (drawable->ntile_rows, drawable->ntile_cols)));
*nreturn_vals = 1;
*return_vals = values;
@ -203,10 +206,6 @@ run (const gchar *name,
{
gimp_progress_init (_("Neon..."));
/* set the tile cache size so that the gaussian blur works well */
gimp_tile_cache_ntiles (2 * (MAX (drawable->width, drawable->height) /
gimp_tile_width () + 1));
/* run the neon effect */
neon (drawable, evals.radius, evals.amount, NULL);

View File

@ -204,6 +204,7 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
if (gimp_drawable_is_gray (drawable->drawable_id))
nvals.noise[1] = 0.0;
@ -282,7 +283,6 @@ run (const gchar *name,
if (status == GIMP_PDB_SUCCESS)
{
gimp_progress_init (_("Adding Noise..."));
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
/* compute the luminosity which exceeds the luminosity threshold */
gimp_rgn_iterate2 (drawable, 0 /* unused */, noisify_func, noise_gr);

View File

@ -135,6 +135,7 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_tile_cache_ntiles (2 * drawable->ntile_cols);
*nreturn_vals = 2;
*return_vals = values;
@ -186,7 +187,6 @@ run (const gchar *name,
gimp_drawable_is_gray (drawable->drawable_id)))
{
gimp_progress_init (_("Oil Painting..."));
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
oilify (drawable, NULL);

View File

@ -181,6 +181,9 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
*nreturn_vals = 1;
*return_vals = values;
@ -224,9 +227,6 @@ run (const gchar *name,
{
gimp_progress_init ("Photocopy...");
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
photocopy (drawable, NULL);
if (run_mode != GIMP_RUN_NONINTERACTIVE)

View File

@ -163,6 +163,9 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
*nreturn_vals = 1;
*return_vals = values;
@ -218,9 +221,6 @@ run (const gchar *name,
{
gimp_progress_init (_("Rippling..."));
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
/* run the ripple effect */
ripple (drawable, NULL);

View File

@ -138,6 +138,7 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_tile_cache_ntiles (2 * drawable->ntile_cols);
switch (run_mode)
{

View File

@ -164,6 +164,8 @@ run (const gchar *name,
*/
drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_tile_cache_ntiles (2 * drawable->ntile_cols);
/*
* See how we will run
@ -215,12 +217,6 @@ run (const gchar *name,
if ((gimp_drawable_is_rgb (drawable->drawable_id) ||
gimp_drawable_is_gray (drawable->drawable_id)))
{
/*
* Set the tile cache size...
*/
gimp_tile_cache_ntiles (2 * (drawable->width + gimp_tile_width() - 1) /
gimp_tile_width() + 1);
/*
* Run!
*/

View File

@ -140,6 +140,9 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
*nreturn_vals = 1;
*return_vals = values;
@ -190,9 +193,6 @@ run (const gchar *name,
{
gimp_progress_init (_("Shifting..."));
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
/* run the shift effect */
shift (drawable, NULL);

View File

@ -150,6 +150,8 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_tile_cache_ntiles (2 * drawable->ntile_cols);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
@ -188,7 +190,6 @@ run (const gchar *name,
if (gimp_drawable_is_rgb (drawable->drawable_id) ||
gimp_drawable_is_gray (drawable->drawable_id))
{
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
sobel (drawable,
bvals.horizontal, bvals.vertical, bvals.keep_sign,
NULL);

View File

@ -161,6 +161,9 @@ run (const gchar *name,
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
*nreturn_vals = 1;
*return_vals = values;
@ -203,9 +206,6 @@ run (const gchar *name,
{
gimp_progress_init ("Softglow...");
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
softglow (drawable, NULL);
if (run_mode != GIMP_RUN_NONINTERACTIVE)

View File

@ -126,6 +126,9 @@ run (const gchar *name,
image_ID = param[1].data.d_image;
drawable = gimp_drawable_get (param[2].data.d_drawable);
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
*nreturn_vals = 1;
*return_vals = values;
@ -178,8 +181,6 @@ run (const gchar *name,
{
gimp_progress_init (_("Spreading..."));
/* set the tile cache size */
gimp_tile_cache_ntiles (TILE_CACHE_SIZE);
/* run the spread effect */
spread (drawable);

View File

@ -256,6 +256,8 @@ run (const gchar *name,
tileitdrawable = drawable = gimp_drawable_get (param[2].data.d_drawable);
gimp_tile_cache_ntiles (drawable->ntile_cols + 1);
has_alpha = gimp_drawable_has_alpha (tileitdrawable->drawable_id);
gimp_drawable_mask_bounds (drawable->drawable_id,
@ -315,9 +317,6 @@ run (const gchar *name,
{
/* Set the tile cache size */
gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width () - 1) /
gimp_tile_width ());
gimp_progress_init (_("Tiling..."));
do_tiles ();

View File

@ -201,6 +201,9 @@ run (const gchar *name,
gimp_drawable_mask_bounds (drawable->drawable_id,
&sel_x1, &sel_y1, &sel_x2, &sel_y2);
/* Set the tile cache size */
gimp_tile_cache_ntiles (2 * drawable->ntile_cols);
/* Calculate scaling parameters */
sel_width = sel_x2 - sel_x1;
@ -273,9 +276,6 @@ run (const gchar *name,
(gimp_drawable_is_rgb (drawable->drawable_id) ||
gimp_drawable_is_gray (drawable->drawable_id)))
{
/* Set the tile cache size */
gimp_tile_cache_ntiles (2 * (drawable->width + gimp_tile_width () - 1) /
gimp_tile_width ());
/* Run! */
whirl_pinch (drawable);