Lines 45-53
Link Here
|
45 |
|
45 |
|
46 |
/* Declare local functions. */ |
46 |
/* Declare local functions. */ |
47 |
static void query (void); |
47 |
static void query (void); |
48 |
static void run (char *name, |
48 |
static void run (const gchar *name, |
49 |
gint nparams, |
49 |
gint nparams, |
50 |
GimpParam * param, |
50 |
const GimpParam * param, |
51 |
gint * nreturn_vals, GimpParam ** return_vals); |
51 |
gint * nreturn_vals, GimpParam ** return_vals); |
52 |
static gint dialog (); |
52 |
static gint dialog (); |
53 |
static void doit (void); |
53 |
static void doit (void); |
Lines 111-117
Link Here
|
111 |
{GIMP_PDB_FLOAT, "noise", "Noise to Signal ratio"}, |
111 |
{GIMP_PDB_FLOAT, "noise", "Noise to Signal ratio"}, |
112 |
}; |
112 |
}; |
113 |
static GimpParamDef *return_vals = NULL; |
113 |
static GimpParamDef *return_vals = NULL; |
114 |
static gint nargs = (gint) (sizeof (args) / sizeof (args[0])); |
|
|
115 |
static gint nreturn_vals = 0; |
114 |
static gint nreturn_vals = 0; |
116 |
|
115 |
|
117 |
gimp_install_procedure ("plug_in_refocus", |
116 |
gimp_install_procedure ("plug_in_refocus", |
Lines 123-137
Link Here
|
123 |
"<Image>/Filters/Enhance/Refocus ...", |
122 |
"<Image>/Filters/Enhance/Refocus ...", |
124 |
"RGB*, GRAY*", |
123 |
"RGB*, GRAY*", |
125 |
GIMP_PLUGIN, |
124 |
GIMP_PLUGIN, |
126 |
nargs, nreturn_vals, args, return_vals); |
125 |
G_N_ELEMENTS(args), nreturn_vals, args, return_vals); |
127 |
} |
126 |
} |
128 |
|
127 |
|
129 |
static void |
128 |
static void |
130 |
run (char *name, gint n_params, GimpParam * param, |
129 |
run (const gchar *name, gint n_params, const GimpParam * param, |
131 |
gint * nreturn_vals, GimpParam ** return_vals) |
130 |
gint * nreturn_vals, GimpParam ** return_vals) |
132 |
{ |
131 |
{ |
133 |
static GimpParam values[1]; |
132 |
static GimpParam values[1]; |
134 |
GimpRunModeType run_mode; |
133 |
GimpRunMode run_mode; |
135 |
GimpPDBStatusType status = GIMP_PDB_SUCCESS; |
134 |
GimpPDBStatusType status = GIMP_PDB_SUCCESS; |
136 |
|
135 |
|
137 |
(void) name; /* Shut up warnings about unused parameters. */ |
136 |
(void) name; /* Shut up warnings about unused parameters. */ |
Lines 186-193
Link Here
|
186 |
{ |
185 |
{ |
187 |
|
186 |
|
188 |
/* Make sure that the drawable is gray or RGB color */ |
187 |
/* Make sure that the drawable is gray or RGB color */ |
189 |
if (gimp_drawable_is_rgb (drawable->id) || |
188 |
if (gimp_drawable_is_rgb (drawable->drawable_id) || |
190 |
gimp_drawable_is_gray (drawable->id)) |
189 |
gimp_drawable_is_gray (drawable->drawable_id)) |
191 |
{ |
190 |
{ |
192 |
doit (); |
191 |
doit (); |
193 |
|
192 |
|
Lines 411-417
Link Here
|
411 |
event_is_current = |
410 |
event_is_current = |
412 |
gimp_preview_draw_unscaled_row (GIMP_PREVIEW (my_widgets.preview), |
411 |
gimp_preview_draw_unscaled_row (GIMP_PREVIEW (my_widgets.preview), |
413 |
event->event_id, |
412 |
event->event_id, |
414 |
gimp_drawable_type (drawable->id), |
413 |
gimp_drawable_type (drawable->drawable_id), |
415 |
row, buf); |
414 |
row, buf); |
416 |
}; |
415 |
}; |
417 |
g_free (buf); |
416 |
g_free (buf); |
Lines 608-614
Link Here
|
608 |
gimp_progress_init ("Computing matrix"); |
607 |
gimp_progress_init ("Computing matrix"); |
609 |
update_matrix (); |
608 |
update_matrix (); |
610 |
gimp_progress_init ("Applying convolution"); |
609 |
gimp_progress_init ("Applying convolution"); |
611 |
gimp_drawable_mask_bounds (drawable->id, &sx1, &sy1, &sx2, &sy2); |
610 |
gimp_drawable_mask_bounds (drawable->drawable_id, &sx1, &sy1, &sx2, &sy2); |
612 |
width = sx2 - sx1; |
611 |
width = sx2 - sx1; |
613 |
height = sy2 - sy1; |
612 |
height = sy2 - sy1; |
614 |
tile_source_init_from_drawable (&source, drawable, sx1, sy1, width, height); |
613 |
tile_source_init_from_drawable (&source, drawable, sx1, sy1, width, height); |
Lines 618-624
Link Here
|
618 |
matrix, 2 * my_config.mat_width + 1, |
617 |
matrix, 2 * my_config.mat_width + 1, |
619 |
&update_progress_closure); |
618 |
&update_progress_closure); |
620 |
gimp_drawable_flush (drawable); |
619 |
gimp_drawable_flush (drawable); |
621 |
gimp_drawable_merge_shadow (drawable->id, TRUE); |
620 |
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE); |
622 |
gimp_drawable_update (drawable->id, sx1, sy1, width, height); |
621 |
gimp_drawable_update (drawable->drawable_id, sx1, sy1, width, height); |
623 |
g_free (matrix); |
622 |
g_free (matrix); |
624 |
} |
623 |
} |