119
static GimpParamDef args[] =
123
static const GimpParamDef args[] =
121
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
122
{ GIMP_PDB_IMAGE, "image", "Input image" },
123
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
124
{ GIMP_PDB_FLOAT, "inner", "Radius of inner gaussian blur (in pixels, > 0.0)" },
125
{ GIMP_PDB_FLOAT, "outer", "Radius of outer gaussian blur (in pixels, > 0.0)" },
126
{ GIMP_PDB_INT32, "normalize", "True, False" },
127
{ GIMP_PDB_INT32, "invert", "True, False" }
125
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
126
{ GIMP_PDB_IMAGE, "image", "Input image" },
127
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
128
{ GIMP_PDB_FLOAT, "inner", "Radius of inner gaussian blur (in pixels, > 0.0)" },
129
{ GIMP_PDB_FLOAT, "outer", "Radius of outer gaussian blur (in pixels, > 0.0)" },
130
{ GIMP_PDB_INT32, "normalize", "True, False" },
131
{ GIMP_PDB_INT32, "invert", "True, False" }
130
gimp_install_procedure ("plug_in_dog",
131
"Edge detection using difference of Gaussians.",
134
gimp_install_procedure (PLUG_IN_PROC,
135
N_("Edge detection with control of edge thickness"),
132
136
"Applies two Gaussian blurs to the drawable, and "
133
137
"subtracts the results. This is robust and widely "
134
"used method for detecting edges. Uses Gauss IIR "
135
"algorithm for the Gaussians.",
138
"used method for detecting edges.",
136
139
"Spencer Kimball, Peter Mattis, Sven Neumann, William Skaggs",
137
140
"Spencer Kimball, Peter Mattis, Sven Neumann, William Skaggs",
139
N_("Difference of Gaussians..."),
142
N_("_Difference of Gaussians..."),
142
145
G_N_ELEMENTS (args), 0,
145
gimp_plugin_menu_register ("plug_in_dog", "<Image>/Filters/Edge-Detect");
148
gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Edge-Detect");
177
180
(MAX (drawable->width, drawable->height) /
178
181
gimp_tile_width () + 1));
180
if (strcmp (name, "plug_in_dog") == 0)
183
if (strcmp (name, PLUG_IN_PROC) == 0)
182
185
switch (run_mode)
184
187
case GIMP_RUN_INTERACTIVE:
185
188
/* Possibly retrieve data */
186
gimp_get_data ("plug_in_dog", &dogvals);
189
gimp_get_data (PLUG_IN_PROC, &dogvals);
188
191
/* First acquire information with a dialog */
189
192
if (! dog_dialog (image_ID, drawable))
272
gimp_ui_init ("dog", FALSE);
273
gimp_ui_init (PLUG_IN_BINARY, FALSE);
274
dialog = gimp_dialog_new (_("DoG Edge Detect"), "dog",
275
dialog = gimp_dialog_new (_("DoG Edge Detect"), PLUG_IN_BINARY,
276
gimp_standard_help_func, "plug-in-dog",
277
gimp_standard_help_func, PLUG_IN_PROC,
278
279
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
279
280
GTK_STOCK_OK, GTK_RESPONSE_OK,
284
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
289
gimp_window_set_transient (GTK_WINDOW (dialog));
283
291
main_vbox = gtk_vbox_new (FALSE, 12);
284
292
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
285
293
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);