26
26
#include "libgimpcolor/gimpcolor.h"
28
28
#include "pdb-types.h"
29
#include "procedural_db.h"
30
#include "gimpprocedure.h"
31
#include "core/gimpparamspecs.h"
31
33
#include "core/gimpchannel-combine.h"
32
34
#include "core/gimpchannel.h"
33
35
#include "core/gimpimage.h"
35
static ProcRecord channel_new_proc;
36
static ProcRecord channel_copy_proc;
37
static ProcRecord channel_combine_masks_proc;
38
static ProcRecord channel_get_show_masked_proc;
39
static ProcRecord channel_set_show_masked_proc;
40
static ProcRecord channel_get_opacity_proc;
41
static ProcRecord channel_set_opacity_proc;
42
static ProcRecord channel_get_color_proc;
43
static ProcRecord channel_set_color_proc;
46
register_channel_procs (Gimp *gimp)
48
procedural_db_register (gimp, &channel_new_proc);
49
procedural_db_register (gimp, &channel_copy_proc);
50
procedural_db_register (gimp, &channel_combine_masks_proc);
51
procedural_db_register (gimp, &channel_get_show_masked_proc);
52
procedural_db_register (gimp, &channel_set_show_masked_proc);
53
procedural_db_register (gimp, &channel_get_opacity_proc);
54
procedural_db_register (gimp, &channel_set_opacity_proc);
55
procedural_db_register (gimp, &channel_get_color_proc);
56
procedural_db_register (gimp, &channel_set_color_proc);
60
channel_new_invoker (Gimp *gimp,
62
GimpProgress *progress,
36
#include "gimp-intl.h"
38
#include "internal_procs.h"
42
channel_new_invoker (GimpProcedure *procedure,
45
GimpProgress *progress,
46
const GValueArray *args)
65
48
gboolean success = TRUE;
66
Argument *return_args;
49
GValueArray *return_vals;
73
56
GimpChannel *channel = NULL;
75
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
76
if (! GIMP_IS_IMAGE (gimage))
79
width = args[1].value.pdb_int;
83
height = args[2].value.pdb_int;
87
name = (gchar *) args[3].value.pdb_pointer;
88
if (name == NULL || !g_utf8_validate (name, -1, NULL))
91
opacity = args[4].value.pdb_float;
92
if (opacity < 0.0 || opacity > 100.0)
95
color = args[5].value.pdb_color;
58
image = gimp_value_get_image (&args->values[0], gimp);
59
width = g_value_get_int (&args->values[1]);
60
height = g_value_get_int (&args->values[2]);
61
name = g_value_get_string (&args->values[3]);
62
opacity = g_value_get_double (&args->values[4]);
63
gimp_value_get_rgb (&args->values[5], &color);
99
67
GimpRGB rgb_color = color;
101
69
rgb_color.a = opacity / 100.0;
102
channel = gimp_channel_new (gimage, width, height, name, &rgb_color);
103
success = channel != NULL;
106
return_args = procedural_db_return_args (&channel_new_proc, success);
109
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (channel));
114
static ProcArg channel_new_inargs[] =
119
"The image to which to add the channel"
124
"The channel width: (0 < width)"
129
"The channel height: (0 < height)"
139
"The channel opacity: (0 <= opacity <= 100)"
144
"The channel compositing color"
148
static ProcArg channel_new_outargs[] =
153
"The newly created channel"
157
static ProcRecord channel_new_proc =
160
"Create a new channel.",
161
"This procedure creates a new channel with the specified width and height. Name, opacity, and color are also supplied parameters. The new channel still needs to be added to the image, as this is not automatic. Add the new channel with the 'gimp_image_add_channel' command. Other attributes such as channel show masked, should be set with explicit procedure calls. The channel's contents are undefined initially.",
162
"Spencer Kimball & Peter Mattis",
163
"Spencer Kimball & Peter Mattis",
171
{ { channel_new_invoker } }
175
channel_copy_invoker (Gimp *gimp,
176
GimpContext *context,
177
GimpProgress *progress,
180
gboolean success = TRUE;
181
Argument *return_args;
70
channel = gimp_channel_new (image, width, height, name, &rgb_color);
76
return_vals = gimp_procedure_get_return_values (procedure, success);
79
gimp_value_set_channel (&return_vals->values[1], channel);
85
channel_new_from_component_invoker (GimpProcedure *procedure,
88
GimpProgress *progress,
89
const GValueArray *args)
91
gboolean success = TRUE;
92
GValueArray *return_vals;
96
GimpChannel *channel = NULL;
98
image = gimp_value_get_image (&args->values[0], gimp);
99
component = g_value_get_enum (&args->values[1]);
100
name = g_value_get_string (&args->values[2]);
104
if (gimp_image_get_component_index (image, component) != -1)
105
channel = gimp_channel_new_from_component (image,
106
component, name, NULL);
109
gimp_item_set_visible (GIMP_ITEM (channel), FALSE, FALSE);
114
return_vals = gimp_procedure_get_return_values (procedure, success);
117
gimp_value_set_channel (&return_vals->values[1], channel);
123
channel_copy_invoker (GimpProcedure *procedure,
125
GimpContext *context,
126
GimpProgress *progress,
127
const GValueArray *args)
129
gboolean success = TRUE;
130
GValueArray *return_vals;
182
131
GimpChannel *channel;
183
132
GimpChannel *channel_copy = NULL;
185
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
186
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
134
channel = gimp_value_get_channel (&args->values[0], gimp);
191
138
channel_copy = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel),
192
139
G_TYPE_FROM_INSTANCE (channel), FALSE));
193
success = (channel_copy != NULL);
196
return_args = procedural_db_return_args (&channel_copy_proc, success);
145
return_vals = gimp_procedure_get_return_values (procedure, success);
199
return_args[1].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (channel_copy));
148
gimp_value_set_channel (&return_vals->values[1], channel_copy);
204
static ProcArg channel_copy_inargs[] =
209
"The channel to copy"
213
static ProcArg channel_copy_outargs[] =
218
"The newly copied channel"
222
static ProcRecord channel_copy_proc =
226
"This procedure copies the specified channel and returns the copy.",
227
"Spencer Kimball & Peter Mattis",
228
"Spencer Kimball & Peter Mattis",
235
channel_copy_outargs,
236
{ { channel_copy_invoker } }
240
channel_combine_masks_invoker (Gimp *gimp,
241
GimpContext *context,
242
GimpProgress *progress,
154
channel_combine_masks_invoker (GimpProcedure *procedure,
156
GimpContext *context,
157
GimpProgress *progress,
158
const GValueArray *args)
245
160
gboolean success = TRUE;
246
161
GimpChannel *channel1;
252
channel1 = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
253
if (! (GIMP_IS_CHANNEL (channel1) && ! gimp_item_is_removed (GIMP_ITEM (channel1))))
256
channel2 = (GimpChannel *) gimp_item_get_by_ID (gimp, args[1].value.pdb_int);
257
if (! (GIMP_IS_CHANNEL (channel2) && ! gimp_item_is_removed (GIMP_ITEM (channel2))))
260
operation = args[2].value.pdb_int;
261
if (operation < GIMP_CHANNEL_OP_ADD || operation > GIMP_CHANNEL_OP_INTERSECT)
264
offx = args[3].value.pdb_int;
266
offy = args[4].value.pdb_int;
167
channel1 = gimp_value_get_channel (&args->values[0], gimp);
168
channel2 = gimp_value_get_channel (&args->values[1], gimp);
169
operation = g_value_get_enum (&args->values[2]);
170
offx = g_value_get_int (&args->values[3]);
171
offy = g_value_get_int (&args->values[4]);
175
gimp_channel_push_undo (channel1, _("Combine Masks"));
270
176
gimp_channel_combine_mask (channel1, channel2, operation, offx, offy);
273
return procedural_db_return_args (&channel_combine_masks_proc, success);
179
return gimp_procedure_get_return_values (procedure, success);
276
static ProcArg channel_combine_masks_inargs[] =
291
"The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }"
296
"x offset between upper left corner of channels: (second - first)"
301
"y offset between upper left corner of channels: (second - first)"
305
static ProcRecord channel_combine_masks_proc =
307
"gimp_channel_combine_masks",
308
"Combine two channel masks.",
309
"This procedure combines two channel masks. The result is stored in the first channel.",
310
"Spencer Kimball & Peter Mattis",
311
"Spencer Kimball & Peter Mattis",
316
channel_combine_masks_inargs,
319
{ { channel_combine_masks_invoker } }
323
channel_get_show_masked_invoker (Gimp *gimp,
324
GimpContext *context,
325
GimpProgress *progress,
183
channel_get_show_masked_invoker (GimpProcedure *procedure,
185
GimpContext *context,
186
GimpProgress *progress,
187
const GValueArray *args)
328
189
gboolean success = TRUE;
329
Argument *return_args;
190
GValueArray *return_vals;
330
191
GimpChannel *channel;
332
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
333
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
336
return_args = procedural_db_return_args (&channel_get_show_masked_proc, success);
339
return_args[1].value.pdb_int = gimp_channel_get_show_masked (channel);
192
gboolean show_masked = FALSE;
194
channel = gimp_value_get_channel (&args->values[0], gimp);
198
show_masked = gimp_channel_get_show_masked (channel);
201
return_vals = gimp_procedure_get_return_values (procedure, success);
204
g_value_set_boolean (&return_vals->values[1], show_masked);
344
static ProcArg channel_get_show_masked_inargs[] =
353
static ProcArg channel_get_show_masked_outargs[] =
358
"The channel composite method"
362
static ProcRecord channel_get_show_masked_proc =
364
"gimp_channel_get_show_masked",
365
"Get the composite method of the specified channel.",
366
"This procedure returns the specified channel's composite method. If it is non-zero, then the channel is composited with the image so that masked regions are shown. Otherwise, selected regions are shown.",
367
"Spencer Kimball & Peter Mattis",
368
"Spencer Kimball & Peter Mattis",
373
channel_get_show_masked_inargs,
375
channel_get_show_masked_outargs,
376
{ { channel_get_show_masked_invoker } }
380
channel_set_show_masked_invoker (Gimp *gimp,
381
GimpContext *context,
382
GimpProgress *progress,
210
channel_set_show_masked_invoker (GimpProcedure *procedure,
212
GimpContext *context,
213
GimpProgress *progress,
214
const GValueArray *args)
385
216
gboolean success = TRUE;
386
217
GimpChannel *channel;
387
218
gboolean show_masked;
389
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
390
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
393
show_masked = args[1].value.pdb_int ? TRUE : FALSE;
220
channel = gimp_value_get_channel (&args->values[0], gimp);
221
show_masked = g_value_get_boolean (&args->values[1]);
396
gimp_channel_set_show_masked (channel, show_masked);
225
gimp_channel_set_show_masked (channel, show_masked);
398
return procedural_db_return_args (&channel_set_show_masked_proc, success);
228
return gimp_procedure_get_return_values (procedure, success);
401
static ProcArg channel_set_show_masked_inargs[] =
411
"The new channel composite method"
415
static ProcRecord channel_set_show_masked_proc =
417
"gimp_channel_set_show_masked",
418
"Set the composite method of the specified channel.",
419
"This procedure sets the specified channel's composite method. If it is non-zero, then the channel is composited with the image so that masked regions are shown. Otherwise, selected regions are shown.",
420
"Spencer Kimball & Peter Mattis",
421
"Spencer Kimball & Peter Mattis",
426
channel_set_show_masked_inargs,
429
{ { channel_set_show_masked_invoker } }
433
channel_get_opacity_invoker (Gimp *gimp,
434
GimpContext *context,
435
GimpProgress *progress,
232
channel_get_opacity_invoker (GimpProcedure *procedure,
234
GimpContext *context,
235
GimpProgress *progress,
236
const GValueArray *args)
438
238
gboolean success = TRUE;
439
Argument *return_args;
239
GValueArray *return_vals;
440
240
GimpChannel *channel;
442
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
443
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
446
return_args = procedural_db_return_args (&channel_get_opacity_proc, success);
449
return_args[1].value.pdb_float = gimp_channel_get_opacity (channel) * 100.0;
241
gdouble opacity = 0.0;
243
channel = gimp_value_get_channel (&args->values[0], gimp);
247
opacity = gimp_channel_get_opacity (channel) * 100;
250
return_vals = gimp_procedure_get_return_values (procedure, success);
253
g_value_set_double (&return_vals->values[1], opacity);
454
static ProcArg channel_get_opacity_inargs[] =
463
static ProcArg channel_get_opacity_outargs[] =
468
"The channel opacity"
472
static ProcRecord channel_get_opacity_proc =
474
"gimp_channel_get_opacity",
475
"Get the opacity of the specified channel.",
476
"This procedure returns the specified channel's opacity.",
477
"Spencer Kimball & Peter Mattis",
478
"Spencer Kimball & Peter Mattis",
483
channel_get_opacity_inargs,
485
channel_get_opacity_outargs,
486
{ { channel_get_opacity_invoker } }
490
channel_set_opacity_invoker (Gimp *gimp,
491
GimpContext *context,
492
GimpProgress *progress,
259
channel_set_opacity_invoker (GimpProcedure *procedure,
261
GimpContext *context,
262
GimpProgress *progress,
263
const GValueArray *args)
495
265
gboolean success = TRUE;
496
266
GimpChannel *channel;
499
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
500
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
503
opacity = args[1].value.pdb_float;
504
if (opacity < 0.0 || opacity > 100.0)
508
gimp_channel_set_opacity (channel, opacity / 100.0, TRUE);
510
return procedural_db_return_args (&channel_set_opacity_proc, success);
513
static ProcArg channel_set_opacity_inargs[] =
523
"The new channel opacity (0 <= opacity <= 100)"
527
static ProcRecord channel_set_opacity_proc =
529
"gimp_channel_set_opacity",
530
"Set the opacity of the specified channel.",
531
"This procedure sets the specified channel's opacity.",
532
"Spencer Kimball & Peter Mattis",
533
"Spencer Kimball & Peter Mattis",
538
channel_set_opacity_inargs,
541
{ { channel_set_opacity_invoker } }
545
channel_get_color_invoker (Gimp *gimp,
546
GimpContext *context,
547
GimpProgress *progress,
550
gboolean success = TRUE;
551
Argument *return_args;
552
GimpChannel *channel;
555
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
556
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
560
gimp_channel_get_color (channel, &color);
562
return_args = procedural_db_return_args (&channel_get_color_proc, success);
565
return_args[1].value.pdb_color = color;
570
static ProcArg channel_get_color_inargs[] =
579
static ProcArg channel_get_color_outargs[] =
584
"The channel compositing color"
588
static ProcRecord channel_get_color_proc =
590
"gimp_channel_get_color",
591
"Get the compositing color of the specified channel.",
592
"This procedure returns the specified channel's compositing color.",
593
"Spencer Kimball & Peter Mattis",
594
"Spencer Kimball & Peter Mattis",
599
channel_get_color_inargs,
601
channel_get_color_outargs,
602
{ { channel_get_color_invoker } }
606
channel_set_color_invoker (Gimp *gimp,
607
GimpContext *context,
608
GimpProgress *progress,
611
gboolean success = TRUE;
612
GimpChannel *channel;
615
channel = (GimpChannel *) gimp_item_get_by_ID (gimp, args[0].value.pdb_int);
616
if (! (GIMP_IS_CHANNEL (channel) && ! gimp_item_is_removed (GIMP_ITEM (channel))))
619
color = args[1].value.pdb_color;
269
channel = gimp_value_get_channel (&args->values[0], gimp);
270
opacity = g_value_get_double (&args->values[1]);
274
gimp_channel_set_opacity (channel, opacity / 100.0, TRUE);
277
return gimp_procedure_get_return_values (procedure, success);
281
channel_get_color_invoker (GimpProcedure *procedure,
283
GimpContext *context,
284
GimpProgress *progress,
285
const GValueArray *args)
287
gboolean success = TRUE;
288
GValueArray *return_vals;
289
GimpChannel *channel;
290
GimpRGB color = { 0.0, 0.0, 0.0, 1.0 };
292
channel = gimp_value_get_channel (&args->values[0], gimp);
296
gimp_channel_get_color (channel, &color);
297
gimp_rgb_set_alpha (&color, 1.0);
300
return_vals = gimp_procedure_get_return_values (procedure, success);
303
gimp_value_set_rgb (&return_vals->values[1], &color);
309
channel_set_color_invoker (GimpProcedure *procedure,
311
GimpContext *context,
312
GimpProgress *progress,
313
const GValueArray *args)
315
gboolean success = TRUE;
316
GimpChannel *channel;
319
channel = gimp_value_get_channel (&args->values[0], gimp);
320
gimp_value_get_rgb (&args->values[1], &color);
626
327
gimp_channel_set_color (channel, &rgb_color, TRUE);
629
return procedural_db_return_args (&channel_set_color_proc, success);
632
static ProcArg channel_set_color_inargs[] =
642
"The new channel compositing color"
646
static ProcRecord channel_set_color_proc =
648
"gimp_channel_set_color",
649
"Set the compositing color of the specified channel.",
650
"This procedure sets the specified channel's compositing color.",
651
"Spencer Kimball & Peter Mattis",
652
"Spencer Kimball & Peter Mattis",
657
channel_set_color_inargs,
660
{ { channel_set_color_invoker } }
330
return gimp_procedure_get_return_values (procedure, success);
334
register_channel_procs (GimpPDB *pdb)
336
GimpProcedure *procedure;
341
procedure = gimp_procedure_new (channel_new_invoker);
342
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-new");
343
gimp_procedure_set_static_strings (procedure,
345
"Create a new channel.",
346
"This procedure creates a new channel with the specified width and height. Name, opacity, and color are also supplied parameters. The new channel still needs to be added to the image, as this is not automatic. Add the new channel with the 'gimp-image-add-channel' command. Other attributes such as channel show masked, should be set with explicit procedure calls. The channel's contents are undefined initially.",
347
"Spencer Kimball & Peter Mattis",
348
"Spencer Kimball & Peter Mattis",
351
gimp_procedure_add_argument (procedure,
352
gimp_param_spec_image_id ("image",
354
"The image to which to add the channel",
356
GIMP_PARAM_READWRITE));
357
gimp_procedure_add_argument (procedure,
358
gimp_param_spec_int32 ("width",
362
GIMP_PARAM_READWRITE));
363
gimp_procedure_add_argument (procedure,
364
gimp_param_spec_int32 ("height",
366
"The channel height",
368
GIMP_PARAM_READWRITE));
369
gimp_procedure_add_argument (procedure,
370
gimp_param_spec_string ("name",
375
GIMP_PARAM_READWRITE));
376
gimp_procedure_add_argument (procedure,
377
g_param_spec_double ("opacity",
379
"The channel opacity",
381
GIMP_PARAM_READWRITE));
382
gimp_procedure_add_argument (procedure,
383
gimp_param_spec_rgb ("color",
385
"The channel compositing color",
388
GIMP_PARAM_READWRITE));
389
gimp_procedure_add_return_value (procedure,
390
gimp_param_spec_channel_id ("channel",
392
"The newly created channel",
394
GIMP_PARAM_READWRITE));
395
gimp_pdb_register_procedure (pdb, procedure);
396
g_object_unref (procedure);
399
* gimp-channel-new-from-component
401
procedure = gimp_procedure_new (channel_new_from_component_invoker);
402
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-new-from-component");
403
gimp_procedure_set_static_strings (procedure,
404
"gimp-channel-new-from-component",
405
"Create a new channel from a color component",
406
"This procedure creates a new channel from a color component.",
407
"Shlomi Fish <shlomif@iglu.org.il>",
411
gimp_procedure_add_argument (procedure,
412
gimp_param_spec_image_id ("image",
414
"The image to which to add the channel",
416
GIMP_PARAM_READWRITE));
417
gimp_procedure_add_argument (procedure,
418
g_param_spec_enum ("component",
420
"The image component",
421
GIMP_TYPE_CHANNEL_TYPE,
423
GIMP_PARAM_READWRITE));
424
gimp_procedure_add_argument (procedure,
425
gimp_param_spec_string ("name",
430
GIMP_PARAM_READWRITE));
431
gimp_procedure_add_return_value (procedure,
432
gimp_param_spec_channel_id ("channel",
434
"The newly created channel",
436
GIMP_PARAM_READWRITE));
437
gimp_pdb_register_procedure (pdb, procedure);
438
g_object_unref (procedure);
443
procedure = gimp_procedure_new (channel_copy_invoker);
444
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-copy");
445
gimp_procedure_set_static_strings (procedure,
448
"This procedure copies the specified channel and returns the copy.",
449
"Spencer Kimball & Peter Mattis",
450
"Spencer Kimball & Peter Mattis",
453
gimp_procedure_add_argument (procedure,
454
gimp_param_spec_channel_id ("channel",
456
"The channel to copy",
458
GIMP_PARAM_READWRITE));
459
gimp_procedure_add_return_value (procedure,
460
gimp_param_spec_channel_id ("channel-copy",
462
"The newly copied channel",
464
GIMP_PARAM_READWRITE));
465
gimp_pdb_register_procedure (pdb, procedure);
466
g_object_unref (procedure);
469
* gimp-channel-combine-masks
471
procedure = gimp_procedure_new (channel_combine_masks_invoker);
472
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-combine-masks");
473
gimp_procedure_set_static_strings (procedure,
474
"gimp-channel-combine-masks",
475
"Combine two channel masks.",
476
"This procedure combines two channel masks. The result is stored in the first channel.",
477
"Spencer Kimball & Peter Mattis",
478
"Spencer Kimball & Peter Mattis",
481
gimp_procedure_add_argument (procedure,
482
gimp_param_spec_channel_id ("channel1",
486
GIMP_PARAM_READWRITE));
487
gimp_procedure_add_argument (procedure,
488
gimp_param_spec_channel_id ("channel2",
492
GIMP_PARAM_READWRITE));
493
gimp_procedure_add_argument (procedure,
494
g_param_spec_enum ("operation",
496
"The selection operation",
497
GIMP_TYPE_CHANNEL_OPS,
499
GIMP_PARAM_READWRITE));
500
gimp_procedure_add_argument (procedure,
501
gimp_param_spec_int32 ("offx",
503
"x offset between upper left corner of channels: (second - first)",
504
G_MININT32, G_MAXINT32, 0,
505
GIMP_PARAM_READWRITE));
506
gimp_procedure_add_argument (procedure,
507
gimp_param_spec_int32 ("offy",
509
"y offset between upper left corner of channels: (second - first)",
510
G_MININT32, G_MAXINT32, 0,
511
GIMP_PARAM_READWRITE));
512
gimp_pdb_register_procedure (pdb, procedure);
513
g_object_unref (procedure);
516
* gimp-channel-get-show-masked
518
procedure = gimp_procedure_new (channel_get_show_masked_invoker);
519
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-get-show-masked");
520
gimp_procedure_set_static_strings (procedure,
521
"gimp-channel-get-show-masked",
522
"Get the composite method of the specified channel.",
523
"This procedure returns the specified channel's composite method. If it is TRUE, then the channel is composited with the image so that masked regions are shown. Otherwise, selected regions are shown.",
524
"Spencer Kimball & Peter Mattis",
525
"Spencer Kimball & Peter Mattis",
528
gimp_procedure_add_argument (procedure,
529
gimp_param_spec_channel_id ("channel",
533
GIMP_PARAM_READWRITE));
534
gimp_procedure_add_return_value (procedure,
535
g_param_spec_boolean ("show-masked",
537
"The channel composite method",
539
GIMP_PARAM_READWRITE));
540
gimp_pdb_register_procedure (pdb, procedure);
541
g_object_unref (procedure);
544
* gimp-channel-set-show-masked
546
procedure = gimp_procedure_new (channel_set_show_masked_invoker);
547
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-set-show-masked");
548
gimp_procedure_set_static_strings (procedure,
549
"gimp-channel-set-show-masked",
550
"Set the composite method of the specified channel.",
551
"This procedure sets the specified channel's composite method. If it is TRUE, then the channel is composited with the image so that masked regions are shown. Otherwise, selected regions are shown.",
552
"Spencer Kimball & Peter Mattis",
553
"Spencer Kimball & Peter Mattis",
556
gimp_procedure_add_argument (procedure,
557
gimp_param_spec_channel_id ("channel",
561
GIMP_PARAM_READWRITE));
562
gimp_procedure_add_argument (procedure,
563
g_param_spec_boolean ("show-masked",
565
"The new channel composite method",
567
GIMP_PARAM_READWRITE));
568
gimp_pdb_register_procedure (pdb, procedure);
569
g_object_unref (procedure);
572
* gimp-channel-get-opacity
574
procedure = gimp_procedure_new (channel_get_opacity_invoker);
575
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-get-opacity");
576
gimp_procedure_set_static_strings (procedure,
577
"gimp-channel-get-opacity",
578
"Get the opacity of the specified channel.",
579
"This procedure returns the specified channel's opacity.",
580
"Spencer Kimball & Peter Mattis",
581
"Spencer Kimball & Peter Mattis",
584
gimp_procedure_add_argument (procedure,
585
gimp_param_spec_channel_id ("channel",
589
GIMP_PARAM_READWRITE));
590
gimp_procedure_add_return_value (procedure,
591
g_param_spec_double ("opacity",
593
"The channel opacity",
595
GIMP_PARAM_READWRITE));
596
gimp_pdb_register_procedure (pdb, procedure);
597
g_object_unref (procedure);
600
* gimp-channel-set-opacity
602
procedure = gimp_procedure_new (channel_set_opacity_invoker);
603
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-set-opacity");
604
gimp_procedure_set_static_strings (procedure,
605
"gimp-channel-set-opacity",
606
"Set the opacity of the specified channel.",
607
"This procedure sets the specified channel's opacity.",
608
"Spencer Kimball & Peter Mattis",
609
"Spencer Kimball & Peter Mattis",
612
gimp_procedure_add_argument (procedure,
613
gimp_param_spec_channel_id ("channel",
617
GIMP_PARAM_READWRITE));
618
gimp_procedure_add_argument (procedure,
619
g_param_spec_double ("opacity",
621
"The new channel opacity",
623
GIMP_PARAM_READWRITE));
624
gimp_pdb_register_procedure (pdb, procedure);
625
g_object_unref (procedure);
628
* gimp-channel-get-color
630
procedure = gimp_procedure_new (channel_get_color_invoker);
631
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-get-color");
632
gimp_procedure_set_static_strings (procedure,
633
"gimp-channel-get-color",
634
"Get the compositing color of the specified channel.",
635
"This procedure returns the specified channel's compositing color.",
636
"Spencer Kimball & Peter Mattis",
637
"Spencer Kimball & Peter Mattis",
640
gimp_procedure_add_argument (procedure,
641
gimp_param_spec_channel_id ("channel",
645
GIMP_PARAM_READWRITE));
646
gimp_procedure_add_return_value (procedure,
647
gimp_param_spec_rgb ("color",
649
"The channel compositing color",
652
GIMP_PARAM_READWRITE));
653
gimp_pdb_register_procedure (pdb, procedure);
654
g_object_unref (procedure);
657
* gimp-channel-set-color
659
procedure = gimp_procedure_new (channel_set_color_invoker);
660
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-channel-set-color");
661
gimp_procedure_set_static_strings (procedure,
662
"gimp-channel-set-color",
663
"Set the compositing color of the specified channel.",
664
"This procedure sets the specified channel's compositing color.",
665
"Spencer Kimball & Peter Mattis",
666
"Spencer Kimball & Peter Mattis",
669
gimp_procedure_add_argument (procedure,
670
gimp_param_spec_channel_id ("channel",
674
GIMP_PARAM_READWRITE));
675
gimp_procedure_add_argument (procedure,
676
gimp_param_spec_rgb ("color",
678
"The new channel compositing color",
681
GIMP_PARAM_READWRITE));
682
gimp_pdb_register_procedure (pdb, procedure);
683
g_object_unref (procedure);