5
5
/* GIMP - The GNU Image Manipulation Program
6
6
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
8
* This program is free software; you can redistribute it and/or modify
8
* This program is free software: you can redistribute it and/or modify
9
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
10
* the Free Software Foundation; either version 3 of the License, or
11
11
* (at your option) any later version.
13
13
* This program is distributed in the hope that it will be useful,
16
16
* GNU General Public License for more details.
18
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
22
#include "config.h"
35
34
static void query (void);
36
35
static void run (const gchar *name,
38
const GimpParam *param,
40
GimpParam **return_vals);
37
const GimpParam *param,
39
GimpParam **return_vals);
42
41
static void semiflatten (GimpDrawable *drawable);
60
59
static const GimpParamDef args[] =
62
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
61
{ GIMP_PDB_INT32, "run-mode", "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }" },
63
62
{ GIMP_PDB_IMAGE, "image", "Input image (unused)" },
64
63
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
67
66
gimp_install_procedure (PLUG_IN_PROC,
68
N_("Replace partial transparency with the current background color"),
69
"This plugin flattens pixels in an RGBA image that "
70
"aren't completely transparent against the current "
71
"GIMP background color",
72
"Adam D. Moss (adam@foxbox.org)",
73
"Adam D. Moss (adam@foxbox.org)",
78
G_N_ELEMENTS (args), 0,
67
N_("Replace partial transparency with the current background color"),
68
"This plugin flattens pixels in an RGBA image that "
69
"aren't completely transparent against the current "
70
"GIMP background color",
71
"Adam D. Moss (adam@foxbox.org)",
72
"Adam D. Moss (adam@foxbox.org)",
77
G_N_ELEMENTS (args), 0,
81
80
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Web");
82
81
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Layer/Transparency/Modify");
109
104
/* Get the specified drawable */
110
105
drawable = gimp_drawable_get (param[2].data.d_drawable);
111
image_ID = param[1].data.d_image;
113
107
if (status == GIMP_PDB_SUCCESS)
115
109
/* Make sure that the drawable is indexed or RGB color */
116
110
if (gimp_drawable_is_rgb (drawable->drawable_id))
118
gimp_progress_init (_("Semi-Flattening"));
119
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width ()
121
semiflatten (drawable);
122
gimp_displays_flush ();
112
gimp_progress_init (_("Semi-Flattening"));
113
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width ()
115
semiflatten (drawable);
116
gimp_displays_flush ();
126
status = GIMP_PDB_EXECUTION_ERROR;
120
status = GIMP_PDB_EXECUTION_ERROR;
130
124
values[0].data.d_status = status;