1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
/* NOTE: This file is auto-generated by pdbgen.pl. */
24
#include <glib-object.h>
26
#include "pdb-types.h"
28
#include "gimpprocedure.h"
29
#include "core/gimpparamspecs.h"
31
#include "base/color-balance.h"
32
#include "base/colorize.h"
33
#include "base/curves.h"
34
#include "base/gimphistogram.h"
35
#include "base/gimplut.h"
36
#include "base/hue-saturation.h"
37
#include "base/levels.h"
38
#include "base/lut-funcs.h"
39
#include "base/pixel-processor.h"
40
#include "base/pixel-region.h"
41
#include "base/threshold.h"
42
#include "core/gimp.h"
43
#include "core/gimpdrawable-desaturate.h"
44
#include "core/gimpdrawable-equalize.h"
45
#include "core/gimpdrawable-histogram.h"
46
#include "core/gimpdrawable-invert.h"
47
#include "core/gimpdrawable-levels.h"
48
#include "core/gimpdrawable.h"
49
#include "core/gimpimage.h"
50
#include "gimp-intl.h"
52
#include "internal_procs.h"
56
brightness_contrast_invoker (GimpProcedure *procedure,
59
GimpProgress *progress,
60
const GValueArray *args)
62
gboolean success = TRUE;
63
GimpDrawable *drawable;
67
drawable = gimp_value_get_drawable (&args->values[0], gimp);
68
brightness = g_value_get_int (&args->values[1]);
69
contrast = g_value_get_int (&args->values[2]);
73
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
74
gimp_drawable_is_indexed (drawable))
79
gint x, y, width, height;
81
/* The application should occur only within selection bounds */
82
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
85
PixelRegion srcPR, destPR;
87
lut = brightness_contrast_lut_new (brightness / 255.0,
89
gimp_drawable_bytes (drawable));
91
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
92
x, y, width, height, FALSE);
93
pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable),
94
x, y, width, height, TRUE);
96
pixel_regions_process_parallel ((PixelProcessorFunc)
98
lut, 2, &srcPR, &destPR);
102
gimp_drawable_merge_shadow (drawable, TRUE, _("Brightness-Contrast"));
103
gimp_drawable_update (drawable, x, y, width, height);
108
return gimp_procedure_get_return_values (procedure, success);
112
levels_invoker (GimpProcedure *procedure,
114
GimpContext *context,
115
GimpProgress *progress,
116
const GValueArray *args)
118
gboolean success = TRUE;
119
GimpDrawable *drawable;
127
drawable = gimp_value_get_drawable (&args->values[0], gimp);
128
channel = g_value_get_enum (&args->values[1]);
129
low_input = g_value_get_int (&args->values[2]);
130
high_input = g_value_get_int (&args->values[3]);
131
gamma = g_value_get_double (&args->values[4]);
132
low_output = g_value_get_int (&args->values[5]);
133
high_output = g_value_get_int (&args->values[6]);
137
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
138
gimp_drawable_is_indexed (drawable) ||
139
(! gimp_drawable_has_alpha (drawable) &&
140
channel == GIMP_HISTOGRAM_ALPHA) ||
141
(gimp_drawable_is_gray (drawable) &&
142
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
146
gimp_drawable_levels (drawable, context,
148
low_input, high_input,
150
low_output, high_output);
153
return gimp_procedure_get_return_values (procedure, success);
157
levels_auto_invoker (GimpProcedure *procedure,
159
GimpContext *context,
160
GimpProgress *progress,
161
const GValueArray *args)
163
gboolean success = TRUE;
164
GimpDrawable *drawable;
166
drawable = gimp_value_get_drawable (&args->values[0], gimp);
170
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
171
gimp_drawable_is_indexed (drawable))
175
gimp_drawable_levels_stretch (drawable, context);
178
return gimp_procedure_get_return_values (procedure, success);
182
levels_stretch_invoker (GimpProcedure *procedure,
184
GimpContext *context,
185
GimpProgress *progress,
186
const GValueArray *args)
188
gboolean success = TRUE;
189
GimpDrawable *drawable;
191
drawable = gimp_value_get_drawable (&args->values[0], gimp);
195
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
196
gimp_drawable_is_indexed (drawable))
200
gimp_drawable_levels_stretch (drawable, context);
203
return gimp_procedure_get_return_values (procedure, success);
207
posterize_invoker (GimpProcedure *procedure,
209
GimpContext *context,
210
GimpProgress *progress,
211
const GValueArray *args)
213
gboolean success = TRUE;
214
GimpDrawable *drawable;
217
drawable = gimp_value_get_drawable (&args->values[0], gimp);
218
levels = g_value_get_int (&args->values[1]);
222
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
223
gimp_drawable_is_indexed (drawable))
228
gint x, y, width, height;
230
/* The application should occur only within selection bounds */
231
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
234
PixelRegion srcPR, destPR;
236
lut = posterize_lut_new (levels, gimp_drawable_bytes (drawable));
238
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
239
x, y, width, height, FALSE);
240
pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable),
241
x, y, width, height, TRUE);
243
pixel_regions_process_parallel ((PixelProcessorFunc)
245
lut, 2, &srcPR, &destPR);
249
gimp_drawable_merge_shadow (drawable, TRUE, _("Posterize"));
250
gimp_drawable_update (drawable, x, y, width, height);
255
return gimp_procedure_get_return_values (procedure, success);
259
desaturate_invoker (GimpProcedure *procedure,
261
GimpContext *context,
262
GimpProgress *progress,
263
const GValueArray *args)
265
gboolean success = TRUE;
266
GimpDrawable *drawable;
268
drawable = gimp_value_get_drawable (&args->values[0], gimp);
272
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
273
! gimp_drawable_is_rgb (drawable))
277
gimp_drawable_desaturate (drawable, GIMP_DESATURATE_LIGHTNESS);
280
return gimp_procedure_get_return_values (procedure, success);
284
desaturate_full_invoker (GimpProcedure *procedure,
286
GimpContext *context,
287
GimpProgress *progress,
288
const GValueArray *args)
290
gboolean success = TRUE;
291
GimpDrawable *drawable;
292
gint32 desaturate_mode;
294
drawable = gimp_value_get_drawable (&args->values[0], gimp);
295
desaturate_mode = g_value_get_enum (&args->values[1]);
299
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
300
! gimp_drawable_is_rgb (drawable))
304
gimp_drawable_desaturate (drawable, desaturate_mode);
307
return gimp_procedure_get_return_values (procedure, success);
311
equalize_invoker (GimpProcedure *procedure,
313
GimpContext *context,
314
GimpProgress *progress,
315
const GValueArray *args)
317
gboolean success = TRUE;
318
GimpDrawable *drawable;
321
drawable = gimp_value_get_drawable (&args->values[0], gimp);
322
mask_only = g_value_get_boolean (&args->values[1]);
326
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
327
gimp_drawable_is_indexed (drawable))
331
gimp_drawable_equalize (drawable, mask_only);
334
return gimp_procedure_get_return_values (procedure, success);
338
invert_invoker (GimpProcedure *procedure,
340
GimpContext *context,
341
GimpProgress *progress,
342
const GValueArray *args)
344
gboolean success = TRUE;
345
GimpDrawable *drawable;
347
drawable = gimp_value_get_drawable (&args->values[0], gimp);
351
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
352
gimp_drawable_is_indexed (drawable))
356
gimp_drawable_invert (drawable);
359
return gimp_procedure_get_return_values (procedure, success);
363
curves_spline_invoker (GimpProcedure *procedure,
365
GimpContext *context,
366
GimpProgress *progress,
367
const GValueArray *args)
369
gboolean success = TRUE;
370
GimpDrawable *drawable;
373
const guint8 *control_pts;
375
drawable = gimp_value_get_drawable (&args->values[0], gimp);
376
channel = g_value_get_enum (&args->values[1]);
377
num_points = g_value_get_int (&args->values[2]);
378
control_pts = gimp_value_get_int8array (&args->values[3]);
382
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
383
gimp_drawable_is_indexed (drawable) || (num_points & 1) ||
384
(! gimp_drawable_has_alpha (drawable) &&
385
channel == GIMP_HISTOGRAM_ALPHA) ||
386
(gimp_drawable_is_gray (drawable) &&
387
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
392
gint x, y, width, height;
394
/* The application should occur only within selection bounds */
395
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
399
PixelRegion srcPR, destPR;
403
if (gimp_drawable_is_gray (drawable) &&
404
channel == GIMP_HISTOGRAM_ALPHA)
407
lut = gimp_lut_new ();
411
/* unset the last point */
412
c.points[channel][CURVES_NUM_POINTS - 1][0] = -1;
413
c.points[channel][CURVES_NUM_POINTS - 1][1] = -1;
415
for (j = 0; j < num_points / 2; j++)
417
c.points[channel][j][0] = control_pts[j * 2];
418
c.points[channel][j][1] = control_pts[j * 2 + 1];
421
curves_calculate_curve (&c, channel);
424
(GimpLutFunc) curves_lut_func,
426
gimp_drawable_bytes (drawable));
428
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
429
x, y, width, height, FALSE);
430
pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable),
431
x, y, width, height, TRUE);
433
pixel_regions_process_parallel ((PixelProcessorFunc)
435
lut, 2, &srcPR, &destPR);
439
gimp_drawable_merge_shadow (drawable, TRUE, _("Curves"));
440
gimp_drawable_update (drawable, x, y, width, height);
445
return gimp_procedure_get_return_values (procedure, success);
449
curves_explicit_invoker (GimpProcedure *procedure,
451
GimpContext *context,
452
GimpProgress *progress,
453
const GValueArray *args)
455
gboolean success = TRUE;
456
GimpDrawable *drawable;
461
drawable = gimp_value_get_drawable (&args->values[0], gimp);
462
channel = g_value_get_enum (&args->values[1]);
463
num_bytes = g_value_get_int (&args->values[2]);
464
curve = gimp_value_get_int8array (&args->values[3]);
468
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
469
gimp_drawable_is_indexed (drawable) || (num_bytes != 256) ||
470
(! gimp_drawable_has_alpha (drawable) &&
471
channel == GIMP_HISTOGRAM_ALPHA) ||
472
(gimp_drawable_is_gray (drawable) &&
473
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
478
gint x, y, width, height;
480
/* The application should occur only within selection bounds */
481
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
485
PixelRegion srcPR, destPR;
489
if (gimp_drawable_is_gray (drawable) &&
490
channel == GIMP_HISTOGRAM_ALPHA)
493
lut = gimp_lut_new ();
497
for (j = 0; j < 256; j++)
498
c.curve[channel][j] = curve[j];
501
(GimpLutFunc) curves_lut_func,
503
gimp_drawable_bytes (drawable));
505
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
506
x, y, width, height, FALSE);
507
pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable),
508
x, y, width, height, TRUE);
510
pixel_regions_process_parallel ((PixelProcessorFunc)
512
lut, 2, &srcPR, &destPR);
516
gimp_drawable_merge_shadow (drawable, TRUE, _("Curves"));
517
gimp_drawable_update (drawable, x, y, width, height);
522
return gimp_procedure_get_return_values (procedure, success);
526
color_balance_invoker (GimpProcedure *procedure,
528
GimpContext *context,
529
GimpProgress *progress,
530
const GValueArray *args)
532
gboolean success = TRUE;
533
GimpDrawable *drawable;
534
gint32 transfer_mode;
535
gboolean preserve_lum;
537
gdouble magenta_green;
540
drawable = gimp_value_get_drawable (&args->values[0], gimp);
541
transfer_mode = g_value_get_enum (&args->values[1]);
542
preserve_lum = g_value_get_boolean (&args->values[2]);
543
cyan_red = g_value_get_double (&args->values[3]);
544
magenta_green = g_value_get_double (&args->values[4]);
545
yellow_blue = g_value_get_double (&args->values[5]);
549
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
550
gimp_drawable_is_indexed (drawable))
555
gint x, y, width, height;
557
/* The application should occur only within selection bounds */
558
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
561
PixelRegion srcPR, destPR;
563
color_balance_init (&cb);
565
cb.preserve_luminosity = preserve_lum;
567
cb.cyan_red[transfer_mode] = cyan_red;
568
cb.magenta_green[transfer_mode] = magenta_green;
569
cb.yellow_blue[transfer_mode] = yellow_blue;
571
color_balance_create_lookup_tables (&cb);
573
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
574
x, y, width, height, FALSE);
575
pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable),
576
x, y, width, height, TRUE);
578
pixel_regions_process_parallel ((PixelProcessorFunc) color_balance,
579
&cb, 2, &srcPR, &destPR);
581
gimp_drawable_merge_shadow (drawable, TRUE, _("Color Balance"));
582
gimp_drawable_update (drawable, x, y, width, height);
587
return gimp_procedure_get_return_values (procedure, success);
591
colorize_invoker (GimpProcedure *procedure,
593
GimpContext *context,
594
GimpProgress *progress,
595
const GValueArray *args)
597
gboolean success = TRUE;
598
GimpDrawable *drawable;
603
drawable = gimp_value_get_drawable (&args->values[0], gimp);
604
hue = g_value_get_double (&args->values[1]);
605
saturation = g_value_get_double (&args->values[2]);
606
lightness = g_value_get_double (&args->values[3]);
610
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
611
! gimp_drawable_is_rgb (drawable))
616
gint x, y, width, height;
618
/* The application should occur only within selection bounds */
619
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
622
PixelRegion srcPR, destPR;
624
colorize_init (&colors);
627
colors.saturation = saturation;
628
colors.lightness = lightness;
630
colorize_calculate (&colors);
632
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
633
x, y, width, height, FALSE);
634
pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable),
635
x, y, width, height, TRUE);
637
pixel_regions_process_parallel ((PixelProcessorFunc) colorize,
638
&colors, 2, &srcPR, &destPR);
640
gimp_drawable_merge_shadow (drawable, TRUE, _("Colorize"));
641
gimp_drawable_update (drawable, x, y, width, height);
646
return gimp_procedure_get_return_values (procedure, success);
650
histogram_invoker (GimpProcedure *procedure,
652
GimpContext *context,
653
GimpProgress *progress,
654
const GValueArray *args)
656
gboolean success = TRUE;
657
GValueArray *return_vals;
658
GimpDrawable *drawable;
663
gdouble std_dev = 0.0;
664
gdouble median = 0.0;
665
gdouble pixels = 0.0;
667
gdouble percentile = 0.0;
669
drawable = gimp_value_get_drawable (&args->values[0], gimp);
670
channel = g_value_get_enum (&args->values[1]);
671
start_range = g_value_get_int (&args->values[2]);
672
end_range = g_value_get_int (&args->values[3]);
676
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
677
gimp_drawable_is_indexed (drawable) ||
678
(! gimp_drawable_has_alpha (drawable) &&
679
channel == GIMP_HISTOGRAM_ALPHA) ||
680
(gimp_drawable_is_gray (drawable) &&
681
channel != GIMP_HISTOGRAM_VALUE && channel != GIMP_HISTOGRAM_ALPHA))
686
GimpHistogram *histogram = gimp_histogram_new ();
688
gimp_drawable_calculate_histogram (drawable, histogram);
690
mean = gimp_histogram_get_mean (histogram, channel,
691
start_range, end_range);
692
std_dev = gimp_histogram_get_std_dev (histogram, channel,
693
start_range, end_range);
694
median = gimp_histogram_get_median (histogram, channel,
695
start_range, end_range);
696
pixels = gimp_histogram_get_count (histogram, channel, 0, 255);
697
count = gimp_histogram_get_count (histogram, channel,
698
start_range, end_range);
699
percentile = count / pixels;
701
gimp_histogram_free (histogram);
705
return_vals = gimp_procedure_get_return_values (procedure, success);
709
g_value_set_double (&return_vals->values[1], mean);
710
g_value_set_double (&return_vals->values[2], std_dev);
711
g_value_set_double (&return_vals->values[3], median);
712
g_value_set_double (&return_vals->values[4], pixels);
713
g_value_set_double (&return_vals->values[5], count);
714
g_value_set_double (&return_vals->values[6], percentile);
721
hue_saturation_invoker (GimpProcedure *procedure,
723
GimpContext *context,
724
GimpProgress *progress,
725
const GValueArray *args)
727
gboolean success = TRUE;
728
GimpDrawable *drawable;
734
drawable = gimp_value_get_drawable (&args->values[0], gimp);
735
hue_range = g_value_get_enum (&args->values[1]);
736
hue_offset = g_value_get_double (&args->values[2]);
737
lightness = g_value_get_double (&args->values[3]);
738
saturation = g_value_get_double (&args->values[4]);
742
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
743
gimp_drawable_is_indexed (drawable))
748
gint x, y, width, height;
750
/* The application should occur only within selection bounds */
751
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
754
PixelRegion srcPR, destPR;
756
hue_saturation_init (&hs);
758
hs.hue[hue_range] = hue_offset;
759
hs.lightness[hue_range] = lightness;
760
hs.saturation[hue_range] = saturation;
762
/* Calculate the transfer arrays */
763
hue_saturation_calculate_transfers (&hs);
765
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
766
x, y, width, height, FALSE);
767
pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable),
768
x, y, width, height, TRUE);
770
pixel_regions_process_parallel ((PixelProcessorFunc) hue_saturation,
771
&hs, 2, &srcPR, &destPR);
773
gimp_drawable_merge_shadow (drawable, TRUE, _("Hue-Saturation"));
774
gimp_drawable_update (drawable, x, y, width, height);
779
return gimp_procedure_get_return_values (procedure, success);
783
threshold_invoker (GimpProcedure *procedure,
785
GimpContext *context,
786
GimpProgress *progress,
787
const GValueArray *args)
789
gboolean success = TRUE;
790
GimpDrawable *drawable;
791
gint32 low_threshold;
792
gint32 high_threshold;
794
drawable = gimp_value_get_drawable (&args->values[0], gimp);
795
low_threshold = g_value_get_int (&args->values[1]);
796
high_threshold = g_value_get_int (&args->values[2]);
800
if (! gimp_item_is_attached (GIMP_ITEM (drawable)) ||
801
gimp_drawable_is_indexed (drawable) ||
802
(low_threshold > high_threshold))
807
gint x, y, width, height;
809
/* The application should occur only within selection bounds */
810
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height))
813
PixelRegion srcPR, destPR;
815
tr.color = gimp_drawable_is_rgb (drawable);
816
tr.low_threshold = low_threshold;
817
tr.high_threshold = high_threshold;
819
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
820
x, y, width, height, FALSE);
821
pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable),
822
x, y, width, height, TRUE);
824
pixel_regions_process_parallel ((PixelProcessorFunc) threshold,
825
&tr, 2, &srcPR, &destPR);
827
gimp_drawable_merge_shadow (drawable, TRUE, _("Threshold"));
828
gimp_drawable_update (drawable, x, y, width, height);
833
return gimp_procedure_get_return_values (procedure, success);
837
register_color_procs (GimpPDB *pdb)
839
GimpProcedure *procedure;
842
* gimp-brightness-contrast
844
procedure = gimp_procedure_new (brightness_contrast_invoker);
845
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-brightness-contrast");
846
gimp_procedure_set_static_strings (procedure,
847
"gimp-brightness-contrast",
848
"Modify brightness/contrast in the specified drawable.",
849
"This procedures allows the brightness and contrast of the specified drawable to be modified. Both 'brightness' and 'contrast' parameters are defined between -127 and 127.",
850
"Spencer Kimball & Peter Mattis",
851
"Spencer Kimball & Peter Mattis",
854
gimp_procedure_add_argument (procedure,
855
gimp_param_spec_drawable_id ("drawable",
859
GIMP_PARAM_READWRITE));
860
gimp_procedure_add_argument (procedure,
861
gimp_param_spec_int32 ("brightness",
863
"Brightness adjustment",
865
GIMP_PARAM_READWRITE));
866
gimp_procedure_add_argument (procedure,
867
gimp_param_spec_int32 ("contrast",
869
"Contrast adjustment",
871
GIMP_PARAM_READWRITE));
872
gimp_pdb_register_procedure (pdb, procedure);
873
g_object_unref (procedure);
878
procedure = gimp_procedure_new (levels_invoker);
879
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-levels");
880
gimp_procedure_set_static_strings (procedure,
882
"Modifies intensity levels in the specified drawable.",
883
"This tool allows intensity levels in the specified drawable to be remapped according to a set of parameters. The low/high input levels specify an initial mapping from the source intensities. The gamma value determines how intensities between the low and high input intensities are interpolated. A gamma value of 1.0 results in a linear interpolation. Higher gamma values result in more high-level intensities. Lower gamma values result in more low-level intensities. The low/high output levels constrain the final intensity mapping--that is, no final intensity will be lower than the low output level and no final intensity will be higher than the high output level. This tool is only valid on RGB color and grayscale images. It will not operate on indexed drawables.",
884
"Spencer Kimball & Peter Mattis",
885
"Spencer Kimball & Peter Mattis",
888
gimp_procedure_add_argument (procedure,
889
gimp_param_spec_drawable_id ("drawable",
893
GIMP_PARAM_READWRITE));
894
gimp_procedure_add_argument (procedure,
895
g_param_spec_enum ("channel",
897
"The channel to modify",
898
GIMP_TYPE_HISTOGRAM_CHANNEL,
899
GIMP_HISTOGRAM_VALUE,
900
GIMP_PARAM_READWRITE));
901
gimp_procedure_add_argument (procedure,
902
gimp_param_spec_int32 ("low-input",
904
"Intensity of lowest input",
906
GIMP_PARAM_READWRITE));
907
gimp_procedure_add_argument (procedure,
908
gimp_param_spec_int32 ("high-input",
910
"Intensity of highest input",
912
GIMP_PARAM_READWRITE));
913
gimp_procedure_add_argument (procedure,
914
g_param_spec_double ("gamma",
916
"Gamma correction factor",
918
GIMP_PARAM_READWRITE));
919
gimp_procedure_add_argument (procedure,
920
gimp_param_spec_int32 ("low-output",
922
"Intensity of lowest output",
924
GIMP_PARAM_READWRITE));
925
gimp_procedure_add_argument (procedure,
926
gimp_param_spec_int32 ("high-output",
928
"Intensity of highest output",
930
GIMP_PARAM_READWRITE));
931
gimp_pdb_register_procedure (pdb, procedure);
932
g_object_unref (procedure);
937
procedure = gimp_procedure_new (levels_auto_invoker);
938
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-levels-auto");
939
gimp_procedure_set_static_strings (procedure,
941
"This procedure is deprecated! Use 'gimp-levels-stretch' instead.",
942
"This procedure is deprecated! Use 'gimp-levels-stretch' instead.",
946
"gimp-levels-stretch");
947
gimp_procedure_add_argument (procedure,
948
gimp_param_spec_drawable_id ("drawable",
952
GIMP_PARAM_READWRITE));
953
gimp_pdb_register_procedure (pdb, procedure);
954
g_object_unref (procedure);
957
* gimp-levels-stretch
959
procedure = gimp_procedure_new (levels_stretch_invoker);
960
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-levels-stretch");
961
gimp_procedure_set_static_strings (procedure,
962
"gimp-levels-stretch",
963
"Automatically modifies intensity levels in the specified drawable.",
964
"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.",
965
"Joao S.O. Bueno, Shawn Willden",
966
"Joao S.O. Bueno, Shawn Willden",
969
gimp_procedure_add_argument (procedure,
970
gimp_param_spec_drawable_id ("drawable",
974
GIMP_PARAM_READWRITE));
975
gimp_pdb_register_procedure (pdb, procedure);
976
g_object_unref (procedure);
981
procedure = gimp_procedure_new (posterize_invoker);
982
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-posterize");
983
gimp_procedure_set_static_strings (procedure,
985
"Posterize the specified drawable.",
986
"This procedures reduces the number of shades allows in each intensity channel to the specified 'levels' parameter.",
987
"Spencer Kimball & Peter Mattis",
988
"Spencer Kimball & Peter Mattis",
991
gimp_procedure_add_argument (procedure,
992
gimp_param_spec_drawable_id ("drawable",
996
GIMP_PARAM_READWRITE));
997
gimp_procedure_add_argument (procedure,
998
gimp_param_spec_int32 ("levels",
1000
"Levels of posterization",
1002
GIMP_PARAM_READWRITE));
1003
gimp_pdb_register_procedure (pdb, procedure);
1004
g_object_unref (procedure);
1009
procedure = gimp_procedure_new (desaturate_invoker);
1010
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-desaturate");
1011
gimp_procedure_set_static_strings (procedure,
1013
"Desaturate the contents of the specified drawable.",
1014
"This procedure desaturates the contents of the specified drawable. This procedure only works on drawables of type RGB color.",
1015
"Spencer Kimball & Peter Mattis",
1016
"Spencer Kimball & Peter Mattis",
1019
gimp_procedure_add_argument (procedure,
1020
gimp_param_spec_drawable_id ("drawable",
1024
GIMP_PARAM_READWRITE));
1025
gimp_pdb_register_procedure (pdb, procedure);
1026
g_object_unref (procedure);
1029
* gimp-desaturate-full
1031
procedure = gimp_procedure_new (desaturate_full_invoker);
1032
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-desaturate-full");
1033
gimp_procedure_set_static_strings (procedure,
1034
"gimp-desaturate-full",
1035
"Desaturate the contents of the specified drawable, with the specified formula.",
1036
"This procedure desaturates the contents of the specified drawable, with the specified formula. This procedure only works on drawables of type RGB color.",
1041
gimp_procedure_add_argument (procedure,
1042
gimp_param_spec_drawable_id ("drawable",
1046
GIMP_PARAM_READWRITE));
1047
gimp_procedure_add_argument (procedure,
1048
g_param_spec_enum ("desaturate-mode",
1050
"The formula to use to desaturate",
1051
GIMP_TYPE_DESATURATE_MODE,
1052
GIMP_DESATURATE_LIGHTNESS,
1053
GIMP_PARAM_READWRITE));
1054
gimp_pdb_register_procedure (pdb, procedure);
1055
g_object_unref (procedure);
1060
procedure = gimp_procedure_new (equalize_invoker);
1061
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-equalize");
1062
gimp_procedure_set_static_strings (procedure,
1064
"Equalize the contents of the specified drawable.",
1065
"This procedure equalizes the contents of the specified drawable. Each intensity channel is equalizeed independently. The equalized intensity is given as inten' = (255 - inten). Indexed color drawables are not valid for this operation. The 'mask_only' option specifies whether to adjust only the area of the image within the selection bounds, or the entire image based on the histogram of the selected area. If there is no selection, the entire image is adjusted based on the histogram for the entire image.",
1066
"Spencer Kimball & Peter Mattis",
1067
"Spencer Kimball & Peter Mattis",
1070
gimp_procedure_add_argument (procedure,
1071
gimp_param_spec_drawable_id ("drawable",
1075
GIMP_PARAM_READWRITE));
1076
gimp_procedure_add_argument (procedure,
1077
g_param_spec_boolean ("mask-only",
1079
"Equalization option",
1081
GIMP_PARAM_READWRITE));
1082
gimp_pdb_register_procedure (pdb, procedure);
1083
g_object_unref (procedure);
1088
procedure = gimp_procedure_new (invert_invoker);
1089
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-invert");
1090
gimp_procedure_set_static_strings (procedure,
1092
"Invert the contents of the specified drawable.",
1093
"This procedure inverts the contents of the specified drawable. Each intensity channel is inverted independently. The inverted intensity is given as inten' = (255 - inten). Indexed color drawables are not valid for this operation.",
1094
"Spencer Kimball & Peter Mattis",
1095
"Spencer Kimball & Peter Mattis",
1098
gimp_procedure_add_argument (procedure,
1099
gimp_param_spec_drawable_id ("drawable",
1103
GIMP_PARAM_READWRITE));
1104
gimp_pdb_register_procedure (pdb, procedure);
1105
g_object_unref (procedure);
1108
* gimp-curves-spline
1110
procedure = gimp_procedure_new (curves_spline_invoker);
1111
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-curves-spline");
1112
gimp_procedure_set_static_strings (procedure,
1113
"gimp-curves-spline",
1114
"Modifies the intensity curve(s) for specified drawable.",
1115
"Modifies the intensity mapping for one channel in the specified drawable. The drawable must be either grayscale or RGB, and the channel can be either an intensity component, or the value. The 'control_pts' parameter is an array of integers which define a set of control points which describe a Catmull Rom spline which yields the final intensity curve. Use the 'gimp-curves-explicit' function to explicitly modify intensity levels.",
1116
"Spencer Kimball & Peter Mattis",
1117
"Spencer Kimball & Peter Mattis",
1120
gimp_procedure_add_argument (procedure,
1121
gimp_param_spec_drawable_id ("drawable",
1125
GIMP_PARAM_READWRITE));
1126
gimp_procedure_add_argument (procedure,
1127
g_param_spec_enum ("channel",
1129
"The channel to modify",
1130
GIMP_TYPE_HISTOGRAM_CHANNEL,
1131
GIMP_HISTOGRAM_VALUE,
1132
GIMP_PARAM_READWRITE));
1133
gimp_procedure_add_argument (procedure,
1134
gimp_param_spec_int32 ("num-points",
1136
"The number of values in the control point array",
1138
GIMP_PARAM_READWRITE));
1139
gimp_procedure_add_argument (procedure,
1140
gimp_param_spec_int8_array ("control-pts",
1142
"The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }",
1143
GIMP_PARAM_READWRITE));
1144
gimp_pdb_register_procedure (pdb, procedure);
1145
g_object_unref (procedure);
1148
* gimp-curves-explicit
1150
procedure = gimp_procedure_new (curves_explicit_invoker);
1151
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-curves-explicit");
1152
gimp_procedure_set_static_strings (procedure,
1153
"gimp-curves-explicit",
1154
"Modifies the intensity curve(s) for specified drawable.",
1155
"Modifies the intensity mapping for one channel in the specified drawable. The drawable must be either grayscale or RGB, and the channel can be either an intensity component, or the value. The 'curve' parameter is an array of bytes which explicitly defines how each pixel value in the drawable will be modified. Use the 'gimp-curves-spline' function to modify intensity levels with Catmull Rom splines.",
1156
"Spencer Kimball & Peter Mattis",
1157
"Spencer Kimball & Peter Mattis",
1160
gimp_procedure_add_argument (procedure,
1161
gimp_param_spec_drawable_id ("drawable",
1165
GIMP_PARAM_READWRITE));
1166
gimp_procedure_add_argument (procedure,
1167
g_param_spec_enum ("channel",
1169
"The channel to modify",
1170
GIMP_TYPE_HISTOGRAM_CHANNEL,
1171
GIMP_HISTOGRAM_VALUE,
1172
GIMP_PARAM_READWRITE));
1173
gimp_procedure_add_argument (procedure,
1174
gimp_param_spec_int32 ("num-bytes",
1176
"The number of bytes in the new curve (always 256)",
1178
GIMP_PARAM_READWRITE));
1179
gimp_procedure_add_argument (procedure,
1180
gimp_param_spec_int8_array ("curve",
1182
"The explicit curve",
1183
GIMP_PARAM_READWRITE));
1184
gimp_pdb_register_procedure (pdb, procedure);
1185
g_object_unref (procedure);
1188
* gimp-color-balance
1190
procedure = gimp_procedure_new (color_balance_invoker);
1191
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-color-balance");
1192
gimp_procedure_set_static_strings (procedure,
1193
"gimp-color-balance",
1194
"Modify the color balance of the specified drawable.",
1195
"Modify the color balance of the specified drawable. There are three axis which can be modified: cyan-red, magenta-green, and yellow-blue. Negative values increase the amount of the former, positive values increase the amount of the latter. Color balance can be controlled with the 'transfer_mode' setting, which allows shadows, mid-tones, and highlights in an image to be affected differently. The 'preserve-lum' parameter, if TRUE, ensures that the luminosity of each pixel remains fixed.",
1196
"Spencer Kimball & Peter Mattis",
1197
"Spencer Kimball & Peter Mattis",
1200
gimp_procedure_add_argument (procedure,
1201
gimp_param_spec_drawable_id ("drawable",
1205
GIMP_PARAM_READWRITE));
1206
gimp_procedure_add_argument (procedure,
1207
g_param_spec_enum ("transfer-mode",
1210
GIMP_TYPE_TRANSFER_MODE,
1212
GIMP_PARAM_READWRITE));
1213
gimp_procedure_add_argument (procedure,
1214
g_param_spec_boolean ("preserve-lum",
1216
"Preserve luminosity values at each pixel",
1218
GIMP_PARAM_READWRITE));
1219
gimp_procedure_add_argument (procedure,
1220
g_param_spec_double ("cyan-red",
1222
"Cyan-Red color balance",
1224
GIMP_PARAM_READWRITE));
1225
gimp_procedure_add_argument (procedure,
1226
g_param_spec_double ("magenta-green",
1228
"Magenta-Green color balance",
1230
GIMP_PARAM_READWRITE));
1231
gimp_procedure_add_argument (procedure,
1232
g_param_spec_double ("yellow-blue",
1234
"Yellow-Blue color balance",
1236
GIMP_PARAM_READWRITE));
1237
gimp_pdb_register_procedure (pdb, procedure);
1238
g_object_unref (procedure);
1243
procedure = gimp_procedure_new (colorize_invoker);
1244
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-colorize");
1245
gimp_procedure_set_static_strings (procedure,
1247
"Render the drawable as a grayscale image seen through a colored glass.",
1248
"Desaturates the drawable, then tints it with the specified color. This tool is only valid on RGB color images. It will not operate on grayscale or indexed drawables.",
1249
"Sven Neumann <sven@gimp.org>",
1253
gimp_procedure_add_argument (procedure,
1254
gimp_param_spec_drawable_id ("drawable",
1258
GIMP_PARAM_READWRITE));
1259
gimp_procedure_add_argument (procedure,
1260
g_param_spec_double ("hue",
1264
GIMP_PARAM_READWRITE));
1265
gimp_procedure_add_argument (procedure,
1266
g_param_spec_double ("saturation",
1268
"Saturation in percent",
1270
GIMP_PARAM_READWRITE));
1271
gimp_procedure_add_argument (procedure,
1272
g_param_spec_double ("lightness",
1274
"Lightness in percent",
1276
GIMP_PARAM_READWRITE));
1277
gimp_pdb_register_procedure (pdb, procedure);
1278
g_object_unref (procedure);
1283
procedure = gimp_procedure_new (histogram_invoker);
1284
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-histogram");
1285
gimp_procedure_set_static_strings (procedure,
1287
"Returns information on the intensity histogram for the specified drawable.",
1288
"This tool makes it possible to gather information about the intensity histogram of a drawable. A channel to examine is first specified. This can be either value, red, green, or blue, depending on whether the drawable is of type color or grayscale. The drawable may not be indexed. Second, a range of intensities are specified. The 'gimp-histogram' function returns statistics based on the pixels in the drawable that fall under this range of values. Mean, standard deviation, median, number of pixels, and percentile are all returned. Additionally, the total count of pixels in the image is returned. Counts of pixels are weighted by any associated alpha values and by the current selection mask. That is, pixels that lie outside an active selection mask will not be counted. Similarly, pixels with transparent alpha values will not be counted.",
1289
"Spencer Kimball & Peter Mattis",
1290
"Spencer Kimball & Peter Mattis",
1293
gimp_procedure_add_argument (procedure,
1294
gimp_param_spec_drawable_id ("drawable",
1298
GIMP_PARAM_READWRITE));
1299
gimp_procedure_add_argument (procedure,
1300
g_param_spec_enum ("channel",
1302
"The channel to modify",
1303
GIMP_TYPE_HISTOGRAM_CHANNEL,
1304
GIMP_HISTOGRAM_VALUE,
1305
GIMP_PARAM_READWRITE));
1306
gimp_procedure_add_argument (procedure,
1307
gimp_param_spec_int32 ("start-range",
1309
"Start of the intensity measurement range",
1311
GIMP_PARAM_READWRITE));
1312
gimp_procedure_add_argument (procedure,
1313
gimp_param_spec_int32 ("end-range",
1315
"End of the intensity measurement range",
1317
GIMP_PARAM_READWRITE));
1318
gimp_procedure_add_return_value (procedure,
1319
g_param_spec_double ("mean",
1321
"Mean intensity value",
1322
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1323
GIMP_PARAM_READWRITE));
1324
gimp_procedure_add_return_value (procedure,
1325
g_param_spec_double ("std-dev",
1327
"Standard deviation of intensity values",
1328
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1329
GIMP_PARAM_READWRITE));
1330
gimp_procedure_add_return_value (procedure,
1331
g_param_spec_double ("median",
1333
"Median intensity value",
1334
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1335
GIMP_PARAM_READWRITE));
1336
gimp_procedure_add_return_value (procedure,
1337
g_param_spec_double ("pixels",
1339
"Alpha-weighted pixel count for entire image",
1340
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1341
GIMP_PARAM_READWRITE));
1342
gimp_procedure_add_return_value (procedure,
1343
g_param_spec_double ("count",
1345
"Alpha-weighted pixel count for range",
1346
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1347
GIMP_PARAM_READWRITE));
1348
gimp_procedure_add_return_value (procedure,
1349
g_param_spec_double ("percentile",
1351
"Percentile that range falls under",
1352
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
1353
GIMP_PARAM_READWRITE));
1354
gimp_pdb_register_procedure (pdb, procedure);
1355
g_object_unref (procedure);
1358
* gimp-hue-saturation
1360
procedure = gimp_procedure_new (hue_saturation_invoker);
1361
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-hue-saturation");
1362
gimp_procedure_set_static_strings (procedure,
1363
"gimp-hue-saturation",
1364
"Modify hue, lightness, and saturation in the specified drawable.",
1365
"This procedures allows the hue, lightness, and saturation in the specified drawable to be modified. The 'hue-range' parameter provides the capability to limit range of affected hues.",
1366
"Spencer Kimball & Peter Mattis",
1367
"Spencer Kimball & Peter Mattis",
1370
gimp_procedure_add_argument (procedure,
1371
gimp_param_spec_drawable_id ("drawable",
1375
GIMP_PARAM_READWRITE));
1376
gimp_procedure_add_argument (procedure,
1377
g_param_spec_enum ("hue-range",
1379
"Range of affected hues",
1380
GIMP_TYPE_HUE_RANGE,
1382
GIMP_PARAM_READWRITE));
1383
gimp_procedure_add_argument (procedure,
1384
g_param_spec_double ("hue-offset",
1386
"Hue offset in degrees",
1388
GIMP_PARAM_READWRITE));
1389
gimp_procedure_add_argument (procedure,
1390
g_param_spec_double ("lightness",
1392
"Lightness modification",
1394
GIMP_PARAM_READWRITE));
1395
gimp_procedure_add_argument (procedure,
1396
g_param_spec_double ("saturation",
1398
"Saturation modification",
1400
GIMP_PARAM_READWRITE));
1401
gimp_pdb_register_procedure (pdb, procedure);
1402
g_object_unref (procedure);
1407
procedure = gimp_procedure_new (threshold_invoker);
1408
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-threshold");
1409
gimp_procedure_set_static_strings (procedure,
1411
"Threshold the specified drawable.",
1412
"This procedures generates a threshold map of the specified drawable. All pixels between the values of 'low_threshold' and 'high_threshold' are replaced with white, and all other pixels with black.",
1413
"Spencer Kimball & Peter Mattis",
1414
"Spencer Kimball & Peter Mattis",
1417
gimp_procedure_add_argument (procedure,
1418
gimp_param_spec_drawable_id ("drawable",
1422
GIMP_PARAM_READWRITE));
1423
gimp_procedure_add_argument (procedure,
1424
gimp_param_spec_int32 ("low-threshold",
1426
"The low threshold value",
1428
GIMP_PARAM_READWRITE));
1429
gimp_procedure_add_argument (procedure,
1430
gimp_param_spec_int32 ("high-threshold",
1432
"The high threshold value",
1434
GIMP_PARAM_READWRITE));
1435
gimp_pdb_register_procedure (pdb, procedure);
1436
g_object_unref (procedure);