19
19
* Boston, MA 02111-1307, USA.
22
/* NOTE: This file is autogenerated by pdbgen.pl */
22
/* NOTE: This file is auto-generated by pdbgen.pl */
24
24
#include "config.h"
26
26
#include <string.h>
29
#undef GIMP_DISABLE_DEPRECATED
30
#undef __GIMP_DRAWABLE_PDB_H__
31
#include "gimpdrawable_pdb.h"
31
* gimp_drawable_delete:
32
* @drawable_ID: The drawable to delete.
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.
42
* Returns: TRUE on success.
34
* gimp_drawable_is_valid:
35
* @drawable_ID: The drawable to check.
37
* Returns TRUE if the drawable is valid.
39
* This procedure checks if the given drawable ID is valid and refers
40
* to an existing drawable.
42
* Returns: Whether the drawable ID is valid.
45
gimp_drawable_delete (gint32 drawable_ID)
47
gimp_drawable_is_valid (gint32 drawable_ID)
47
49
GimpParam *return_vals;
49
gboolean success = TRUE;
51
return_vals = gimp_run_procedure ("gimp_drawable_delete",
53
GIMP_PDB_DRAWABLE, drawable_ID,
56
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
51
gboolean valid = FALSE;
53
return_vals = gimp_run_procedure ("gimp-drawable-is-valid",
55
GIMP_PDB_DRAWABLE, drawable_ID,
58
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
59
valid = return_vals[1].data.d_int32;
58
61
gimp_destroy_params (return_vals, nreturn_vals);
67
70
* Returns whether the drawable is a layer.
69
* This procedure returns non-zero if the specified drawable is a
72
* This procedure returns TRUE if the specified drawable is a layer.
72
* Returns: Non-zero if the drawable is a layer.
74
* Returns: TRUE if the drawable is a layer.
75
77
gimp_drawable_is_layer (gint32 drawable_ID)
79
81
gboolean layer = FALSE;
81
return_vals = gimp_run_procedure ("gimp_drawable_is_layer",
83
GIMP_PDB_DRAWABLE, drawable_ID,
83
return_vals = gimp_run_procedure ("gimp-drawable-is-layer",
85
GIMP_PDB_DRAWABLE, drawable_ID,
86
88
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
87
89
layer = return_vals[1].data.d_int32;
98
100
* Returns whether the drawable is a layer mask.
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
103
* Returns: Non-zero if the drawable is a layer mask.
105
* Returns: TRUE if the drawable is a layer mask.
106
108
gimp_drawable_is_layer_mask (gint32 drawable_ID)
109
111
gint nreturn_vals;
110
112
gboolean layer_mask = FALSE;
112
return_vals = gimp_run_procedure ("gimp_drawable_is_layer_mask",
114
GIMP_PDB_DRAWABLE, drawable_ID,
114
return_vals = gimp_run_procedure ("gimp-drawable-is-layer-mask",
116
GIMP_PDB_DRAWABLE, drawable_ID,
117
119
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
118
120
layer_mask = return_vals[1].data.d_int32;
129
131
* Returns whether the drawable is a channel.
131
* This procedure returns non-zero if the specified drawable is a
133
* This procedure returns TRUE if the specified drawable is a channel.
134
* Returns: Non-zero if the drawable is a channel.
135
* Returns: TRUE if the drawable is a channel.
137
138
gimp_drawable_is_channel (gint32 drawable_ID)
140
141
gint nreturn_vals;
141
142
gboolean channel = FALSE;
143
return_vals = gimp_run_procedure ("gimp_drawable_is_channel",
145
GIMP_PDB_DRAWABLE, drawable_ID,
144
return_vals = gimp_run_procedure ("gimp-drawable-is-channel",
146
GIMP_PDB_DRAWABLE, drawable_ID,
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;
173
return_vals = gimp_run_procedure ("gimp_drawable_type",
175
GIMP_PDB_DRAWABLE, drawable_ID,
174
return_vals = gimp_run_procedure ("gimp-drawable-type",
176
GIMP_PDB_DRAWABLE, drawable_ID,
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;
206
return_vals = gimp_run_procedure ("gimp_drawable_type_with_alpha",
208
GIMP_PDB_DRAWABLE, drawable_ID,
207
return_vals = gimp_run_procedure ("gimp-drawable-type-with-alpha",
209
GIMP_PDB_DRAWABLE, drawable_ID,
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.
223
* Returns non-zero if the drawable has an alpha channel.
224
* Returns TRUE if the drawable has an alpha channel.
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;
238
return_vals = gimp_run_procedure ("gimp_drawable_has_alpha",
240
GIMP_PDB_DRAWABLE, drawable_ID,
239
return_vals = gimp_run_procedure ("gimp-drawable-has-alpha",
241
GIMP_PDB_DRAWABLE, drawable_ID,
243
244
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
244
245
has_alpha = return_vals[1].data.d_int32;
255
256
* Returns whether the drawable is an RGB type.
257
* This procedure returns non-zero if the specified drawable is of type
258
* This procedure returns TRUE if the specified drawable is of type {
260
* Returns: non-zero if the drawable is an RGB type.
261
* Returns: TRUE if the drawable is an RGB type.
263
264
gimp_drawable_is_rgb (gint32 drawable_ID)
266
267
gint nreturn_vals;
267
268
gboolean is_rgb = FALSE;
269
return_vals = gimp_run_procedure ("gimp_drawable_is_rgb",
271
GIMP_PDB_DRAWABLE, drawable_ID,
270
return_vals = gimp_run_procedure ("gimp-drawable-is-rgb",
272
GIMP_PDB_DRAWABLE, drawable_ID,
274
275
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
275
276
is_rgb = return_vals[1].data.d_int32;
286
287
* Returns whether the drawable is a grayscale type.
288
* This procedure returns non-zero if the specified drawable is of type
289
* This procedure returns TRUE if the specified drawable is of type {
291
* Returns: non-zero if the drawable is a grayscale type.
292
* Returns: TRUE if the drawable is a grayscale type.
294
295
gimp_drawable_is_gray (gint32 drawable_ID)
297
298
gint nreturn_vals;
298
299
gboolean is_gray = FALSE;
300
return_vals = gimp_run_procedure ("gimp_drawable_is_gray",
302
GIMP_PDB_DRAWABLE, drawable_ID,
301
return_vals = gimp_run_procedure ("gimp-drawable-is-gray",
303
GIMP_PDB_DRAWABLE, drawable_ID,
305
306
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
306
307
is_gray = return_vals[1].data.d_int32;
317
318
* Returns whether the drawable is an indexed type.
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 }.
322
* Returns: non-zero if the drawable is an indexed type.
323
* Returns: TRUE if the drawable is an indexed type.
325
326
gimp_drawable_is_indexed (gint32 drawable_ID)
328
329
gint nreturn_vals;
329
330
gboolean is_indexed = FALSE;
331
return_vals = gimp_run_procedure ("gimp_drawable_is_indexed",
333
GIMP_PDB_DRAWABLE, drawable_ID,
332
return_vals = gimp_run_procedure ("gimp-drawable-is-indexed",
334
GIMP_PDB_DRAWABLE, drawable_ID,
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;
362
return_vals = gimp_run_procedure ("gimp_drawable_bpp",
364
GIMP_PDB_DRAWABLE, drawable_ID,
363
return_vals = gimp_run_procedure ("gimp-drawable-bpp",
365
GIMP_PDB_DRAWABLE, drawable_ID,
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;
392
return_vals = gimp_run_procedure ("gimp_drawable_width",
394
GIMP_PDB_DRAWABLE, drawable_ID,
393
return_vals = gimp_run_procedure ("gimp-drawable-width",
395
GIMP_PDB_DRAWABLE, drawable_ID,
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;
422
return_vals = gimp_run_procedure ("gimp_drawable_height",
424
GIMP_PDB_DRAWABLE, drawable_ID,
423
return_vals = gimp_run_procedure ("gimp-drawable-height",
425
GIMP_PDB_DRAWABLE, drawable_ID,
427
428
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
428
429
height = return_vals[1].data.d_int32;
450
451
gimp_drawable_offsets (gint32 drawable_ID,
454
455
GimpParam *return_vals;
455
456
gint nreturn_vals;
456
457
gboolean success = TRUE;
458
return_vals = gimp_run_procedure ("gimp_drawable_offsets",
460
GIMP_PDB_DRAWABLE, drawable_ID,
459
return_vals = gimp_run_procedure ("gimp-drawable-offsets",
461
GIMP_PDB_DRAWABLE, drawable_ID,
481
* gimp_drawable_delete:
482
* @drawable_ID: The drawable to delete.
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.
492
* Returns: TRUE on success.
495
gimp_drawable_delete (gint32 drawable_ID)
497
GimpParam *return_vals;
499
gboolean success = TRUE;
501
return_vals = gimp_run_procedure ("gimp-drawable-delete",
503
GIMP_PDB_DRAWABLE, drawable_ID,
506
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
508
gimp_destroy_params (return_vals, nreturn_vals);
480
514
* gimp_drawable_get_image:
481
515
* @drawable_ID: The drawable.
493
527
gint nreturn_vals;
494
528
gint32 image_ID = -1;
496
return_vals = gimp_run_procedure ("gimp_drawable_get_image",
498
GIMP_PDB_DRAWABLE, drawable_ID,
530
return_vals = gimp_run_procedure ("gimp-drawable-get-image",
532
GIMP_PDB_DRAWABLE, drawable_ID,
501
535
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
502
536
image_ID = return_vals[1].data.d_image;
519
553
gimp_drawable_set_image (gint32 drawable_ID,
522
556
GimpParam *return_vals;
523
557
gint nreturn_vals;
524
558
gboolean success = TRUE;
526
return_vals = gimp_run_procedure ("gimp_drawable_set_image",
528
GIMP_PDB_DRAWABLE, drawable_ID,
529
GIMP_PDB_IMAGE, image_ID,
560
return_vals = gimp_run_procedure ("gimp-drawable-set-image",
562
GIMP_PDB_DRAWABLE, drawable_ID,
563
GIMP_PDB_IMAGE, image_ID,
532
566
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
553
587
gint nreturn_vals;
554
588
gchar *name = NULL;
556
return_vals = gimp_run_procedure ("gimp_drawable_get_name",
558
GIMP_PDB_DRAWABLE, drawable_ID,
590
return_vals = gimp_run_procedure ("gimp-drawable-get-name",
592
GIMP_PDB_DRAWABLE, drawable_ID,
561
595
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
562
596
name = g_strdup (return_vals[1].data.d_string);
581
615
gimp_drawable_set_name (gint32 drawable_ID,
584
618
GimpParam *return_vals;
585
619
gint nreturn_vals;
586
620
gboolean success = TRUE;
588
return_vals = gimp_run_procedure ("gimp_drawable_set_name",
590
GIMP_PDB_DRAWABLE, drawable_ID,
591
GIMP_PDB_STRING, name,
622
return_vals = gimp_run_procedure ("gimp-drawable-set-name",
624
GIMP_PDB_DRAWABLE, drawable_ID,
625
GIMP_PDB_STRING, name,
594
628
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
615
649
gint nreturn_vals;
616
650
gboolean visible = FALSE;
618
return_vals = gimp_run_procedure ("gimp_drawable_get_visible",
620
GIMP_PDB_DRAWABLE, drawable_ID,
652
return_vals = gimp_run_procedure ("gimp-drawable-get-visible",
654
GIMP_PDB_DRAWABLE, drawable_ID,
623
657
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
624
658
visible = return_vals[1].data.d_int32;
643
677
gimp_drawable_set_visible (gint32 drawable_ID,
646
680
GimpParam *return_vals;
647
681
gint nreturn_vals;
648
682
gboolean success = TRUE;
650
return_vals = gimp_run_procedure ("gimp_drawable_set_visible",
652
GIMP_PDB_DRAWABLE, drawable_ID,
653
GIMP_PDB_INT32, visible,
684
return_vals = gimp_run_procedure ("gimp-drawable-set-visible",
686
GIMP_PDB_DRAWABLE, drawable_ID,
687
GIMP_PDB_INT32, visible,
656
690
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
677
711
gint nreturn_vals;
678
712
gboolean linked = FALSE;
680
return_vals = gimp_run_procedure ("gimp_drawable_get_linked",
682
GIMP_PDB_DRAWABLE, drawable_ID,
714
return_vals = gimp_run_procedure ("gimp-drawable-get-linked",
716
GIMP_PDB_DRAWABLE, drawable_ID,
685
719
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
686
720
linked = return_vals[1].data.d_int32;
705
739
gimp_drawable_set_linked (gint32 drawable_ID,
708
742
GimpParam *return_vals;
709
743
gint nreturn_vals;
710
744
gboolean success = TRUE;
712
return_vals = gimp_run_procedure ("gimp_drawable_set_linked",
714
GIMP_PDB_DRAWABLE, drawable_ID,
715
GIMP_PDB_INT32, linked,
746
return_vals = gimp_run_procedure ("gimp-drawable-set-linked",
748
GIMP_PDB_DRAWABLE, drawable_ID,
749
GIMP_PDB_INT32, linked,
718
752
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
742
776
gint nreturn_vals;
745
return_vals = gimp_run_procedure ("gimp_drawable_get_tattoo",
747
GIMP_PDB_DRAWABLE, drawable_ID,
779
return_vals = gimp_run_procedure ("gimp-drawable-get-tattoo",
781
GIMP_PDB_DRAWABLE, drawable_ID,
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
770
804
* Returns: TRUE on success.
773
807
gimp_drawable_set_tattoo (gint32 drawable_ID,
776
810
GimpParam *return_vals;
777
811
gint nreturn_vals;
778
812
gboolean success = TRUE;
780
return_vals = gimp_run_procedure ("gimp_drawable_set_tattoo",
782
GIMP_PDB_DRAWABLE, drawable_ID,
783
GIMP_PDB_INT32, tattoo,
814
return_vals = gimp_run_procedure ("gimp-drawable-set-tattoo",
816
GIMP_PDB_DRAWABLE, drawable_ID,
817
GIMP_PDB_INT32, tattoo,
786
820
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
802
836
* specified drawable.
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).
820
854
gimp_drawable_mask_bounds (gint32 drawable_ID,
826
860
GimpParam *return_vals;
827
861
gint nreturn_vals;
828
862
gboolean non_empty = FALSE;
830
return_vals = gimp_run_procedure ("gimp_drawable_mask_bounds",
832
GIMP_PDB_DRAWABLE, drawable_ID,
864
return_vals = gimp_run_procedure ("gimp-drawable-mask-bounds",
866
GIMP_PDB_DRAWABLE, drawable_ID,
835
869
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
871
905
gimp_drawable_mask_intersect (gint32 drawable_ID,
877
911
GimpParam *return_vals;
878
912
gint nreturn_vals;
879
913
gboolean non_empty = FALSE;
881
return_vals = gimp_run_procedure ("gimp_drawable_mask_intersect",
883
GIMP_PDB_DRAWABLE, drawable_ID,
915
return_vals = gimp_run_procedure ("gimp-drawable-mask-intersect",
917
GIMP_PDB_DRAWABLE, drawable_ID,
886
920
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
905
939
* Merge the shadow buffer with the specified drawable.
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'.
915
949
gimp_drawable_merge_shadow (gint32 drawable_ID,
918
952
GimpParam *return_vals;
919
953
gint nreturn_vals;
920
954
gboolean success = TRUE;
922
return_vals = gimp_run_procedure ("gimp_drawable_merge_shadow",
924
GIMP_PDB_DRAWABLE, drawable_ID,
925
GIMP_PDB_INT32, undo,
956
return_vals = gimp_run_procedure ("gimp-drawable-merge-shadow",
958
GIMP_PDB_DRAWABLE, drawable_ID,
959
GIMP_PDB_INT32, undo,
928
962
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
953
987
gimp_drawable_update (gint32 drawable_ID,
959
993
GimpParam *return_vals;
960
994
gint nreturn_vals;
961
995
gboolean success = TRUE;
963
return_vals = gimp_run_procedure ("gimp_drawable_update",
965
GIMP_PDB_DRAWABLE, drawable_ID,
968
GIMP_PDB_INT32, width,
969
GIMP_PDB_INT32, height,
997
return_vals = gimp_run_procedure ("gimp-drawable-update",
999
GIMP_PDB_DRAWABLE, drawable_ID,
1002
GIMP_PDB_INT32, width,
1003
GIMP_PDB_INT32, height,
972
1006
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
995
1029
gimp_drawable_get_pixel (gint32 drawable_ID,
1000
1034
GimpParam *return_vals;
1001
1035
gint nreturn_vals;
1002
1036
guint8 *pixel = NULL;
1004
return_vals = gimp_run_procedure ("gimp_drawable_get_pixel",
1006
GIMP_PDB_DRAWABLE, drawable_ID,
1007
GIMP_PDB_INT32, x_coord,
1008
GIMP_PDB_INT32, y_coord,
1038
return_vals = gimp_run_procedure ("gimp-drawable-get-pixel",
1040
GIMP_PDB_DRAWABLE, drawable_ID,
1041
GIMP_PDB_INT32, x_coord,
1042
GIMP_PDB_INT32, y_coord,
1011
1045
*num_channels = 0;
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));
1052
return_vals[2].data.d_int8array,
1053
*num_channels * sizeof (guint8));
1021
1056
gimp_destroy_params (return_vals, nreturn_vals);
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.
1045
1080
gimp_drawable_set_pixel (gint32 drawable_ID,
1049
const guint8 *pixel)
1084
const guint8 *pixel)
1051
1086
GimpParam *return_vals;
1052
1087
gint nreturn_vals;
1053
1088
gboolean success = TRUE;
1055
return_vals = gimp_run_procedure ("gimp_drawable_set_pixel",
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,
1090
return_vals = gimp_run_procedure ("gimp-drawable-set-pixel",
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,
1064
1099
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1076
1111
* Fill the drawable with the specified fill mode.
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.
1088
1124
* Returns: TRUE on success.
1091
1127
gimp_drawable_fill (gint32 drawable_ID,
1092
GimpFillType fill_type)
1128
GimpFillType fill_type)
1094
1130
GimpParam *return_vals;
1095
1131
gint nreturn_vals;
1096
1132
gboolean success = TRUE;
1098
return_vals = gimp_run_procedure ("gimp_drawable_fill",
1100
GIMP_PDB_DRAWABLE, drawable_ID,
1101
GIMP_PDB_INT32, fill_type,
1134
return_vals = gimp_run_procedure ("gimp-drawable-fill",
1136
GIMP_PDB_DRAWABLE, drawable_ID,
1137
GIMP_PDB_INT32, fill_type,
1104
1140
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
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.
1129
1165
* Returns: TRUE on success.
1132
1168
gimp_drawable_offset (gint32 drawable_ID,
1133
gboolean wrap_around,
1134
GimpOffsetType fill_type,
1169
gboolean wrap_around,
1170
GimpOffsetType fill_type,
1138
1174
GimpParam *return_vals;
1139
1175
gint nreturn_vals;
1140
1176
gboolean success = TRUE;
1142
return_vals = gimp_run_procedure ("gimp_drawable_offset",
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,
1178
return_vals = gimp_run_procedure ("gimp-drawable-offset",
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,
1151
1187
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
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.
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.
1179
1215
_gimp_drawable_thumbnail (gint32 drawable_ID,
1185
gint *thumbnail_data_count,
1186
guint8 **thumbnail_data)
1219
gint *actual_height,
1221
gint *thumbnail_data_count,
1222
guint8 **thumbnail_data)
1188
1224
GimpParam *return_vals;
1189
1225
gint nreturn_vals;
1190
1226
gboolean success = TRUE;
1192
return_vals = gimp_run_procedure ("gimp_drawable_thumbnail",
1194
GIMP_PDB_DRAWABLE, drawable_ID,
1195
GIMP_PDB_INT32, width,
1196
GIMP_PDB_INT32, height,
1228
return_vals = gimp_run_procedure ("gimp-drawable-thumbnail",
1230
GIMP_PDB_DRAWABLE, drawable_ID,
1231
GIMP_PDB_INT32, width,
1232
GIMP_PDB_INT32, height,
1202
1238
*thumbnail_data_count = 0;
1203
1239
*thumbnail_data = NULL;
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));
1218
1255
gimp_destroy_params (return_vals, nreturn_vals);
1238
1275
* Get a thumbnail of a sub-area of a drawable drawable.
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.
1250
1287
_gimp_drawable_sub_thumbnail (gint32 drawable_ID,
1260
gint *thumbnail_data_count,
1261
guint8 **thumbnail_data)
1297
gint *thumbnail_data_count,
1298
guint8 **thumbnail_data)
1263
1300
GimpParam *return_vals;
1264
1301
gint nreturn_vals;
1265
1302
gboolean success = TRUE;
1267
return_vals = gimp_run_procedure ("gimp_drawable_sub_thumbnail",
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,
1304
return_vals = gimp_run_procedure ("gimp-drawable-sub-thumbnail",
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,
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));
1297
1335
gimp_destroy_params (return_vals, nreturn_vals);
1299
1337
return success;
1341
* gimp_drawable_foreground_extract:
1342
* @drawable_ID: The drawable.
1343
* @mode: The algorithm to use.
1344
* @mask_ID: Tri-Map.
1346
* Extract the foreground of a drawable using a given trimap.
1348
* Image Segmentation by Uniform Color Clustering, see
1349
* http://www.inf.fu-berlin.de/inst/pubs/tr-b-05-07.pdf
1351
* Returns: TRUE on success.
1356
gimp_drawable_foreground_extract (gint32 drawable_ID,
1357
GimpForegroundExtractMode mode,
1360
GimpParam *return_vals;
1362
gboolean success = TRUE;
1364
return_vals = gimp_run_procedure ("gimp-drawable-foreground-extract",
1366
GIMP_PDB_DRAWABLE, drawable_ID,
1367
GIMP_PDB_INT32, mode,
1368
GIMP_PDB_DRAWABLE, mask_ID,
1371
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
1373
gimp_destroy_params (return_vals, nreturn_vals);