~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/common/c_astretch.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "libgimp/stdplugins-intl.h"
29
29
 
30
30
 
 
31
#define PLUG_IN_PROC "plug-in-c-astretch"
 
32
 
 
33
 
31
34
/* Declare local functions.
32
35
 */
33
36
static void   query              (void);
41
44
static void   indexed_c_astretch (gint32            image_ID);
42
45
 
43
46
 
44
 
GimpPlugInInfo PLUG_IN_INFO =
 
47
const GimpPlugInInfo PLUG_IN_INFO =
45
48
{
46
49
  NULL,  /* init_proc  */
47
50
  NULL,  /* quit_proc  */
55
58
static void
56
59
query (void)
57
60
{
58
 
  static GimpParamDef args[] =
 
61
  static const GimpParamDef args[] =
59
62
  {
60
 
    { GIMP_PDB_INT32,    "run_mode", "Interactive, non-interactive" },
61
 
    { GIMP_PDB_IMAGE,    "image",    "Input image" },
62
 
    { GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }
 
63
    { GIMP_PDB_INT32,    "run-mode", "Interactive, non-interactive" },
 
64
    { GIMP_PDB_IMAGE,    "image",    "Input image"                  },
 
65
    { GIMP_PDB_DRAWABLE, "drawable", "Input drawable"               }
63
66
  };
64
67
 
65
 
  gimp_install_procedure ("plug_in_c_astretch",
66
 
                          "Automatically stretch the contrast of the "
67
 
                          "specified drawable to cover all possible ranges.",
 
68
  gimp_install_procedure (PLUG_IN_PROC,
 
69
                          N_("Stretch contrast to cover the maximum possible range"),
68
70
                          "This simple plug-in does an automatic contrast "
69
71
                          "stretch.  For each channel in the image, it finds "
70
72
                          "the minimum and maximum values... it uses those "
81
83
                          G_N_ELEMENTS (args), 0,
82
84
                          args, NULL);
83
85
 
84
 
  gimp_plugin_menu_register ("plug_in_c_astretch", "<Image>/Layer/Colors/Auto");
 
86
  gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Colors/Auto");
85
87
}
86
88
 
87
89
static void
109
111
  if (gimp_drawable_is_rgb (drawable->drawable_id) ||
110
112
      gimp_drawable_is_gray (drawable->drawable_id))
111
113
    {
112
 
      gimp_progress_init (_("Auto-Stretching Contrast..."));
 
114
      gimp_progress_init (_("Auto-stretching contrast"));
113
115
      gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
114
116
      c_astretch (drawable);
115
117
 
125
127
    }
126
128
  else
127
129
    {
128
 
      /* gimp_message ("c_astretch: cannot operate on indexed color images"); */
129
130
      status = GIMP_PDB_EXECUTION_ERROR;
130
131
    }
131
132
 
132
133
  *nreturn_vals = 1;
133
 
  *return_vals = values;
 
134
  *return_vals  = values;
134
135
 
135
 
  values[0].type = GIMP_PDB_STATUS;
 
136
  values[0].type          = GIMP_PDB_STATUS;
136
137
  values[0].data.d_status = status;
137
138
 
138
139
  gimp_drawable_detach (drawable);
250
251
 
251
252
  gimp_rgn_iterate2 (drawable, 0 /* unused */, c_astretch_func, &param);
252
253
}
253