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

« back to all changes in this revision

Viewing changes to libgimp/gimpdrawable_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
 
26
26
#include <string.h>
27
27
 
28
28
#include "gimp.h"
 
29
#undef GIMP_DISABLE_DEPRECATED
 
30
#undef __GIMP_DRAWABLE_PDB_H__
 
31
#include "gimpdrawable_pdb.h"
29
32
 
30
33
/**
31
 
 * gimp_drawable_delete:
32
 
 * @drawable_ID: The drawable to delete.
33
 
 *
34
 
 * Delete a drawable.
35
 
 *
36
 
 * This procedure deletes the specified drawable. This must not be done
37
 
 * if the gimage containing this drawable was already deleted or if the
38
 
 * drawable was already removed from the image. The only case in which
39
 
 * this procedure is useful is if you want to get rid of a drawable
40
 
 * which has not yet been added to an image.
41
 
 *
42
 
 * Returns: TRUE on success.
 
34
 * gimp_drawable_is_valid:
 
35
 * @drawable_ID: The drawable to check.
 
36
 *
 
37
 * Returns TRUE if the drawable is valid.
 
38
 *
 
39
 * This procedure checks if the given drawable ID is valid and refers
 
40
 * to an existing drawable.
 
41
 *
 
42
 * Returns: Whether the drawable ID is valid.
 
43
 *
 
44
 * Since: GIMP 2.4
43
45
 */
44
46
gboolean
45
 
gimp_drawable_delete (gint32 drawable_ID)
 
47
gimp_drawable_is_valid (gint32 drawable_ID)
46
48
{
47
49
  GimpParam *return_vals;
48
50
  gint nreturn_vals;
49
 
  gboolean success = TRUE;
50
 
 
51
 
  return_vals = gimp_run_procedure ("gimp_drawable_delete",
52
 
                                    &nreturn_vals,
53
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
54
 
                                    GIMP_PDB_END);
55
 
 
56
 
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
51
  gboolean valid = FALSE;
 
52
 
 
53
  return_vals = gimp_run_procedure ("gimp-drawable-is-valid",
 
54
                                    &nreturn_vals,
 
55
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
56
                                    GIMP_PDB_END);
 
57
 
 
58
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
59
    valid = return_vals[1].data.d_int32;
57
60
 
58
61
  gimp_destroy_params (return_vals, nreturn_vals);
59
62
 
60
 
  return success;
 
63
  return valid;
61
64
}
62
65
 
63
66
/**
66
69
 *
67
70
 * Returns whether the drawable is a layer.
68
71
 *
69
 
 * This procedure returns non-zero if the specified drawable is a
70
 
 * layer.
 
72
 * This procedure returns TRUE if the specified drawable is a layer.
71
73
 *
72
 
 * Returns: Non-zero if the drawable is a layer.
 
74
 * Returns: TRUE if the drawable is a layer.
73
75
 */
74
76
gboolean
75
77
gimp_drawable_is_layer (gint32 drawable_ID)
78
80
  gint nreturn_vals;
79
81
  gboolean layer = FALSE;
80
82
 
81
 
  return_vals = gimp_run_procedure ("gimp_drawable_is_layer",
82
 
                                    &nreturn_vals,
83
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
84
 
                                    GIMP_PDB_END);
 
83
  return_vals = gimp_run_procedure ("gimp-drawable-is-layer",
 
84
                                    &nreturn_vals,
 
85
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
86
                                    GIMP_PDB_END);
85
87
 
86
88
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
87
89
    layer = return_vals[1].data.d_int32;
97
99
 *
98
100
 * Returns whether the drawable is a layer mask.
99
101
 *
100
 
 * This procedure returns non-zero if the specified drawable is a layer
 
102
 * This procedure returns TRUE if the specified drawable is a layer
101
103
 * mask.
102
104
 *
103
 
 * Returns: Non-zero if the drawable is a layer mask.
 
105
 * Returns: TRUE if the drawable is a layer mask.
104
106
 */
105
107
gboolean
106
108
gimp_drawable_is_layer_mask (gint32 drawable_ID)
109
111
  gint nreturn_vals;
110
112
  gboolean layer_mask = FALSE;
111
113
 
112
 
  return_vals = gimp_run_procedure ("gimp_drawable_is_layer_mask",
113
 
                                    &nreturn_vals,
114
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
115
 
                                    GIMP_PDB_END);
 
114
  return_vals = gimp_run_procedure ("gimp-drawable-is-layer-mask",
 
115
                                    &nreturn_vals,
 
116
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
117
                                    GIMP_PDB_END);
116
118
 
117
119
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
118
120
    layer_mask = return_vals[1].data.d_int32;
128
130
 *
129
131
 * Returns whether the drawable is a channel.
130
132
 *
131
 
 * This procedure returns non-zero if the specified drawable is a
132
 
 * channel.
 
133
 * This procedure returns TRUE if the specified drawable is a channel.
133
134
 *
134
 
 * Returns: Non-zero if the drawable is a channel.
 
135
 * Returns: TRUE if the drawable is a channel.
135
136
 */
136
137
gboolean
137
138
gimp_drawable_is_channel (gint32 drawable_ID)
140
141
  gint nreturn_vals;
141
142
  gboolean channel = FALSE;
142
143
 
143
 
  return_vals = gimp_run_procedure ("gimp_drawable_is_channel",
144
 
                                    &nreturn_vals,
145
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
146
 
                                    GIMP_PDB_END);
 
144
  return_vals = gimp_run_procedure ("gimp-drawable-is-channel",
 
145
                                    &nreturn_vals,
 
146
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
147
                                    GIMP_PDB_END);
147
148
 
148
149
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
149
150
    channel = return_vals[1].data.d_int32;
170
171
  gint nreturn_vals;
171
172
  GimpImageType type = 0;
172
173
 
173
 
  return_vals = gimp_run_procedure ("gimp_drawable_type",
174
 
                                    &nreturn_vals,
175
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
176
 
                                    GIMP_PDB_END);
 
174
  return_vals = gimp_run_procedure ("gimp-drawable-type",
 
175
                                    &nreturn_vals,
 
176
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
177
                                    GIMP_PDB_END);
177
178
 
178
179
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
179
180
    type = return_vals[1].data.d_int32;
203
204
  gint nreturn_vals;
204
205
  GimpImageType type_with_alpha = 0;
205
206
 
206
 
  return_vals = gimp_run_procedure ("gimp_drawable_type_with_alpha",
207
 
                                    &nreturn_vals,
208
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
209
 
                                    GIMP_PDB_END);
 
207
  return_vals = gimp_run_procedure ("gimp-drawable-type-with-alpha",
 
208
                                    &nreturn_vals,
 
209
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
210
                                    GIMP_PDB_END);
210
211
 
211
212
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
212
213
    type_with_alpha = return_vals[1].data.d_int32;
220
221
 * gimp_drawable_has_alpha:
221
222
 * @drawable_ID: The drawable.
222
223
 *
223
 
 * Returns non-zero if the drawable has an alpha channel.
 
224
 * Returns TRUE if the drawable has an alpha channel.
224
225
 *
225
226
 * This procedure returns whether the specified drawable has an alpha
226
227
 * channel. This can only be true for layers, and the associated type
235
236
  gint nreturn_vals;
236
237
  gboolean has_alpha = FALSE;
237
238
 
238
 
  return_vals = gimp_run_procedure ("gimp_drawable_has_alpha",
239
 
                                    &nreturn_vals,
240
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
241
 
                                    GIMP_PDB_END);
 
239
  return_vals = gimp_run_procedure ("gimp-drawable-has-alpha",
 
240
                                    &nreturn_vals,
 
241
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
242
                                    GIMP_PDB_END);
242
243
 
243
244
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
244
245
    has_alpha = return_vals[1].data.d_int32;
254
255
 *
255
256
 * Returns whether the drawable is an RGB type.
256
257
 *
257
 
 * This procedure returns non-zero if the specified drawable is of type
258
 
 * { RGB, RGBA }.
 
258
 * This procedure returns TRUE if the specified drawable is of type {
 
259
 * RGB, RGBA }.
259
260
 *
260
 
 * Returns: non-zero if the drawable is an RGB type.
 
261
 * Returns: TRUE if the drawable is an RGB type.
261
262
 */
262
263
gboolean
263
264
gimp_drawable_is_rgb (gint32 drawable_ID)
266
267
  gint nreturn_vals;
267
268
  gboolean is_rgb = FALSE;
268
269
 
269
 
  return_vals = gimp_run_procedure ("gimp_drawable_is_rgb",
270
 
                                    &nreturn_vals,
271
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
272
 
                                    GIMP_PDB_END);
 
270
  return_vals = gimp_run_procedure ("gimp-drawable-is-rgb",
 
271
                                    &nreturn_vals,
 
272
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
273
                                    GIMP_PDB_END);
273
274
 
274
275
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
275
276
    is_rgb = return_vals[1].data.d_int32;
285
286
 *
286
287
 * Returns whether the drawable is a grayscale type.
287
288
 *
288
 
 * This procedure returns non-zero if the specified drawable is of type
289
 
 * { Gray, GrayA }.
 
289
 * This procedure returns TRUE if the specified drawable is of type {
 
290
 * Gray, GrayA }.
290
291
 *
291
 
 * Returns: non-zero if the drawable is a grayscale type.
 
292
 * Returns: TRUE if the drawable is a grayscale type.
292
293
 */
293
294
gboolean
294
295
gimp_drawable_is_gray (gint32 drawable_ID)
297
298
  gint nreturn_vals;
298
299
  gboolean is_gray = FALSE;
299
300
 
300
 
  return_vals = gimp_run_procedure ("gimp_drawable_is_gray",
301
 
                                    &nreturn_vals,
302
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
303
 
                                    GIMP_PDB_END);
 
301
  return_vals = gimp_run_procedure ("gimp-drawable-is-gray",
 
302
                                    &nreturn_vals,
 
303
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
304
                                    GIMP_PDB_END);
304
305
 
305
306
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
306
307
    is_gray = return_vals[1].data.d_int32;
316
317
 *
317
318
 * Returns whether the drawable is an indexed type.
318
319
 *
319
 
 * This procedure returns non-zero if the specified drawable is of type
320
 
 * { Indexed, IndexedA }.
 
320
 * This procedure returns TRUE if the specified drawable is of type {
 
321
 * Indexed, IndexedA }.
321
322
 *
322
 
 * Returns: non-zero if the drawable is an indexed type.
 
323
 * Returns: TRUE if the drawable is an indexed type.
323
324
 */
324
325
gboolean
325
326
gimp_drawable_is_indexed (gint32 drawable_ID)
328
329
  gint nreturn_vals;
329
330
  gboolean is_indexed = FALSE;
330
331
 
331
 
  return_vals = gimp_run_procedure ("gimp_drawable_is_indexed",
332
 
                                    &nreturn_vals,
333
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
334
 
                                    GIMP_PDB_END);
 
332
  return_vals = gimp_run_procedure ("gimp-drawable-is-indexed",
 
333
                                    &nreturn_vals,
 
334
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
335
                                    GIMP_PDB_END);
335
336
 
336
337
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
337
338
    is_indexed = return_vals[1].data.d_int32;
359
360
  gint nreturn_vals;
360
361
  gint bpp = 0;
361
362
 
362
 
  return_vals = gimp_run_procedure ("gimp_drawable_bpp",
363
 
                                    &nreturn_vals,
364
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
365
 
                                    GIMP_PDB_END);
 
363
  return_vals = gimp_run_procedure ("gimp-drawable-bpp",
 
364
                                    &nreturn_vals,
 
365
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
366
                                    GIMP_PDB_END);
366
367
 
367
368
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
368
369
    bpp = return_vals[1].data.d_int32;
389
390
  gint nreturn_vals;
390
391
  gint width = 0;
391
392
 
392
 
  return_vals = gimp_run_procedure ("gimp_drawable_width",
393
 
                                    &nreturn_vals,
394
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
395
 
                                    GIMP_PDB_END);
 
393
  return_vals = gimp_run_procedure ("gimp-drawable-width",
 
394
                                    &nreturn_vals,
 
395
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
396
                                    GIMP_PDB_END);
396
397
 
397
398
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
398
399
    width = return_vals[1].data.d_int32;
419
420
  gint nreturn_vals;
420
421
  gint height = 0;
421
422
 
422
 
  return_vals = gimp_run_procedure ("gimp_drawable_height",
423
 
                                    &nreturn_vals,
424
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
425
 
                                    GIMP_PDB_END);
 
423
  return_vals = gimp_run_procedure ("gimp-drawable-height",
 
424
                                    &nreturn_vals,
 
425
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
426
                                    GIMP_PDB_END);
426
427
 
427
428
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
428
429
    height = return_vals[1].data.d_int32;
448
449
 */
449
450
gboolean
450
451
gimp_drawable_offsets (gint32  drawable_ID,
451
 
                       gint   *offset_x,
452
 
                       gint   *offset_y)
 
452
                       gint   *offset_x,
 
453
                       gint   *offset_y)
453
454
{
454
455
  GimpParam *return_vals;
455
456
  gint nreturn_vals;
456
457
  gboolean success = TRUE;
457
458
 
458
 
  return_vals = gimp_run_procedure ("gimp_drawable_offsets",
459
 
                                    &nreturn_vals,
460
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
461
 
                                    GIMP_PDB_END);
 
459
  return_vals = gimp_run_procedure ("gimp-drawable-offsets",
 
460
                                    &nreturn_vals,
 
461
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
462
                                    GIMP_PDB_END);
462
463
 
463
464
  *offset_x = 0;
464
465
  *offset_y = 0;
477
478
}
478
479
 
479
480
/**
 
481
 * gimp_drawable_delete:
 
482
 * @drawable_ID: The drawable to delete.
 
483
 *
 
484
 * Delete a drawable.
 
485
 *
 
486
 * This procedure deletes the specified drawable. This must not be done
 
487
 * if the image containing this drawable was already deleted or if the
 
488
 * drawable was already removed from the image. The only case in which
 
489
 * this procedure is useful is if you want to get rid of a drawable
 
490
 * which has not yet been added to an image.
 
491
 *
 
492
 * Returns: TRUE on success.
 
493
 */
 
494
gboolean
 
495
gimp_drawable_delete (gint32 drawable_ID)
 
496
{
 
497
  GimpParam *return_vals;
 
498
  gint nreturn_vals;
 
499
  gboolean success = TRUE;
 
500
 
 
501
  return_vals = gimp_run_procedure ("gimp-drawable-delete",
 
502
                                    &nreturn_vals,
 
503
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
504
                                    GIMP_PDB_END);
 
505
 
 
506
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
507
 
 
508
  gimp_destroy_params (return_vals, nreturn_vals);
 
509
 
 
510
  return success;
 
511
}
 
512
 
 
513
/**
480
514
 * gimp_drawable_get_image:
481
515
 * @drawable_ID: The drawable.
482
516
 *
493
527
  gint nreturn_vals;
494
528
  gint32 image_ID = -1;
495
529
 
496
 
  return_vals = gimp_run_procedure ("gimp_drawable_get_image",
497
 
                                    &nreturn_vals,
498
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
499
 
                                    GIMP_PDB_END);
 
530
  return_vals = gimp_run_procedure ("gimp-drawable-get-image",
 
531
                                    &nreturn_vals,
 
532
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
533
                                    GIMP_PDB_END);
500
534
 
501
535
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
502
536
    image_ID = return_vals[1].data.d_image;
517
551
 */
518
552
gboolean
519
553
gimp_drawable_set_image (gint32 drawable_ID,
520
 
                         gint32 image_ID)
 
554
                         gint32 image_ID)
521
555
{
522
556
  GimpParam *return_vals;
523
557
  gint nreturn_vals;
524
558
  gboolean success = TRUE;
525
559
 
526
 
  return_vals = gimp_run_procedure ("gimp_drawable_set_image",
527
 
                                    &nreturn_vals,
528
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
529
 
                                    GIMP_PDB_IMAGE, image_ID,
530
 
                                    GIMP_PDB_END);
 
560
  return_vals = gimp_run_procedure ("gimp-drawable-set-image",
 
561
                                    &nreturn_vals,
 
562
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
563
                                    GIMP_PDB_IMAGE, image_ID,
 
564
                                    GIMP_PDB_END);
531
565
 
532
566
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
533
567
 
553
587
  gint nreturn_vals;
554
588
  gchar *name = NULL;
555
589
 
556
 
  return_vals = gimp_run_procedure ("gimp_drawable_get_name",
557
 
                                    &nreturn_vals,
558
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
559
 
                                    GIMP_PDB_END);
 
590
  return_vals = gimp_run_procedure ("gimp-drawable-get-name",
 
591
                                    &nreturn_vals,
 
592
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
593
                                    GIMP_PDB_END);
560
594
 
561
595
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
562
596
    name = g_strdup (return_vals[1].data.d_string);
579
613
 */
580
614
gboolean
581
615
gimp_drawable_set_name (gint32       drawable_ID,
582
 
                        const gchar *name)
 
616
                        const gchar *name)
583
617
{
584
618
  GimpParam *return_vals;
585
619
  gint nreturn_vals;
586
620
  gboolean success = TRUE;
587
621
 
588
 
  return_vals = gimp_run_procedure ("gimp_drawable_set_name",
589
 
                                    &nreturn_vals,
590
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
591
 
                                    GIMP_PDB_STRING, name,
592
 
                                    GIMP_PDB_END);
 
622
  return_vals = gimp_run_procedure ("gimp-drawable-set-name",
 
623
                                    &nreturn_vals,
 
624
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
625
                                    GIMP_PDB_STRING, name,
 
626
                                    GIMP_PDB_END);
593
627
 
594
628
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
595
629
 
615
649
  gint nreturn_vals;
616
650
  gboolean visible = FALSE;
617
651
 
618
 
  return_vals = gimp_run_procedure ("gimp_drawable_get_visible",
619
 
                                    &nreturn_vals,
620
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
621
 
                                    GIMP_PDB_END);
 
652
  return_vals = gimp_run_procedure ("gimp-drawable-get-visible",
 
653
                                    &nreturn_vals,
 
654
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
655
                                    GIMP_PDB_END);
622
656
 
623
657
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
624
658
    visible = return_vals[1].data.d_int32;
641
675
 */
642
676
gboolean
643
677
gimp_drawable_set_visible (gint32   drawable_ID,
644
 
                           gboolean visible)
 
678
                           gboolean visible)
645
679
{
646
680
  GimpParam *return_vals;
647
681
  gint nreturn_vals;
648
682
  gboolean success = TRUE;
649
683
 
650
 
  return_vals = gimp_run_procedure ("gimp_drawable_set_visible",
651
 
                                    &nreturn_vals,
652
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
653
 
                                    GIMP_PDB_INT32, visible,
654
 
                                    GIMP_PDB_END);
 
684
  return_vals = gimp_run_procedure ("gimp-drawable-set-visible",
 
685
                                    &nreturn_vals,
 
686
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
687
                                    GIMP_PDB_INT32, visible,
 
688
                                    GIMP_PDB_END);
655
689
 
656
690
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
657
691
 
677
711
  gint nreturn_vals;
678
712
  gboolean linked = FALSE;
679
713
 
680
 
  return_vals = gimp_run_procedure ("gimp_drawable_get_linked",
681
 
                                    &nreturn_vals,
682
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
683
 
                                    GIMP_PDB_END);
 
714
  return_vals = gimp_run_procedure ("gimp-drawable-get-linked",
 
715
                                    &nreturn_vals,
 
716
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
717
                                    GIMP_PDB_END);
684
718
 
685
719
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
686
720
    linked = return_vals[1].data.d_int32;
703
737
 */
704
738
gboolean
705
739
gimp_drawable_set_linked (gint32   drawable_ID,
706
 
                          gboolean linked)
 
740
                          gboolean linked)
707
741
{
708
742
  GimpParam *return_vals;
709
743
  gint nreturn_vals;
710
744
  gboolean success = TRUE;
711
745
 
712
 
  return_vals = gimp_run_procedure ("gimp_drawable_set_linked",
713
 
                                    &nreturn_vals,
714
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
715
 
                                    GIMP_PDB_INT32, linked,
716
 
                                    GIMP_PDB_END);
 
746
  return_vals = gimp_run_procedure ("gimp-drawable-set-linked",
 
747
                                    &nreturn_vals,
 
748
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
749
                                    GIMP_PDB_INT32, linked,
 
750
                                    GIMP_PDB_END);
717
751
 
718
752
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
719
753
 
731
765
 * This procedure returns the specified drawable's tattoo. A tattoo is
732
766
 * a unique and permanent identifier attached to a drawable that can be
733
767
 * used to uniquely identify a drawable within an image even between
734
 
 * sessions
 
768
 * sessions.
735
769
 *
736
770
 * Returns: The drawable tattoo.
737
771
 */
742
776
  gint nreturn_vals;
743
777
  gint tattoo = 0;
744
778
 
745
 
  return_vals = gimp_run_procedure ("gimp_drawable_get_tattoo",
746
 
                                    &nreturn_vals,
747
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
748
 
                                    GIMP_PDB_END);
 
779
  return_vals = gimp_run_procedure ("gimp-drawable-get-tattoo",
 
780
                                    &nreturn_vals,
 
781
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
782
                                    GIMP_PDB_END);
749
783
 
750
784
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
751
785
    tattoo = return_vals[1].data.d_tattoo;
765
799
 * This procedure sets the specified drawable's tattoo. A tattoo is a
766
800
 * unique and permanent identifier attached to a drawable that can be
767
801
 * used to uniquely identify a drawable within an image even between
768
 
 * sessions
 
802
 * sessions.
769
803
 *
770
804
 * Returns: TRUE on success.
771
805
 */
772
806
gboolean
773
807
gimp_drawable_set_tattoo (gint32 drawable_ID,
774
 
                          gint   tattoo)
 
808
                          gint   tattoo)
775
809
{
776
810
  GimpParam *return_vals;
777
811
  gint nreturn_vals;
778
812
  gboolean success = TRUE;
779
813
 
780
 
  return_vals = gimp_run_procedure ("gimp_drawable_set_tattoo",
781
 
                                    &nreturn_vals,
782
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
783
 
                                    GIMP_PDB_INT32, tattoo,
784
 
                                    GIMP_PDB_END);
 
814
  return_vals = gimp_run_procedure ("gimp-drawable-set-tattoo",
 
815
                                    &nreturn_vals,
 
816
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
817
                                    GIMP_PDB_INT32, tattoo,
 
818
                                    GIMP_PDB_END);
785
819
 
786
820
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
787
821
 
802
836
 * specified drawable.
803
837
 *
804
838
 * This procedure returns whether there is a selection. If there is
805
 
 * one, the upper left and lower righthand corners of its bounding box
 
839
 * one, the upper left and lower right-hand corners of its bounding box
806
840
 * are returned. These coordinates are specified relative to the
807
841
 * drawable's origin, and bounded by the drawable's extents. Please
808
 
 * note that the pixel specified by the lower righthand coordinate of
 
842
 * note that the pixel specified by the lower right-hand coordinate of
809
843
 * the bounding box is not part of the selection. The selection ends at
810
844
 * the upper left corner of this pixel. This means the width of the
811
845
 * selection can be calculated as (x2 - x1), its height as (y2 - y1).
818
852
 */
819
853
gboolean
820
854
gimp_drawable_mask_bounds (gint32  drawable_ID,
821
 
                           gint   *x1,
822
 
                           gint   *y1,
823
 
                           gint   *x2,
824
 
                           gint   *y2)
 
855
                           gint   *x1,
 
856
                           gint   *y1,
 
857
                           gint   *x2,
 
858
                           gint   *y2)
825
859
{
826
860
  GimpParam *return_vals;
827
861
  gint nreturn_vals;
828
862
  gboolean non_empty = FALSE;
829
863
 
830
 
  return_vals = gimp_run_procedure ("gimp_drawable_mask_bounds",
831
 
                                    &nreturn_vals,
832
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
833
 
                                    GIMP_PDB_END);
 
864
  return_vals = gimp_run_procedure ("gimp-drawable-mask-bounds",
 
865
                                    &nreturn_vals,
 
866
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
867
                                    GIMP_PDB_END);
834
868
 
835
869
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
836
870
    {
869
903
 */
870
904
gboolean
871
905
gimp_drawable_mask_intersect (gint32  drawable_ID,
872
 
                              gint   *x,
873
 
                              gint   *y,
874
 
                              gint   *width,
875
 
                              gint   *height)
 
906
                              gint   *x,
 
907
                              gint   *y,
 
908
                              gint   *width,
 
909
                              gint   *height)
876
910
{
877
911
  GimpParam *return_vals;
878
912
  gint nreturn_vals;
879
913
  gboolean non_empty = FALSE;
880
914
 
881
 
  return_vals = gimp_run_procedure ("gimp_drawable_mask_intersect",
882
 
                                    &nreturn_vals,
883
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
884
 
                                    GIMP_PDB_END);
 
915
  return_vals = gimp_run_procedure ("gimp-drawable-mask-intersect",
 
916
                                    &nreturn_vals,
 
917
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
918
                                    GIMP_PDB_END);
885
919
 
886
920
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
887
921
    {
905
939
 * Merge the shadow buffer with the specified drawable.
906
940
 *
907
941
 * This procedure combines the contents of the image's shadow buffer
908
 
 * (for temporary processing) with the specified drawable. The \"undo\"
 
942
 * (for temporary processing) with the specified drawable. The 'undo'
909
943
 * parameter specifies whether to add an undo step for the operation.
910
944
 * Requesting no undo is useful for such applications as 'auto-apply'.
911
945
 *
913
947
 */
914
948
gboolean
915
949
gimp_drawable_merge_shadow (gint32   drawable_ID,
916
 
                            gboolean undo)
 
950
                            gboolean undo)
917
951
{
918
952
  GimpParam *return_vals;
919
953
  gint nreturn_vals;
920
954
  gboolean success = TRUE;
921
955
 
922
 
  return_vals = gimp_run_procedure ("gimp_drawable_merge_shadow",
923
 
                                    &nreturn_vals,
924
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
925
 
                                    GIMP_PDB_INT32, undo,
926
 
                                    GIMP_PDB_END);
 
956
  return_vals = gimp_run_procedure ("gimp-drawable-merge-shadow",
 
957
                                    &nreturn_vals,
 
958
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
959
                                    GIMP_PDB_INT32, undo,
 
960
                                    GIMP_PDB_END);
927
961
 
928
962
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
929
963
 
951
985
 */
952
986
gboolean
953
987
gimp_drawable_update (gint32 drawable_ID,
954
 
                      gint   x,
955
 
                      gint   y,
956
 
                      gint   width,
957
 
                      gint   height)
 
988
                      gint   x,
 
989
                      gint   y,
 
990
                      gint   width,
 
991
                      gint   height)
958
992
{
959
993
  GimpParam *return_vals;
960
994
  gint nreturn_vals;
961
995
  gboolean success = TRUE;
962
996
 
963
 
  return_vals = gimp_run_procedure ("gimp_drawable_update",
964
 
                                    &nreturn_vals,
965
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
966
 
                                    GIMP_PDB_INT32, x,
967
 
                                    GIMP_PDB_INT32, y,
968
 
                                    GIMP_PDB_INT32, width,
969
 
                                    GIMP_PDB_INT32, height,
970
 
                                    GIMP_PDB_END);
 
997
  return_vals = gimp_run_procedure ("gimp-drawable-update",
 
998
                                    &nreturn_vals,
 
999
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
1000
                                    GIMP_PDB_INT32, x,
 
1001
                                    GIMP_PDB_INT32, y,
 
1002
                                    GIMP_PDB_INT32, width,
 
1003
                                    GIMP_PDB_INT32, height,
 
1004
                                    GIMP_PDB_END);
971
1005
 
972
1006
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
973
1007
 
993
1027
 */
994
1028
guint8 *
995
1029
gimp_drawable_get_pixel (gint32  drawable_ID,
996
 
                         gint    x_coord,
997
 
                         gint    y_coord,
998
 
                         gint   *num_channels)
 
1030
                         gint    x_coord,
 
1031
                         gint    y_coord,
 
1032
                         gint   *num_channels)
999
1033
{
1000
1034
  GimpParam *return_vals;
1001
1035
  gint nreturn_vals;
1002
1036
  guint8 *pixel = NULL;
1003
1037
 
1004
 
  return_vals = gimp_run_procedure ("gimp_drawable_get_pixel",
1005
 
                                    &nreturn_vals,
1006
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
1007
 
                                    GIMP_PDB_INT32, x_coord,
1008
 
                                    GIMP_PDB_INT32, y_coord,
1009
 
                                    GIMP_PDB_END);
 
1038
  return_vals = gimp_run_procedure ("gimp-drawable-get-pixel",
 
1039
                                    &nreturn_vals,
 
1040
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
1041
                                    GIMP_PDB_INT32, x_coord,
 
1042
                                    GIMP_PDB_INT32, y_coord,
 
1043
                                    GIMP_PDB_END);
1010
1044
 
1011
1045
  *num_channels = 0;
1012
1046
 
1014
1048
    {
1015
1049
      *num_channels = return_vals[1].data.d_int32;
1016
1050
      pixel = g_new (guint8, *num_channels);
1017
 
      memcpy (pixel, return_vals[2].data.d_int8array,
1018
 
              *num_channels * sizeof (guint8));
 
1051
      memcpy (pixel,
 
1052
              return_vals[2].data.d_int8array,
 
1053
              *num_channels * sizeof (guint8));
1019
1054
    }
1020
1055
 
1021
1056
  gimp_destroy_params (return_vals, nreturn_vals);
1035
1070
 *
1036
1071
 * This procedure sets the pixel value at the specified coordinates.
1037
1072
 * The 'num_channels' argument must always be equal to the
1038
 
 * bytes-per-pixel value for the spec ified drawable. Note that this
 
1073
 * bytes-per-pixel value for the specified drawable. Note that this
1039
1074
 * function is not undoable, you should use it only on drawables you
1040
1075
 * just created yourself.
1041
1076
 *
1043
1078
 */
1044
1079
gboolean
1045
1080
gimp_drawable_set_pixel (gint32        drawable_ID,
1046
 
                         gint          x_coord,
1047
 
                         gint          y_coord,
1048
 
                         gint          num_channels,
1049
 
                         const guint8 *pixel)
 
1081
                         gint          x_coord,
 
1082
                         gint          y_coord,
 
1083
                         gint          num_channels,
 
1084
                         const guint8 *pixel)
1050
1085
{
1051
1086
  GimpParam *return_vals;
1052
1087
  gint nreturn_vals;
1053
1088
  gboolean success = TRUE;
1054
1089
 
1055
 
  return_vals = gimp_run_procedure ("gimp_drawable_set_pixel",
1056
 
                                    &nreturn_vals,
1057
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
1058
 
                                    GIMP_PDB_INT32, x_coord,
1059
 
                                    GIMP_PDB_INT32, y_coord,
1060
 
                                    GIMP_PDB_INT32, num_channels,
1061
 
                                    GIMP_PDB_INT8ARRAY, pixel,
1062
 
                                    GIMP_PDB_END);
 
1090
  return_vals = gimp_run_procedure ("gimp-drawable-set-pixel",
 
1091
                                    &nreturn_vals,
 
1092
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
1093
                                    GIMP_PDB_INT32, x_coord,
 
1094
                                    GIMP_PDB_INT32, y_coord,
 
1095
                                    GIMP_PDB_INT32, num_channels,
 
1096
                                    GIMP_PDB_INT8ARRAY, pixel,
 
1097
                                    GIMP_PDB_END);
1063
1098
 
1064
1099
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1065
1100
 
1075
1110
 *
1076
1111
 * Fill the drawable with the specified fill mode.
1077
1112
 *
1078
 
 * This procedure fills the drawable with the fill mode. If the fill
1079
 
 * mode is foreground the current foreground color is used. If the fill
1080
 
 * mode is background, the current background color is used. If the
1081
 
 * fill type is white, then white is used. Transparent fill only
1082
 
 * affects layers with an alpha channel, in which case the alpha
1083
 
 * channel is set to transparent. If the drawable has no alpha channel,
1084
 
 * it is filled to white. No fill leaves the drawable's contents
1085
 
 * undefined. This procedure is unlike the bucket fill tool because it
1086
 
 * fills regardless of a selection
 
1113
 * This procedure fills the drawable. If the fill mode is foreground
 
1114
 * the current foreground color is used. If the fill mode is
 
1115
 * background, the current background color is used. If the fill type
 
1116
 * is white, then white is used. Transparent fill only affects layers
 
1117
 * with an alpha channel, in which case the alpha channel is set to
 
1118
 * transparent. If the drawable has no alpha channel, it is filled to
 
1119
 * white. No fill leaves the drawable's contents undefined. This
 
1120
 * procedure is unlike the bucket fill tool because it fills regardless
 
1121
 * of a selection. Its main purpose is to fill a newly created drawable
 
1122
 * before adding it to the image. This operation cannot be undone.
1087
1123
 *
1088
1124
 * Returns: TRUE on success.
1089
1125
 */
1090
1126
gboolean
1091
1127
gimp_drawable_fill (gint32       drawable_ID,
1092
 
                    GimpFillType fill_type)
 
1128
                    GimpFillType fill_type)
1093
1129
{
1094
1130
  GimpParam *return_vals;
1095
1131
  gint nreturn_vals;
1096
1132
  gboolean success = TRUE;
1097
1133
 
1098
 
  return_vals = gimp_run_procedure ("gimp_drawable_fill",
1099
 
                                    &nreturn_vals,
1100
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
1101
 
                                    GIMP_PDB_INT32, fill_type,
1102
 
                                    GIMP_PDB_END);
 
1134
  return_vals = gimp_run_procedure ("gimp-drawable-fill",
 
1135
                                    &nreturn_vals,
 
1136
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
1137
                                    GIMP_PDB_INT32, fill_type,
 
1138
                                    GIMP_PDB_END);
1103
1139
 
1104
1140
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1105
1141
 
1124
1160
 * TRUE, then portions of the drawable which are offset out of bounds
1125
1161
 * are wrapped around. Alternatively, the undefined regions of the
1126
1162
 * drawable can be filled with transparency or the background color, as
1127
 
 * specified by the 'fill_type' parameter.
 
1163
 * specified by the 'fill-type' parameter.
1128
1164
 *
1129
1165
 * Returns: TRUE on success.
1130
1166
 */
1131
1167
gboolean
1132
1168
gimp_drawable_offset (gint32         drawable_ID,
1133
 
                      gboolean       wrap_around,
1134
 
                      GimpOffsetType fill_type,
1135
 
                      gint           offset_x,
1136
 
                      gint           offset_y)
 
1169
                      gboolean       wrap_around,
 
1170
                      GimpOffsetType fill_type,
 
1171
                      gint           offset_x,
 
1172
                      gint           offset_y)
1137
1173
{
1138
1174
  GimpParam *return_vals;
1139
1175
  gint nreturn_vals;
1140
1176
  gboolean success = TRUE;
1141
1177
 
1142
 
  return_vals = gimp_run_procedure ("gimp_drawable_offset",
1143
 
                                    &nreturn_vals,
1144
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
1145
 
                                    GIMP_PDB_INT32, wrap_around,
1146
 
                                    GIMP_PDB_INT32, fill_type,
1147
 
                                    GIMP_PDB_INT32, offset_x,
1148
 
                                    GIMP_PDB_INT32, offset_y,
1149
 
                                    GIMP_PDB_END);
 
1178
  return_vals = gimp_run_procedure ("gimp-drawable-offset",
 
1179
                                    &nreturn_vals,
 
1180
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
1181
                                    GIMP_PDB_INT32, wrap_around,
 
1182
                                    GIMP_PDB_INT32, fill_type,
 
1183
                                    GIMP_PDB_INT32, offset_x,
 
1184
                                    GIMP_PDB_INT32, offset_y,
 
1185
                                    GIMP_PDB_END);
1150
1186
 
1151
1187
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1152
1188
 
1158
1194
/**
1159
1195
 * _gimp_drawable_thumbnail:
1160
1196
 * @drawable_ID: The drawable.
1161
 
 * @width: The thumbnail width.
1162
 
 * @height: The thumbnail height.
1163
 
 * @ret_width: The previews width.
1164
 
 * @ret_height: The previews height.
 
1197
 * @width: The requested thumbnail width.
 
1198
 * @height: The requested thumbnail height.
 
1199
 * @actual_width: The previews width.
 
1200
 * @actual_height: The previews height.
1165
1201
 * @bpp: The previews bpp.
1166
1202
 * @thumbnail_data_count: The number of bytes in thumbnail data.
1167
1203
 * @thumbnail_data: The thumbnail data.
1169
1205
 * Get a thumbnail of a drawable.
1170
1206
 *
1171
1207
 * This function gets data from which a thumbnail of a drawable preview
1172
 
 * can be created. Maximum x or y dimension is 512 pixels. The pixels
 
1208
 * can be created. Maximum x or y dimension is 1024 pixels. The pixels
1173
1209
 * are returned in RGB[A] or GRAY[A] format. The bpp return value gives
1174
1210
 * the number of bytes in the image.
1175
1211
 *
1177
1213
 */
1178
1214
gboolean
1179
1215
_gimp_drawable_thumbnail (gint32   drawable_ID,
1180
 
                          gint     width,
1181
 
                          gint     height,
1182
 
                          gint    *ret_width,
1183
 
                          gint    *ret_height,
1184
 
                          gint    *bpp,
1185
 
                          gint    *thumbnail_data_count,
1186
 
                          guint8 **thumbnail_data)
 
1216
                          gint     width,
 
1217
                          gint     height,
 
1218
                          gint    *actual_width,
 
1219
                          gint    *actual_height,
 
1220
                          gint    *bpp,
 
1221
                          gint    *thumbnail_data_count,
 
1222
                          guint8 **thumbnail_data)
1187
1223
{
1188
1224
  GimpParam *return_vals;
1189
1225
  gint nreturn_vals;
1190
1226
  gboolean success = TRUE;
1191
1227
 
1192
 
  return_vals = gimp_run_procedure ("gimp_drawable_thumbnail",
1193
 
                                    &nreturn_vals,
1194
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
1195
 
                                    GIMP_PDB_INT32, width,
1196
 
                                    GIMP_PDB_INT32, height,
1197
 
                                    GIMP_PDB_END);
 
1228
  return_vals = gimp_run_procedure ("gimp-drawable-thumbnail",
 
1229
                                    &nreturn_vals,
 
1230
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
1231
                                    GIMP_PDB_INT32, width,
 
1232
                                    GIMP_PDB_INT32, height,
 
1233
                                    GIMP_PDB_END);
1198
1234
 
1199
 
  *ret_width = 0;
1200
 
  *ret_height = 0;
 
1235
  *actual_width = 0;
 
1236
  *actual_height = 0;
1201
1237
  *bpp = 0;
1202
1238
  *thumbnail_data_count = 0;
1203
1239
  *thumbnail_data = NULL;
1206
1242
 
1207
1243
  if (success)
1208
1244
    {
1209
 
      *ret_width = return_vals[1].data.d_int32;
1210
 
      *ret_height = return_vals[2].data.d_int32;
 
1245
      *actual_width = return_vals[1].data.d_int32;
 
1246
      *actual_height = return_vals[2].data.d_int32;
1211
1247
      *bpp = return_vals[3].data.d_int32;
1212
1248
      *thumbnail_data_count = return_vals[4].data.d_int32;
1213
1249
      *thumbnail_data = g_new (guint8, *thumbnail_data_count);
1214
 
      memcpy (*thumbnail_data, return_vals[5].data.d_int8array,
1215
 
              *thumbnail_data_count * sizeof (guint8));
 
1250
      memcpy (*thumbnail_data,
 
1251
              return_vals[5].data.d_int8array,
 
1252
              *thumbnail_data_count * sizeof (guint8));
1216
1253
    }
1217
1254
 
1218
1255
  gimp_destroy_params (return_vals, nreturn_vals);
1238
1275
 * Get a thumbnail of a sub-area of a drawable drawable.
1239
1276
 *
1240
1277
 * This function gets data from which a thumbnail of a drawable preview
1241
 
 * can be created. Maximum x or y dimension is 512 pixels. The pixels
 
1278
 * can be created. Maximum x or y dimension is 1024 pixels. The pixels
1242
1279
 * are returned in RGB[A] or GRAY[A] format. The bpp return value gives
1243
1280
 * the number of bytes in the image.
1244
1281
 *
1248
1285
 */
1249
1286
gboolean
1250
1287
_gimp_drawable_sub_thumbnail (gint32   drawable_ID,
1251
 
                              gint     src_x,
1252
 
                              gint     src_y,
1253
 
                              gint     src_width,
1254
 
                              gint     src_height,
1255
 
                              gint     dest_width,
1256
 
                              gint     dest_height,
1257
 
                              gint    *width,
1258
 
                              gint    *height,
1259
 
                              gint    *bpp,
1260
 
                              gint    *thumbnail_data_count,
1261
 
                              guint8 **thumbnail_data)
 
1288
                              gint     src_x,
 
1289
                              gint     src_y,
 
1290
                              gint     src_width,
 
1291
                              gint     src_height,
 
1292
                              gint     dest_width,
 
1293
                              gint     dest_height,
 
1294
                              gint    *width,
 
1295
                              gint    *height,
 
1296
                              gint    *bpp,
 
1297
                              gint    *thumbnail_data_count,
 
1298
                              guint8 **thumbnail_data)
1262
1299
{
1263
1300
  GimpParam *return_vals;
1264
1301
  gint nreturn_vals;
1265
1302
  gboolean success = TRUE;
1266
1303
 
1267
 
  return_vals = gimp_run_procedure ("gimp_drawable_sub_thumbnail",
1268
 
                                    &nreturn_vals,
1269
 
                                    GIMP_PDB_DRAWABLE, drawable_ID,
1270
 
                                    GIMP_PDB_INT32, src_x,
1271
 
                                    GIMP_PDB_INT32, src_y,
1272
 
                                    GIMP_PDB_INT32, src_width,
1273
 
                                    GIMP_PDB_INT32, src_height,
1274
 
                                    GIMP_PDB_INT32, dest_width,
1275
 
                                    GIMP_PDB_INT32, dest_height,
1276
 
                                    GIMP_PDB_END);
 
1304
  return_vals = gimp_run_procedure ("gimp-drawable-sub-thumbnail",
 
1305
                                    &nreturn_vals,
 
1306
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
1307
                                    GIMP_PDB_INT32, src_x,
 
1308
                                    GIMP_PDB_INT32, src_y,
 
1309
                                    GIMP_PDB_INT32, src_width,
 
1310
                                    GIMP_PDB_INT32, src_height,
 
1311
                                    GIMP_PDB_INT32, dest_width,
 
1312
                                    GIMP_PDB_INT32, dest_height,
 
1313
                                    GIMP_PDB_END);
1277
1314
 
1278
1315
  *width = 0;
1279
1316
  *height = 0;
1290
1327
      *bpp = return_vals[3].data.d_int32;
1291
1328
      *thumbnail_data_count = return_vals[4].data.d_int32;
1292
1329
      *thumbnail_data = g_new (guint8, *thumbnail_data_count);
1293
 
      memcpy (*thumbnail_data, return_vals[5].data.d_int8array,
1294
 
              *thumbnail_data_count * sizeof (guint8));
 
1330
      memcpy (*thumbnail_data,
 
1331
              return_vals[5].data.d_int8array,
 
1332
              *thumbnail_data_count * sizeof (guint8));
1295
1333
    }
1296
1334
 
1297
1335
  gimp_destroy_params (return_vals, nreturn_vals);
1298
1336
 
1299
1337
  return success;
1300
1338
}
 
1339
 
 
1340
/**
 
1341
 * gimp_drawable_foreground_extract:
 
1342
 * @drawable_ID: The drawable.
 
1343
 * @mode: The algorithm to use.
 
1344
 * @mask_ID: Tri-Map.
 
1345
 *
 
1346
 * Extract the foreground of a drawable using a given trimap.
 
1347
 *
 
1348
 * Image Segmentation by Uniform Color Clustering, see
 
1349
 * http://www.inf.fu-berlin.de/inst/pubs/tr-b-05-07.pdf
 
1350
 *
 
1351
 * Returns: TRUE on success.
 
1352
 *
 
1353
 * Since: GIMP 2.4
 
1354
 */
 
1355
gboolean
 
1356
gimp_drawable_foreground_extract (gint32                    drawable_ID,
 
1357
                                  GimpForegroundExtractMode mode,
 
1358
                                  gint32                    mask_ID)
 
1359
{
 
1360
  GimpParam *return_vals;
 
1361
  gint nreturn_vals;
 
1362
  gboolean success = TRUE;
 
1363
 
 
1364
  return_vals = gimp_run_procedure ("gimp-drawable-foreground-extract",
 
1365
                                    &nreturn_vals,
 
1366
                                    GIMP_PDB_DRAWABLE, drawable_ID,
 
1367
                                    GIMP_PDB_INT32, mode,
 
1368
                                    GIMP_PDB_DRAWABLE, mask_ID,
 
1369
                                    GIMP_PDB_END);
 
1370
 
 
1371
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
1372
 
 
1373
  gimp_destroy_params (return_vals, nreturn_vals);
 
1374
 
 
1375
  return success;
 
1376
}