1
/* LIBGIMP - The GIMP Library
2
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the
18
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
22
/* NOTE: This file is autogenerated by pdbgen.pl */
29
* gimp_brightness_contrast:
30
* @drawable_ID: The drawable.
31
* @brightness: Brightness adjustment.
32
* @contrast: Contrast adjustment.
34
* Modify brightness/contrast in the specified drawable.
36
* This procedures allows the brightness and contrast of the specified
37
* drawable to be modified. Both 'brightness' and 'contrast' parameters
38
* are defined between -127 and 127.
40
* Returns: TRUE on success.
43
gimp_brightness_contrast (gint32 drawable_ID,
47
GimpParam *return_vals;
49
gboolean success = TRUE;
51
return_vals = gimp_run_procedure ("gimp_brightness_contrast",
53
GIMP_PDB_DRAWABLE, drawable_ID,
54
GIMP_PDB_INT32, brightness,
55
GIMP_PDB_INT32, contrast,
58
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
60
gimp_destroy_params (return_vals, nreturn_vals);
67
* @drawable_ID: The drawable.
68
* @channel: The channel to modify.
69
* @low_input: Intensity of lowest input.
70
* @high_input: Intensity of highest input.
71
* @gamma: Gamma correction factor.
72
* @low_output: Intensity of lowest output.
73
* @high_output: Intensity of highest output.
75
* Modifies intensity levels in the specified drawable.
77
* This tool allows intensity levels in the specified drawable to be
78
* remapped according to a set of parameters. The low/high input levels
79
* specify an initial mapping from the source intensities. The gamma
80
* value determines how intensities between the low and high input
81
* intensities are interpolated. A gamma value of 1.0 results in a
82
* linear interpolation. Higher gamma values result in more high-level
83
* intensities. Lower gamma values result in more low-level
84
* intensities. The low/high output levels constrain the final
85
* intensity mapping--that is, no final intensity will be lower than
86
* the low output level and no final intensity will be higher than the
87
* high output level. This tool is only valid on RGB color and
88
* grayscale images. It will not operate on indexed drawables.
90
* Returns: TRUE on success.
93
gimp_levels (gint32 drawable_ID,
94
GimpHistogramChannel channel,
101
GimpParam *return_vals;
103
gboolean success = TRUE;
105
return_vals = gimp_run_procedure ("gimp_levels",
107
GIMP_PDB_DRAWABLE, drawable_ID,
108
GIMP_PDB_INT32, channel,
109
GIMP_PDB_INT32, low_input,
110
GIMP_PDB_INT32, high_input,
111
GIMP_PDB_FLOAT, gamma,
112
GIMP_PDB_INT32, low_output,
113
GIMP_PDB_INT32, high_output,
116
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
118
gimp_destroy_params (return_vals, nreturn_vals);
125
* @drawable_ID: The drawable.
127
* This procedure is deprecated! Use gimp_levels_stretch() instead.
129
* Returns: TRUE on success.
132
gimp_levels_auto (gint32 drawable_ID)
134
GimpParam *return_vals;
136
gboolean success = TRUE;
138
return_vals = gimp_run_procedure ("gimp_levels_auto",
140
GIMP_PDB_DRAWABLE, drawable_ID,
143
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
145
gimp_destroy_params (return_vals, nreturn_vals);
151
* gimp_levels_stretch:
152
* @drawable_ID: The drawable.
154
* Automatically modifies intensity levels in the specified drawable.
156
* This procedure allows intensity levels in the specified drawable to
157
* be remapped according to a set of guessed parameters. It is
158
* equivalent to clicking the \"Auto\" button in the Levels tool. This
159
* procedure is only valid on RGB color and grayscale images. It will
160
* not operate on indexed drawables.
162
* Returns: TRUE on success.
165
gimp_levels_stretch (gint32 drawable_ID)
167
GimpParam *return_vals;
169
gboolean success = TRUE;
171
return_vals = gimp_run_procedure ("gimp_levels_stretch",
173
GIMP_PDB_DRAWABLE, drawable_ID,
176
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
178
gimp_destroy_params (return_vals, nreturn_vals);
185
* @drawable_ID: The drawable.
186
* @levels: Levels of posterization.
188
* Posterize the specified drawable.
190
* This procedures reduces the number of shades allows in each
191
* intensity channel to the specified 'levels' parameter.
193
* Returns: TRUE on success.
196
gimp_posterize (gint32 drawable_ID,
199
GimpParam *return_vals;
201
gboolean success = TRUE;
203
return_vals = gimp_run_procedure ("gimp_posterize",
205
GIMP_PDB_DRAWABLE, drawable_ID,
206
GIMP_PDB_INT32, levels,
209
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
211
gimp_destroy_params (return_vals, nreturn_vals);
218
* @drawable_ID: The drawable.
220
* Desaturate the contents of the specified drawable.
222
* This procedure desaturates the contents of the specified drawable.
223
* This procedure only works on drawables of type RGB color.
225
* Returns: TRUE on success.
228
gimp_desaturate (gint32 drawable_ID)
230
GimpParam *return_vals;
232
gboolean success = TRUE;
234
return_vals = gimp_run_procedure ("gimp_desaturate",
236
GIMP_PDB_DRAWABLE, drawable_ID,
239
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
241
gimp_destroy_params (return_vals, nreturn_vals);
248
* @drawable_ID: The drawable.
249
* @mask_only: Equalization option.
251
* Equalize the contents of the specified drawable.
253
* This procedure equalizes the contents of the specified drawable.
254
* Each intensity channel is equalizeed independently. The equalized
255
* intensity is given as inten' = (255 - inten). Indexed color
256
* drawables are not valid for this operation. The 'mask_only' option
257
* specifies whether to adjust only the area of the image within the
258
* selection bounds, or the entire image based on the histogram of the
259
* selected area. If there is no selection, the entire image is
260
* adjusted based on the histogram for the entire image.
262
* Returns: TRUE on success.
265
gimp_equalize (gint32 drawable_ID,
268
GimpParam *return_vals;
270
gboolean success = TRUE;
272
return_vals = gimp_run_procedure ("gimp_equalize",
274
GIMP_PDB_DRAWABLE, drawable_ID,
275
GIMP_PDB_INT32, mask_only,
278
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
280
gimp_destroy_params (return_vals, nreturn_vals);
287
* @drawable_ID: The drawable.
289
* Invert the contents of the specified drawable.
291
* This procedure inverts the contents of the specified drawable. Each
292
* intensity channel is inverted independently. The inverted intensity
293
* is given as inten' = (255 - inten). Indexed color drawables are not
294
* valid for this operation.
296
* Returns: TRUE on success.
299
gimp_invert (gint32 drawable_ID)
301
GimpParam *return_vals;
303
gboolean success = TRUE;
305
return_vals = gimp_run_procedure ("gimp_invert",
307
GIMP_PDB_DRAWABLE, drawable_ID,
310
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
312
gimp_destroy_params (return_vals, nreturn_vals);
318
* gimp_curves_spline:
319
* @drawable_ID: The drawable.
320
* @channel: The channel to modify.
321
* @num_points: The number of values in the control point array.
322
* @control_pts: The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }.
324
* Modifies the intensity curve(s) for specified drawable.
326
* Modifies the intensity mapping for one channel in the specified
327
* drawable. The drawable must be either grayscale or RGB, and the
328
* channel can be either an intensity component, or the value. The
329
* 'control_pts' parameter is an array of integers which define a set
330
* of control points which describe a Catmull Rom spline which yields
331
* the final intensity curve. Use the 'gimp_curves_explicit' function
332
* to explicitly modify intensity levels.
334
* Returns: TRUE on success.
337
gimp_curves_spline (gint32 drawable_ID,
338
GimpHistogramChannel channel,
340
const guint8 *control_pts)
342
GimpParam *return_vals;
344
gboolean success = TRUE;
346
return_vals = gimp_run_procedure ("gimp_curves_spline",
348
GIMP_PDB_DRAWABLE, drawable_ID,
349
GIMP_PDB_INT32, channel,
350
GIMP_PDB_INT32, num_points,
351
GIMP_PDB_INT8ARRAY, control_pts,
354
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
356
gimp_destroy_params (return_vals, nreturn_vals);
362
* gimp_curves_explicit:
363
* @drawable_ID: The drawable.
364
* @channel: The channel to modify.
365
* @num_bytes: The number of bytes in the new curve (always 256).
366
* @curve: The explicit curve.
368
* Modifies the intensity curve(s) for specified drawable.
370
* Modifies the intensity mapping for one channel in the specified
371
* drawable. The drawable must be either grayscale or RGB, and the
372
* channel can be either an intensity component, or the value. The
373
* 'curve' parameter is an array of bytes which explicitly defines how
374
* each pixel value in the drawable will be modified. Use the
375
* 'gimp_curves_spline' function to modify intensity levels with
376
* Catmull Rom splines.
378
* Returns: TRUE on success.
381
gimp_curves_explicit (gint32 drawable_ID,
382
GimpHistogramChannel channel,
386
GimpParam *return_vals;
388
gboolean success = TRUE;
390
return_vals = gimp_run_procedure ("gimp_curves_explicit",
392
GIMP_PDB_DRAWABLE, drawable_ID,
393
GIMP_PDB_INT32, channel,
394
GIMP_PDB_INT32, num_bytes,
395
GIMP_PDB_INT8ARRAY, curve,
398
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
400
gimp_destroy_params (return_vals, nreturn_vals);
406
* gimp_color_balance:
407
* @drawable_ID: The drawable.
408
* @transfer_mode: Transfer mode.
409
* @preserve_lum: Preserve luminosity values at each pixel.
410
* @cyan_red: Cyan-Red color balance.
411
* @magenta_green: Magenta-Green color balance.
412
* @yellow_blue: Yellow-Blue color balance.
414
* Modify the color balance of the specified drawable.
416
* Modify the color balance of the specified drawable. There are three
417
* axis which can be modified: cyan-red, magenta-green, and
418
* yellow-blue. Negative values increase the amount of the former,
419
* positive values increase the amount of the latter. Color balance can
420
* be controlled with the 'transfer_mode' setting, which allows
421
* shadows, midtones, and highlights in an image to be affected
422
* differently. The 'preserve_lum' parameter, if non-zero, ensures that
423
* the luminosity of each pixel remains fixed.
425
* Returns: TRUE on success.
428
gimp_color_balance (gint32 drawable_ID,
429
GimpTransferMode transfer_mode,
430
gboolean preserve_lum,
432
gdouble magenta_green,
435
GimpParam *return_vals;
437
gboolean success = TRUE;
439
return_vals = gimp_run_procedure ("gimp_color_balance",
441
GIMP_PDB_DRAWABLE, drawable_ID,
442
GIMP_PDB_INT32, transfer_mode,
443
GIMP_PDB_INT32, preserve_lum,
444
GIMP_PDB_FLOAT, cyan_red,
445
GIMP_PDB_FLOAT, magenta_green,
446
GIMP_PDB_FLOAT, yellow_blue,
449
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
451
gimp_destroy_params (return_vals, nreturn_vals);
458
* @drawable_ID: The drawable.
459
* @hue: Hue in degrees.
460
* @saturation: Saturation in percent.
461
* @lightness: Lightness in percent.
463
* Render the drawable as a grayscale image seen through a colored
466
* Desatures the drawable, then tints it with the specified color. This
467
* tool is only valid on RGB color images. It will not operate on
468
* grayscale or indexed drawables.
470
* Returns: TRUE on success.
475
gimp_colorize (gint32 drawable_ID,
480
GimpParam *return_vals;
482
gboolean success = TRUE;
484
return_vals = gimp_run_procedure ("gimp_colorize",
486
GIMP_PDB_DRAWABLE, drawable_ID,
488
GIMP_PDB_FLOAT, saturation,
489
GIMP_PDB_FLOAT, lightness,
492
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
494
gimp_destroy_params (return_vals, nreturn_vals);
501
* @drawable_ID: The drawable.
502
* @channel: The channel to modify.
503
* @start_range: Start of the intensity measurement range.
504
* @end_range: End of the intensity measurement range.
505
* @mean: Mean intensity value.
506
* @std_dev: Standard deviation of intensity values.
507
* @median: Median intensity value.
508
* @pixels: Alpha-weighted pixel count for entire image.
509
* @count: Alpha-weighted pixel count for range.
510
* @percentile: Percentile that range falls under.
512
* Returns information on the intensity histogram for the specified
515
* This tool makes it possible to gather information about the
516
* intensity histogram of a drawable. A channel to examine is first
517
* specified. This can be either value, red, green, or blue, depending
518
* on whether the drawable is of type color or grayscale. The drawable
519
* may not be indexed. Second, a range of intensities are specified.
520
* The gimp_histogram function returns statistics based on the pixels
521
* in the drawable that fall under this range of values. Mean, standard
522
* deviation, median, number of pixels, and percentile are all
523
* returned. Additionally, the total count of pixels in the image is
524
* returned. Counts of pixels are weighted by any associated alpha
525
* values and by the current selection mask. That is, pixels that lie
526
* outside an active selection mask will not be counted. Similarly,
527
* pixels with transparent alpha values will not be counted.
529
* Returns: TRUE on success.
532
gimp_histogram (gint32 drawable_ID,
533
GimpHistogramChannel channel,
543
GimpParam *return_vals;
545
gboolean success = TRUE;
547
return_vals = gimp_run_procedure ("gimp_histogram",
549
GIMP_PDB_DRAWABLE, drawable_ID,
550
GIMP_PDB_INT32, channel,
551
GIMP_PDB_INT32, start_range,
552
GIMP_PDB_INT32, end_range,
562
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
566
*mean = return_vals[1].data.d_float;
567
*std_dev = return_vals[2].data.d_float;
568
*median = return_vals[3].data.d_float;
569
*pixels = return_vals[4].data.d_float;
570
*count = return_vals[5].data.d_float;
571
*percentile = return_vals[6].data.d_float;
574
gimp_destroy_params (return_vals, nreturn_vals);
580
* gimp_hue_saturation:
581
* @drawable_ID: The drawable.
582
* @hue_range: Range of affected hues.
583
* @hue_offset: Hue offset in degrees.
584
* @lightness: lightness modification.
585
* @saturation: saturation modification.
587
* Modify hue, lightness, and saturation in the specified drawable.
589
* This procedures allows the hue, lightness, and saturation in the
590
* specified drawable to be modified. The 'hue_range' parameter
591
* provides the capability to limit range of affected hues.
593
* Returns: TRUE on success.
596
gimp_hue_saturation (gint32 drawable_ID,
597
GimpHueRange hue_range,
602
GimpParam *return_vals;
604
gboolean success = TRUE;
606
return_vals = gimp_run_procedure ("gimp_hue_saturation",
608
GIMP_PDB_DRAWABLE, drawable_ID,
609
GIMP_PDB_INT32, hue_range,
610
GIMP_PDB_FLOAT, hue_offset,
611
GIMP_PDB_FLOAT, lightness,
612
GIMP_PDB_FLOAT, saturation,
615
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
617
gimp_destroy_params (return_vals, nreturn_vals);
624
* @drawable_ID: The drawable.
625
* @low_threshold: The low threshold value.
626
* @high_threshold: The high threshold value.
628
* Threshold the specified drawable.
630
* This procedures generates a threshold map of the specified drawable.
631
* All pixels between the values of 'low_threshold' and
632
* 'high_threshold' are replaced with white, and all other pixels with
635
* Returns: TRUE on success.
638
gimp_threshold (gint32 drawable_ID,
642
GimpParam *return_vals;
644
gboolean success = TRUE;
646
return_vals = gimp_run_procedure ("gimp_threshold",
648
GIMP_PDB_DRAWABLE, drawable_ID,
649
GIMP_PDB_INT32, low_threshold,
650
GIMP_PDB_INT32, high_threshold,
653
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
655
gimp_destroy_params (return_vals, nreturn_vals);