Commit 364c8e9a authored by Øyvind Kolås's avatar Øyvind Kolås
Browse files

doing things that should have been done in previous commit

parent c5c0a219
2004-11-01 Øyvind Kolås <pippin@gimp.org>
* app/pdb/color_cmds.c
* app/pdb/internal_procs.c
* libgimp/gimpcolor_pdb.c
* libgimp/gimpcolor_pdb.h: regenerated
* tools/pdbgen/pdb/color.pdb: added levels-stretch to @procs, removed
metainformation from deprecated levels-auto.
2004-11-01 Øyvind Kolås <pippin@gimp.org>
 
* app/actions/drawable-actions.c
......
......@@ -51,6 +51,7 @@
static ProcRecord brightness_contrast_proc;
static ProcRecord levels_proc;
static ProcRecord levels_auto_proc;
static ProcRecord levels_stretch_proc;
static ProcRecord posterize_proc;
static ProcRecord desaturate_proc;
static ProcRecord equalize_proc;
......@@ -69,6 +70,7 @@ register_color_procs (Gimp *gimp)
procedural_db_register (gimp, &brightness_contrast_proc);
procedural_db_register (gimp, &levels_proc);
procedural_db_register (gimp, &levels_auto_proc);
procedural_db_register (gimp, &levels_stretch_proc);
procedural_db_register (gimp, &posterize_proc);
procedural_db_register (gimp, &desaturate_proc);
procedural_db_register (gimp, &equalize_proc);
......@@ -351,6 +353,57 @@ static ProcRecord levels_auto_proc =
{ { levels_auto_invoker } }
};
static Argument *
levels_stretch_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
GimpDrawable *drawable;
drawable = (GimpDrawable *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
if (! (GIMP_IS_DRAWABLE (drawable) && ! gimp_item_is_removed (GIMP_ITEM (drawable))))
success = FALSE;
if (success)
{
if (gimp_drawable_is_indexed (drawable))
success = FALSE;
if (success)
gimp_drawable_levels_stretch (drawable, context);
}
return procedural_db_return_args (&levels_stretch_proc, success);
}
static ProcArg levels_stretch_inargs[] =
{
{
GIMP_PDB_DRAWABLE,
"drawable",
"The drawable"
}
};
static ProcRecord levels_stretch_proc =
{
"gimp_levels_stretch",
"Automatically modifies intensity levels in the specified drawable.",
"This procedure allows intensity levels in the specified drawable to be remapped according to a set of guessed parameters. It is equivalent to clicking the \"Auto\" button in the Levels tool. This procedure is only valid on RGB color and grayscale images. It will not operate on indexed drawables.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
NULL,
GIMP_INTERNAL,
1,
levels_stretch_inargs,
0,
NULL,
{ { levels_stretch_invoker } }
};
static Argument *
posterize_invoker (Gimp *gimp,
GimpContext *context,
......
......@@ -74,7 +74,7 @@ void register_transform_tools_procs (Gimp *gimp);
void register_undo_procs (Gimp *gimp);
void register_unit_procs (Gimp *gimp);
/* 421 procedures registered total */
/* 422 procedures registered total */
void
internal_procs_init (Gimp *gimp,
......@@ -98,82 +98,82 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Color"), 0.062);
register_color_procs (gimp);
(* status_callback) (NULL, _("Context"), 0.095);
(* status_callback) (NULL, _("Context"), 0.097);
register_context_procs (gimp);
(* status_callback) (NULL, _("Convert"), 0.147);
(* status_callback) (NULL, _("Convert"), 0.149);
register_convert_procs (gimp);
(* status_callback) (NULL, _("Display procedures"), 0.154);
(* status_callback) (NULL, _("Display procedures"), 0.156);
register_display_procs (gimp);
(* status_callback) (NULL, _("Drawable procedures"), 0.164);
(* status_callback) (NULL, _("Drawable procedures"), 0.166);
register_drawable_procs (gimp);
(* status_callback) (NULL, _("Transformation procedures"), 0.242);
(* status_callback) (NULL, _("Transformation procedures"), 0.244);
register_drawable_transform_procs (gimp);
(* status_callback) (NULL, _("Edit procedures"), 0.261);
(* status_callback) (NULL, _("Edit procedures"), 0.263);
register_edit_procs (gimp);
(* status_callback) (NULL, _("File Operations"), 0.28);
(* status_callback) (NULL, _("File Operations"), 0.282);
register_fileops_procs (gimp);
(* status_callback) (NULL, _("Floating selections"), 0.302);
(* status_callback) (NULL, _("Floating selections"), 0.303);
register_floating_sel_procs (gimp);
(* status_callback) (NULL, _("Font UI"), 0.316);
(* status_callback) (NULL, _("Font UI"), 0.318);
register_font_select_procs (gimp);
(* status_callback) (NULL, _("Fonts"), 0.323);
(* status_callback) (NULL, _("Fonts"), 0.325);
register_fonts_procs (gimp);
(* status_callback) (NULL, _("Gimprc procedures"), 0.328);
(* status_callback) (NULL, _("Gimprc procedures"), 0.329);
register_gimprc_procs (gimp);
(* status_callback) (NULL, _("Gradient"), 0.342);
(* status_callback) (NULL, _("Gradient"), 0.344);
register_gradient_procs (gimp);
(* status_callback) (NULL, _("Gradient UI"), 0.411);
(* status_callback) (NULL, _("Gradient UI"), 0.412);
register_gradient_select_procs (gimp);
(* status_callback) (NULL, _("Gradients"), 0.418);
(* status_callback) (NULL, _("Gradients"), 0.419);
register_gradients_procs (gimp);
(* status_callback) (NULL, _("Guide procedures"), 0.43);
(* status_callback) (NULL, _("Guide procedures"), 0.431);
register_guides_procs (gimp);
(* status_callback) (NULL, _("Help procedures"), 0.444);
(* status_callback) (NULL, _("Help procedures"), 0.445);
register_help_procs (gimp);
(* status_callback) (NULL, _("Image"), 0.447);
(* status_callback) (NULL, _("Image"), 0.448);
register_image_procs (gimp);
(* status_callback) (NULL, _("Layer"), 0.594);
(* status_callback) (NULL, _("Layer"), 0.595);
register_layer_procs (gimp);
(* status_callback) (NULL, _("Message procedures"), 0.656);
register_message_procs (gimp);
(* status_callback) (NULL, _("Miscellaneous"), 0.663);
(* status_callback) (NULL, _("Miscellaneous"), 0.664);
register_misc_procs (gimp);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.667);
(* status_callback) (NULL, _("Paint Tool procedures"), 0.668);
register_paint_tools_procs (gimp);
(* status_callback) (NULL, _("Palette"), 0.703);
(* status_callback) (NULL, _("Palette"), 0.704);
register_palette_procs (gimp);
(* status_callback) (NULL, _("Palette UI"), 0.729);
(* status_callback) (NULL, _("Palette UI"), 0.73);
register_palette_select_procs (gimp);
(* status_callback) (NULL, _("Palettes"), 0.736);
(* status_callback) (NULL, _("Palettes"), 0.737);
register_palettes_procs (gimp);
(* status_callback) (NULL, _("Parasite procedures"), 0.746);
register_parasite_procs (gimp);
(* status_callback) (NULL, _("Paths"), 0.774);
(* status_callback) (NULL, _("Paths"), 0.775);
register_paths_procs (gimp);
(* status_callback) (NULL, _("Pattern"), 0.81);
......@@ -185,16 +185,16 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Patterns"), 0.822);
register_patterns_procs (gimp);
(* status_callback) (NULL, _("Plug-in"), 0.831);
(* status_callback) (NULL, _("Plug-in"), 0.832);
register_plug_in_procs (gimp);
(* status_callback) (NULL, _("Procedural database"), 0.843);
(* status_callback) (NULL, _("Procedural database"), 0.844);
register_procedural_db_procs (gimp);
(* status_callback) (NULL, _("Progress"), 0.865);
register_progress_procs (gimp);
(* status_callback) (NULL, _("Image mask"), 0.876);
(* status_callback) (NULL, _("Image mask"), 0.877);
register_selection_procs (gimp);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.919);
......@@ -209,7 +209,7 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Undo"), 0.955);
register_undo_procs (gimp);
(* status_callback) (NULL, _("Units"), 0.971);
(* status_callback) (NULL, _("Units"), 0.972);
register_unit_procs (gimp);
}
......@@ -147,6 +147,39 @@ gimp_levels_auto (gint32 drawable_ID)
return success;
}
/**
* gimp_levels_stretch:
* @drawable_ID: The drawable.
*
* Automatically modifies intensity levels in the specified drawable.
*
* This procedure allows intensity levels in the specified drawable to
* be remapped according to a set of guessed parameters. It is
* equivalent to clicking the \"Auto\" button in the Levels tool. This
* procedure is only valid on RGB color and grayscale images. It will
* not operate on indexed drawables.
*
* Returns: TRUE on success.
*/
gboolean
gimp_levels_stretch (gint32 drawable_ID)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_levels_stretch",
&nreturn_vals,
GIMP_PDB_DRAWABLE, drawable_ID,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_posterize:
* @drawable_ID: The drawable.
......
......@@ -42,6 +42,7 @@ gboolean gimp_levels (gint32 drawable_ID,
#ifndef GIMP_DISABLE_DEPRECATED
gboolean gimp_levels_auto (gint32 drawable_ID);
#endif /* GIMP_DISABLE_DEPRECATED */
gboolean gimp_levels_stretch (gint32 drawable_ID);
gboolean gimp_posterize (gint32 drawable_ID,
gint levels);
gboolean gimp_desaturate (gint32 drawable_ID);
......
......@@ -185,21 +185,6 @@ CODE
sub levels_auto {
&std_pdb_deprecated ('gimp_levels_stretch');
$blurb = 'Automatically modifies intensity levels in the specified drawable.';
$help = <<'HELP';
This procedure allows intensity levels in the specified drawable to be
remapped according to a set of guessed parameters. It is equivalent to
clicking the "Auto" button in the Levels tool. This procedure is
only valid on RGB color and grayscale images. It will not operate on
indexed drawables.
HELP
$author = $copyright = 'Joao S.O. Bueno, Shawn Willden';
$date = '2003';
&std_pdb_misc;
@inargs = ( &drawable_arg );
%invoke = (
......@@ -909,7 +894,7 @@ CODE
"core/gimpdrawable.h" "core/gimpimage.h"
"gimp-intl.h");
@procs = qw(brightness_contrast levels levels_auto posterize desaturate
@procs = qw(brightness_contrast levels levels_auto levels_stretch posterize desaturate
equalize invert curves_spline curves_explicit color_balance
colorize histogram hue_saturation threshold);
%exports = (app => [@procs], lib => [@procs]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment