1
/*============================================================================*
3
Paper Tile 1.0 -- A GIMP PLUG-IN
5
Copyright (C) 1997-1999 Hirotsuna Mizuno <s1041150@u-aizu.ac.jp>
7
This program is free software; you can redistribute it and/or modify it
8
under the terms of the GNU Public License as published by the Free Software
9
Foundation; either version 2 of the License, or (at your option) any later
12
This program is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17
You should have received a copy of the GNU General Public License along with
18
this program; if not, write to the Free Software Foundation, Inc.,
19
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
*===========================================================================*/
27
#include <libgimp/gimp.h>
28
#include <libgimp/gimpui.h>
30
#include "libgimp/stdplugins-intl.h"
33
/*===========================================================================*/
35
/*===========================================================================*/
37
#define PLUG_IN_PROC "plug-in-papertile"
38
#define PLUG_IN_BINARY "papertile"
40
/*===========================================================================*/
42
/*===========================================================================*/
46
BACKGROUND_TYPE_TRANSPARENT,
47
BACKGROUND_TYPE_INVERTED,
48
BACKGROUND_TYPE_IMAGE,
49
BACKGROUND_TYPE_FOREGROUND,
50
BACKGROUND_TYPE_BACKGROUND,
56
FRACTIONAL_TYPE_BACKGROUND, /* AS BACKGROUND */
57
FRACTIONAL_TYPE_IGNORE, /* NOT OPERATED */
58
FRACTIONAL_TYPE_FORCE /* FORCE DIVISION */
61
typedef struct _PluginParams PluginParams;
68
gdouble move_max_rate;
69
FractionalType fractional_type;
72
BackgroundType background_type;
73
GimpRGB background_color;
76
/*===========================================================================*/
78
/*===========================================================================*/
85
GimpDrawable *drawable;
86
gboolean drawable_has_alpha;
107
25.0, /* move_max_rate */
108
FRACTIONAL_TYPE_BACKGROUND, /* fractional_type */
109
TRUE, /* centering */
110
FALSE, /* wrap_around */
111
BACKGROUND_TYPE_INVERTED, /* background_type */
112
{ 0.0, 0.0, 1.0, 1.0 } /* background_color */
117
FALSE, /* drawable_has_alpha */
119
{ 0, 0, 0, 0, 0, 0 }, /* selection */
121
GIMP_RUN_INTERACTIVE, /* run_mode */
125
/*---------------------------------------------------------------------------*/
128
params_save_to_gimp (void)
130
gimp_set_data (PLUG_IN_PROC, &p.params, sizeof p.params);
134
params_load_from_gimp (void)
136
gimp_get_data (PLUG_IN_PROC, &p.params);
138
if (0 < p.params.division_x)
140
p.params.tile_width = p.drawable->width / p.params.division_x;
141
if (0 < p.params.tile_width)
143
p.params.division_y = p.drawable->height / p.params.tile_height;
147
if (p.params.tile_width <= 0 ||
148
p.params.tile_height <= 0 ||
149
p.params.division_x <= 0 ||
150
p.params.division_y <= 0)
152
p.params.tile_width = p.drawable->width;
153
p.params.tile_height = p.drawable->height;
154
p.params.division_x = p.drawable->width / p.params.tile_width;
155
p.params.division_y = p.drawable->height / p.params.tile_height;
158
if (!p.drawable_has_alpha)
160
if (p.params.background_type == BACKGROUND_TYPE_TRANSPARENT)
162
p.params.background_type = BACKGROUND_TYPE_INVERTED;
165
gimp_rgb_set_alpha (&p.params.background_color, 1.0);
169
/*===========================================================================*/
171
/*===========================================================================*/
175
GtkObject *tile_width_adj;
176
GtkObject *tile_height_adj;
177
GtkObject *division_x_adj;
178
GtkObject *division_y_adj;
182
tile_width_adj_changed (GtkAdjustment *adj)
184
if (p.params.tile_width != (gint)adj->value)
186
p.params.tile_width = adj->value;
187
p.params.division_x = p.drawable->width / p.params.tile_width;
188
gtk_adjustment_set_value (GTK_ADJUSTMENT (w.division_x_adj),
189
p.params.division_x);
194
tile_height_adj_changed (GtkAdjustment *adj)
196
if (p.params.tile_height != (gint)adj->value)
198
p.params.tile_height = adj->value;
199
p.params.division_y = p.drawable->height / p.params.tile_height;
200
gtk_adjustment_set_value (GTK_ADJUSTMENT (w.division_y_adj),
201
p.params.division_y);
206
division_x_adj_changed (GtkAdjustment *adj)
208
if (p.params.division_x != (gint) adj->value)
210
p.params.division_x = adj->value;
211
p.params.tile_width = p.drawable->width / p.params.division_x;
212
gtk_adjustment_set_value (GTK_ADJUSTMENT (w.tile_width_adj),
213
p.params.tile_width);
218
division_y_adj_changed (GtkAdjustment *adj)
220
if (p.params.division_y != (gint)adj->value)
222
p.params.division_y = adj->value;
223
p.params.tile_height = p.drawable->height / p.params.division_y;
224
gtk_adjustment_set_value (GTK_ADJUSTMENT (w.tile_height_adj),
225
p.params.tile_height);
233
GtkWidget *main_hbox;
235
GtkObject *adjustment;
239
GtkWidget *color_button;
241
gimp_ui_init (PLUG_IN_BINARY, TRUE);
243
dialog = gimp_dialog_new (_("Paper Tile"), PLUG_IN_BINARY,
245
gimp_standard_help_func, PLUG_IN_PROC,
247
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
248
GTK_STOCK_OK, GTK_RESPONSE_OK,
252
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
257
gimp_window_set_transient (GTK_WINDOW (dialog));
259
main_hbox = gtk_hbox_new (FALSE, 12);
260
gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 12);
261
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_hbox);
262
gtk_widget_show (main_hbox);
265
vbox = gtk_vbox_new (FALSE, 12);
266
gtk_box_pack_start (GTK_BOX (main_hbox), vbox, FALSE, FALSE, 0);
267
gtk_widget_show (vbox);
269
frame = gimp_frame_new (_("Division"));
270
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
271
gtk_widget_show (frame);
273
table = gtk_table_new (4, 2, FALSE);
274
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
275
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
276
gtk_container_add (GTK_CONTAINER (frame), table);
277
gtk_widget_show (table);
279
button = gimp_spin_button_new (&w.division_x_adj, p.params.division_x,
280
1.0, p.drawable->width, 1.0, 5.0, 0, 1, 0);
281
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
284
g_signal_connect (w.division_x_adj, "value-changed",
285
G_CALLBACK (division_x_adj_changed),
288
button = gimp_spin_button_new (&w.division_y_adj, p.params.division_y,
289
1.0, p.drawable->width, 1.0, 5.0, 0, 1, 0);
290
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
293
g_signal_connect (w.division_y_adj, "value-changed",
294
G_CALLBACK (division_y_adj_changed),
297
button = gimp_spin_button_new (&w.tile_width_adj, p.params.tile_width,
298
1.0, MAX (p.drawable->width,
301
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
302
_("_Width:"), 0.0, 0.5,
304
g_signal_connect (w.tile_width_adj, "value-changed",
305
G_CALLBACK (tile_width_adj_changed),
308
button = gimp_spin_button_new (&w.tile_height_adj, p.params.tile_height,
309
1.0, MAX (p.drawable->width,
312
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
313
_("_Height:"), 0.0, 0.5,
315
g_signal_connect (w.tile_height_adj, "value-changed",
316
G_CALLBACK (tile_height_adj_changed),
319
frame = gimp_int_radio_group_new (TRUE, _("Fractional Pixels"),
320
G_CALLBACK (gimp_radio_button_update),
321
&p.params.fractional_type,
322
p.params.fractional_type,
325
FRACTIONAL_TYPE_BACKGROUND, NULL,
327
FRACTIONAL_TYPE_IGNORE, NULL,
329
FRACTIONAL_TYPE_FORCE, NULL,
332
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
333
gtk_widget_show (frame);
335
button = gtk_check_button_new_with_mnemonic(_("C_entering"));
336
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
338
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
339
gtk_widget_show (button);
341
g_signal_connect (button, "toggled",
342
G_CALLBACK (gimp_toggle_button_update),
343
&p.params.centering);
346
vbox = gtk_vbox_new (FALSE, 12);
347
gtk_box_pack_start (GTK_BOX (main_hbox), vbox, TRUE, TRUE, 0);
348
gtk_widget_show (vbox);
350
frame = gimp_frame_new (_("Movement"));
351
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
352
gtk_widget_show (frame);
354
table = gtk_table_new (2, 2, FALSE);
355
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
356
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
357
gtk_container_add (GTK_CONTAINER (frame), table);
358
gtk_widget_show (table);
360
button = gimp_spin_button_new (&adjustment, p.params.move_max_rate,
361
0.0, 100.0, 1.0, 10.0, 0, 1, 0);
362
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
363
_("_Max (%):"), 0.0, 0.5,
365
g_signal_connect (adjustment, "value-changed",
366
G_CALLBACK (gimp_double_adjustment_update),
367
&p.params.move_max_rate);
369
button = gtk_check_button_new_with_mnemonic (_("_Wrap around"));
370
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
371
p.params.wrap_around);
372
gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 2, 1, 2);
373
gtk_widget_show (button);
375
g_signal_connect (button, "toggled",
376
G_CALLBACK (gimp_toggle_button_update),
377
&p.params.wrap_around);
379
frame = gimp_int_radio_group_new (TRUE, _("Background Type"),
380
G_CALLBACK (gimp_radio_button_update),
381
&p.params.background_type,
382
p.params.background_type,
385
BACKGROUND_TYPE_TRANSPARENT, NULL,
386
_("I_nverted image"),
387
BACKGROUND_TYPE_INVERTED, NULL,
389
BACKGROUND_TYPE_IMAGE, NULL,
390
_("Fo_reground color"),
391
BACKGROUND_TYPE_FOREGROUND, NULL,
392
_("Bac_kground color"),
393
BACKGROUND_TYPE_BACKGROUND, NULL,
395
BACKGROUND_TYPE_COLOR, &button,
398
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
399
gtk_widget_show (frame);
401
color_button = gimp_color_button_new (_("Background Color"), 100, 16,
402
&p.params.background_color,
403
p.drawable_has_alpha ?
404
GIMP_COLOR_AREA_SMALL_CHECKS :
405
GIMP_COLOR_AREA_FLAT);
406
gtk_box_pack_start (GTK_BOX (GTK_BIN (frame)->child),
407
color_button, TRUE, TRUE, 0);
408
gtk_widget_show (color_button);
410
gtk_widget_set_sensitive (color_button,
411
p.params.background_type == BACKGROUND_TYPE_COLOR);
412
g_object_set_data (G_OBJECT (button), "set_sensitive", color_button);
414
g_signal_connect (color_button, "color-changed",
415
G_CALLBACK (gimp_color_button_get_color),
416
&p.params.background_color);
418
gtk_widget_show (dialog);
420
p.run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
422
gtk_widget_destroy (dialog);
425
/*===========================================================================*/
427
/*===========================================================================*/
440
tile_compare (const void *x,
443
return ((Tile *) x)->z - ((Tile *) y)->z;
446
static inline gdouble
449
return g_random_double_range (-1, 1);
453
random_move (gint *x,
457
gdouble angle = drand () * G_PI;
458
gdouble radius = drand () * (gdouble) max;
459
*x = (gint) (radius * cos (angle));
460
*y = (gint) (radius * sin (angle));
464
overlap_RGB (guchar *base,
473
overlap_RGBA (guchar *base,
476
gdouble R1 = (gdouble) base[0] / 255.0;
477
gdouble G1 = (gdouble) base[1] / 255.0;
478
gdouble B1 = (gdouble) base[2] / 255.0;
479
gdouble A1 = (gdouble) base[3] / 255.0;
480
gdouble R2 = (gdouble) top[0] / 255.0;
481
gdouble G2 = (gdouble) top[1] / 255.0;
482
gdouble B2 = (gdouble) top[2] / 255.0;
483
gdouble A2 = (gdouble) top[3] / 255.0;
484
gdouble A3 = A2 + A1 * (1.0 - A2);
488
gdouble R3 = (R1 * A1 * (1.0 - A2) + R2 * A2) / A3;
489
gdouble G3 = (G1 * A1 * (1.0 - A2) + G2 * A2) / A3;
490
gdouble B3 = (B1 * A1 * (1.0 - A2) + B2 * A2) / A3;
492
R3 = CLAMP (R3, 0.0, 1.0);
493
G3 = CLAMP (G3, 0.0, 1.0);
494
B3 = CLAMP (B3, 0.0, 1.0);
496
base[0] = (guchar) (R3 * 255.0);
497
base[1] = (guchar) (G3 * 255.0);
498
base[2] = (guchar) (B3 * 255.0);
499
base[3] = (guchar) (A3 * 255.0);
513
static void (* overlap)(guchar *, const guchar *);
528
gint move_max_pixels;
545
gimp_pixel_rgn_init (&src, p.drawable, 0, 0,
546
p.drawable->width, p.drawable->height, FALSE, FALSE);
547
gimp_pixel_rgn_init (&dst, p.drawable, 0, 0,
548
p.drawable->width, p.drawable->height, TRUE, TRUE);
549
pixels = g_new (guchar,
550
p.drawable->bpp * p.drawable->width * p.drawable->height);
551
buffer = g_new (guchar,
552
p.drawable->bpp * p.params.tile_width * p.params.tile_height);
554
overlap = p.drawable_has_alpha ? overlap_RGBA : overlap_RGB;
556
gimp_progress_init (_("Paper Tile"));
558
gimp_drawable_mask_bounds (p.drawable->drawable_id,
559
&p.selection.x0, &p.selection.y0,
560
&p.selection.x1, &p.selection.y1);
561
p.selection.width = p.selection.x1 - p.selection.x0;
562
p.selection.height = p.selection.y1 - p.selection.y0;
564
gimp_tile_cache_ntiles (2 * (p.selection.width / gimp_tile_width () + 1));
567
division_x = p.params.division_x;
568
division_y = p.params.division_y;
569
if (p.params.fractional_type == FRACTIONAL_TYPE_FORCE)
571
if (0 < p.drawable->width % p.params.tile_width) division_x++;
572
if (0 < p.drawable->height % p.params.tile_height) division_y++;
573
if (p.params.centering)
575
if (1 < p.drawable->width % p.params.tile_width)
579
(p.drawable->width % p.params.tile_width) / 2 -
587
if (1 < p.drawable->height % p.params.tile_height)
591
(p.drawable->height % p.params.tile_height) / 2 -
592
p.params.tile_height;
607
if (p.params.centering)
609
offset_x = (p.drawable->width % p.params.tile_width) / 2;
610
offset_y = (p.drawable->height % p.params.tile_height) / 2;
619
move_max_pixels = p.params.move_max_rate * p.params.tile_width / 100.0;
620
numof_tiles = division_x * division_y;
621
t = tiles = g_new(Tile, numof_tiles);
623
for (y = 0; y < division_y; y++)
625
gint srcy = offset_y + p.params.tile_height * y;
627
for (x = 0; x < division_x; x++, t++)
629
gint srcx = offset_x + p.params.tile_width * x;
634
t->width = srcx + p.params.tile_width;
636
else if (srcx + p.params.tile_width < p.drawable->width)
639
t->width = p.params.tile_width;
644
t->width = p.drawable->width - srcx;
650
t->height = srcy + p.params.tile_height;
652
else if (srcy + p.params.tile_height < p.drawable->height)
655
t->height = p.params.tile_height;
660
t->height = p.drawable->height - srcy;
663
t->z = g_rand_int (gr);
664
random_move (&t->move_x, &t->move_y, move_max_pixels);
668
qsort (tiles, numof_tiles, sizeof *tiles, tile_compare);
670
gimp_pixel_rgn_get_rect (&src, pixels, 0, 0, p.drawable->width,
673
if (p.params.fractional_type == FRACTIONAL_TYPE_IGNORE)
677
clear_width = p.params.tile_width * division_x;
678
clear_height = p.params.tile_height * division_y;
684
clear_width = p.drawable->width;
685
clear_height = p.drawable->height;
688
clear_x1 = clear_x0 + clear_width;
689
clear_y1 = clear_y0 + clear_height;
691
switch (p.params.background_type)
693
case BACKGROUND_TYPE_TRANSPARENT:
694
for (y = clear_y0; y < clear_y1; y++)
696
for (x = clear_x0; x < clear_x1; x++)
698
dindex = p.drawable->bpp * (p.drawable->width * y + x);
699
for (i = 0; i < p.drawable->bpp; i++)
701
pixels[dindex+i] = 0;
707
case BACKGROUND_TYPE_INVERTED:
708
for (y = clear_y0; y < clear_y1; y++)
710
for (x = clear_x0; x < clear_x1; x++)
712
dindex = p.drawable->bpp * (p.drawable->width * y + x);
713
pixels[dindex+0] = 255 - pixels[dindex+0];
714
pixels[dindex+1] = 255 - pixels[dindex+1];
715
pixels[dindex+2] = 255 - pixels[dindex+2];
720
case BACKGROUND_TYPE_IMAGE:
723
case BACKGROUND_TYPE_FOREGROUND:
724
gimp_context_get_foreground (&color);
725
gimp_rgb_get_uchar (&color, &pixel[0], &pixel[1], &pixel[2]);
727
for (y = clear_y0; y < clear_y1; y++)
729
for (x = clear_x0; x < clear_x1; x++)
731
dindex = p.drawable->bpp * (p.drawable->width * y + x);
732
for (i = 0; i < p.drawable->bpp; i++)
734
pixels[dindex+i] = pixel[i];
740
case BACKGROUND_TYPE_BACKGROUND:
741
gimp_context_get_background (&color);
742
gimp_rgb_get_uchar (&color, &pixel[0], &pixel[1], &pixel[2]);
744
for (y = clear_y0; y < clear_y1; y++)
746
for (x = clear_x0; x < clear_x1; x++)
748
dindex = p.drawable->bpp * (p.drawable->width * y + x);
749
for(i = 0; i < p.drawable->bpp; i++)
751
pixels[dindex+i] = pixel[i];
757
case BACKGROUND_TYPE_COLOR:
758
gimp_rgba_get_uchar (&p.params.background_color,
759
pixel, pixel + 1, pixel + 2, pixel + 3);
760
for (y = clear_y0; y < clear_y1; y++)
762
for (x = clear_x0; x < clear_x1; x++)
764
dindex = p.drawable->bpp * (p.drawable->width * y + x);
765
for(i = 0; i < p.drawable->bpp; i++)
767
pixels[dindex+i] = pixel[i];
775
for (t = tiles, i = 0; i < numof_tiles; i++, t++)
777
gint x0 = t->x + t->move_x;
778
gint y0 = t->y + t->move_y;
780
gimp_pixel_rgn_get_rect (&src, buffer, t->x, t->y, t->width, t->height);
782
for (y = 0; y < t->height; y++)
785
for (x = 0; x < t->width; x++)
788
sindex = p.drawable->bpp * (t->width * y + x);
789
if (0 <= px && px < p.drawable->width &&
790
0 <= py && py < p.drawable->height)
792
dindex = p.drawable->bpp * (p.drawable->width * py + px);
793
overlap(&pixels[dindex], &buffer[sindex]);
795
else if (p.params.wrap_around)
797
px = (px + p.drawable->width) % p.drawable->width;
798
py = (py + p.drawable->height) % p.drawable->height;
799
dindex = p.drawable->bpp * (p.drawable->width * py + px);
800
overlap(&pixels[dindex], &buffer[sindex]);
805
gimp_progress_update ((gdouble) i / (gdouble) numof_tiles);
808
gimp_pixel_rgn_set_rect (&dst, pixels, 0, 0, p.drawable->width,
811
gimp_drawable_flush (p.drawable);
812
gimp_drawable_merge_shadow (p.drawable->drawable_id, TRUE);
813
gimp_drawable_update (p.drawable->drawable_id,
814
p.selection.x0, p.selection.y0,
815
p.selection.width, p.selection.height);
823
/*============================================================================*/
824
/* PLUGIN INTERFACES */
825
/*============================================================================*/
830
static const GimpParamDef args[] =
832
{ GIMP_PDB_INT32, "run-mode", "run mode" },
833
{ GIMP_PDB_IMAGE, "image", "input image" },
834
{ GIMP_PDB_DRAWABLE, "drawable", "input drawable" },
835
{ GIMP_PDB_INT32, "tile-size", "tile size (pixels)" },
836
{ GIMP_PDB_FLOAT, "move-max", "max move rate (%)" },
837
{ GIMP_PDB_INT32, "fractional-type", "0:Background 1:Ignore 2:Force" },
838
{ GIMP_PDB_INT32, "wrap-around", "wrap around (bool)" },
839
{ GIMP_PDB_INT32, "centering", "centering (bool)" },
840
{ GIMP_PDB_INT32, "background-type", "0:Transparent 1:Inverted 2:Image? 3:FG 4:BG 5:Color" },
841
{ GIMP_PDB_INT32, "background-color", "background color (for bg-type 5)" },
842
{ GIMP_PDB_INT32, "background-alpha", "opacity (for bg-type 5)" }
845
gimp_install_procedure (PLUG_IN_PROC,
846
N_("Cut image into paper tiles, and slide them"),
847
"This plug-in cuts an image into paper tiles and "
848
"slides each paper tile.",
849
"Hirotsuna Mizuno <s1041150@u-aizu.ac.jp>",
850
"Copyright (c)1997-1999 Hirotsuna Mizuno",
851
_("September 31, 1999"),
852
N_("_Paper Tile..."),
855
G_N_ELEMENTS (args), 0,
858
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Map");
862
plugin_run (const gchar *name,
864
const GimpParam *params,
865
gint *numof_return_vals,
866
GimpParam **return_vals)
868
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
873
p.run_mode = params[0].data.d_int32;
874
p.image = params[1].data.d_image;
875
p.drawable = gimp_drawable_get(params[2].data.d_drawable);
876
p.drawable_has_alpha = gimp_drawable_has_alpha(p.drawable->drawable_id);
878
if (gimp_drawable_is_rgb (p.drawable->drawable_id))
882
case GIMP_RUN_INTERACTIVE:
883
params_load_from_gimp ();
887
case GIMP_RUN_NONINTERACTIVE:
888
if (numof_params == 11)
890
p.params.tile_width = params[3].data.d_int32;
891
p.params.tile_height = params[3].data.d_int32;
892
p.params.division_x = p.drawable->width / p.params.tile_width;
893
p.params.division_y = p.drawable->height / p.params.tile_height;
894
p.params.move_max_rate = params[4].data.d_float;
895
p.params.fractional_type = (FractionalType)params[5].data.d_int32;
896
p.params.wrap_around = params[6].data.d_int32;
897
p.params.centering = params[7].data.d_int32;
898
p.params.background_type = (BackgroundType)params[8].data.d_int32;
899
p.params.background_color = params[9].data.d_color;
901
/* FIXME: this used to be the alpha value
902
params[10].data.d_int32
908
status = GIMP_PDB_CALLING_ERROR;
912
case GIMP_RUN_WITH_LAST_VALS:
913
params_load_from_gimp ();
920
status = GIMP_PDB_EXECUTION_ERROR;
923
if (status == GIMP_PDB_SUCCESS && p.run)
925
params_save_to_gimp ();
929
if (p.run_mode != GIMP_RUN_NONINTERACTIVE)
930
gimp_displays_flush ();
933
gimp_drawable_detach (p.drawable);
936
static GimpParam return_value[1];
937
return_value[0].type = GIMP_PDB_STATUS;
938
return_value[0].data.d_status = status;
939
*numof_return_vals = 1;
940
*return_vals = return_value;
944
const GimpPlugInInfo PLUG_IN_INFO =