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

« back to all changes in this revision

Viewing changes to libgimp/gimpconvert_pdb.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:
19
19
 * Boston, MA 02111-1307, USA.
20
20
 */
21
21
 
22
 
/* NOTE: This file is autogenerated by pdbgen.pl */
 
22
/* NOTE: This file is auto-generated by pdbgen.pl */
23
23
 
24
24
#include "config.h"
25
25
 
32
32
 * Convert specified image to RGB color
33
33
 *
34
34
 * This procedure converts the specified image to RGB color. This
35
 
 * process requires an image of type GIMP_GRAY or GIMP_INDEXED. No
36
 
 * image content is lost in this process aside from the colormap for an
 
35
 * process requires an image in RGB or Indexed color mode. No image
 
36
 * content is lost in this process aside from the colormap for an
37
37
 * indexed image.
38
38
 *
39
39
 * Returns: TRUE on success.
45
45
  gint nreturn_vals;
46
46
  gboolean success = TRUE;
47
47
 
48
 
  return_vals = gimp_run_procedure ("gimp_image_convert_rgb",
49
 
                                    &nreturn_vals,
50
 
                                    GIMP_PDB_IMAGE, image_ID,
51
 
                                    GIMP_PDB_END);
 
48
  return_vals = gimp_run_procedure ("gimp-image-convert-rgb",
 
49
                                    &nreturn_vals,
 
50
                                    GIMP_PDB_IMAGE, image_ID,
 
51
                                    GIMP_PDB_END);
52
52
 
53
53
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
54
54
 
64
64
 * Convert specified image to grayscale (256 intensity levels)
65
65
 *
66
66
 * This procedure converts the specified image to grayscale with 8 bits
67
 
 * per pixel (256 intensity levels). This process requires an image of
68
 
 * type GIMP_RGB or GIMP_INDEXED.
 
67
 * per pixel (256 intensity levels). This process requires an image in
 
68
 * RGB or Indexed color mode.
69
69
 *
70
70
 * Returns: TRUE on success.
71
71
 */
76
76
  gint nreturn_vals;
77
77
  gboolean success = TRUE;
78
78
 
79
 
  return_vals = gimp_run_procedure ("gimp_image_convert_grayscale",
80
 
                                    &nreturn_vals,
81
 
                                    GIMP_PDB_IMAGE, image_ID,
82
 
                                    GIMP_PDB_END);
 
79
  return_vals = gimp_run_procedure ("gimp-image-convert-grayscale",
 
80
                                    &nreturn_vals,
 
81
                                    GIMP_PDB_IMAGE, image_ID,
 
82
                                    GIMP_PDB_END);
83
83
 
84
84
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
85
85
 
95
95
 * @palette_type: The type of palette to use.
96
96
 * @num_cols: The number of colors to quantize to, ignored unless (palette_type == GIMP_MAKE_PALETTE).
97
97
 * @alpha_dither: Dither transparency to fake partial opacity.
98
 
 * @remove_unused: Remove unused or duplicate colour entries from final palette, ignored if (palette_type == GIMP_MAKE_PALETTE).
 
98
 * @remove_unused: Remove unused or duplicate color entries from final palette, ignored if (palette_type == GIMP_MAKE_PALETTE).
99
99
 * @palette: The name of the custom palette to use, ignored unless (palette_type == GIMP_CUSTOM_PALETTE).
100
100
 *
101
101
 * Convert specified image to and Indexed image
102
102
 *
103
103
 * This procedure converts the specified image to 'indexed' color. This
104
 
 * process requires an image of type GIMP_GRAY or GIMP_RGB. The
 
104
 * process requires an image in RGB or Grayscale mode. The
105
105
 * 'palette_type' specifies what kind of palette to use, A type of '0'
106
106
 * means to use an optimal palette of 'num_cols' generated from the
107
107
 * colors in the image. A type of '1' means to re-use the previous
118
118
 */
119
119
gboolean
120
120
gimp_image_convert_indexed (gint32                  image_ID,
121
 
                            GimpConvertDitherType   dither_type,
122
 
                            GimpConvertPaletteType  palette_type,
123
 
                            gint                    num_cols,
124
 
                            gboolean                alpha_dither,
125
 
                            gboolean                remove_unused,
126
 
                            const gchar            *palette)
127
 
{
128
 
  GimpParam *return_vals;
129
 
  gint nreturn_vals;
130
 
  gboolean success = TRUE;
131
 
 
132
 
  return_vals = gimp_run_procedure ("gimp_image_convert_indexed",
133
 
                                    &nreturn_vals,
134
 
                                    GIMP_PDB_IMAGE, image_ID,
135
 
                                    GIMP_PDB_INT32, dither_type,
136
 
                                    GIMP_PDB_INT32, palette_type,
137
 
                                    GIMP_PDB_INT32, num_cols,
138
 
                                    GIMP_PDB_INT32, alpha_dither,
139
 
                                    GIMP_PDB_INT32, remove_unused,
140
 
                                    GIMP_PDB_STRING, palette,
141
 
                                    GIMP_PDB_END);
 
121
                            GimpConvertDitherType   dither_type,
 
122
                            GimpConvertPaletteType  palette_type,
 
123
                            gint                    num_cols,
 
124
                            gboolean                alpha_dither,
 
125
                            gboolean                remove_unused,
 
126
                            const gchar            *palette)
 
127
{
 
128
  GimpParam *return_vals;
 
129
  gint nreturn_vals;
 
130
  gboolean success = TRUE;
 
131
 
 
132
  return_vals = gimp_run_procedure ("gimp-image-convert-indexed",
 
133
                                    &nreturn_vals,
 
134
                                    GIMP_PDB_IMAGE, image_ID,
 
135
                                    GIMP_PDB_INT32, dither_type,
 
136
                                    GIMP_PDB_INT32, palette_type,
 
137
                                    GIMP_PDB_INT32, num_cols,
 
138
                                    GIMP_PDB_INT32, alpha_dither,
 
139
                                    GIMP_PDB_INT32, remove_unused,
 
140
                                    GIMP_PDB_STRING, palette,
 
141
                                    GIMP_PDB_END);
 
142
 
 
143
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
144
 
 
145
  gimp_destroy_params (return_vals, nreturn_vals);
 
146
 
 
147
  return success;
 
148
}
 
149
 
 
150
/**
 
151
 * gimp_image_convert_set_dither_matrix:
 
152
 * @width: Width of the matrix (0 to reset to default matrix).
 
153
 * @height: Height of the matrix (0 to reset to default matrix).
 
154
 * @matrix_length: The length of 'matrix'.
 
155
 * @matrix: The matrix -- all values must be >= 1.
 
156
 *
 
157
 * Set dither matrix for conversion to indexed
 
158
 *
 
159
 * This procedure sets the dither matrix used when converting images to
 
160
 * INDEXED mode with positional dithering.
 
161
 *
 
162
 * Returns: TRUE on success.
 
163
 *
 
164
 * Since: GIMP 2.4
 
165
 */
 
166
gboolean
 
167
gimp_image_convert_set_dither_matrix (gint          width,
 
168
                                      gint          height,
 
169
                                      gint          matrix_length,
 
170
                                      const guint8 *matrix)
 
171
{
 
172
  GimpParam *return_vals;
 
173
  gint nreturn_vals;
 
174
  gboolean success = TRUE;
 
175
 
 
176
  return_vals = gimp_run_procedure ("gimp-image-convert-set-dither-matrix",
 
177
                                    &nreturn_vals,
 
178
                                    GIMP_PDB_INT32, width,
 
179
                                    GIMP_PDB_INT32, height,
 
180
                                    GIMP_PDB_INT32, matrix_length,
 
181
                                    GIMP_PDB_INT8ARRAY, matrix,
 
182
                                    GIMP_PDB_END);
142
183
 
143
184
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
144
185