1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gimplayer</title><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="GIMP Library Reference Manual"><link rel="up" href="libgimp-image.html" title="Manupulating Images and all their Properties"><link rel="prev" href="libgimp-gimpimage.html" title="gimpimage"><link rel="next" href="libgimp-gimppaths.html" title="gimppaths"><meta name="generator" content="GTK-Doc V1.2 (XML mode)"><style type="text/css">
2
.synopsis, .classsynopsis {
4
border: solid 1px #aaaaaa;
9
border: solid 1px #aaaaff;
18
border: solid 1px #ffaaaa;
25
.navigation a:visited {
31
</style></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libgimp-gimpimage.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="libgimp-image.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GIMP Library Reference Manual</th><td><a accesskey="n" href="libgimp-gimppaths.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="libgimp-gimplayer"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">gimplayer</span></h2><p>gimplayer — Operations on a single layer.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
36
href="../glib/glib-Basic-Types.html#gint32"
37
>gint32</a> <a href="libgimp-gimplayer.html#gimp-layer-new">gimp_layer_new</a> (<a
38
href="../glib/glib-Basic-Types.html#gint32"
41
href="../glib/glib-Basic-Types.html#gchar"
44
href="../glib/glib-Basic-Types.html#gint"
47
href="../glib/glib-Basic-Types.html#gint"
50
href="../libgimpbase/libgimpbase-gimpbaseenums.html#GimpImageType"
51
>GimpImageType</a> type,
53
href="../glib/glib-Basic-Types.html#gdouble"
55
<a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> mode);
57
href="../glib/glib-Basic-Types.html#gint32"
58
>gint32</a> <a href="libgimp-gimplayer.html#gimp-layer-copy">gimp_layer_copy</a> (<a
59
href="../glib/glib-Basic-Types.html#gint32"
60
>gint32</a> layer_ID);
62
href="../glib/glib-Basic-Types.html#gboolean"
63
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-scale">gimp_layer_scale</a> (<a
64
href="../glib/glib-Basic-Types.html#gint32"
67
href="../glib/glib-Basic-Types.html#gint"
70
href="../glib/glib-Basic-Types.html#gint"
73
href="../glib/glib-Basic-Types.html#gboolean"
74
>gboolean</a> local_origin);
76
href="../glib/glib-Basic-Types.html#gboolean"
77
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-resize">gimp_layer_resize</a> (<a
78
href="../glib/glib-Basic-Types.html#gint32"
81
href="../glib/glib-Basic-Types.html#gint"
84
href="../glib/glib-Basic-Types.html#gint"
87
href="../glib/glib-Basic-Types.html#gint"
90
href="../glib/glib-Basic-Types.html#gint"
93
href="../glib/glib-Basic-Types.html#gboolean"
94
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-resize-to-image-size">gimp_layer_resize_to_image_size</a> (<a
95
href="../glib/glib-Basic-Types.html#gint32"
96
>gint32</a> layer_ID);
98
href="../glib/glib-Basic-Types.html#gboolean"
99
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-translate">gimp_layer_translate</a> (<a
100
href="../glib/glib-Basic-Types.html#gint32"
101
>gint32</a> layer_ID,
103
href="../glib/glib-Basic-Types.html#gint"
106
href="../glib/glib-Basic-Types.html#gint"
109
href="../glib/glib-Basic-Types.html#gboolean"
110
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-add-alpha">gimp_layer_add_alpha</a> (<a
111
href="../glib/glib-Basic-Types.html#gint32"
112
>gint32</a> layer_ID);
114
href="../glib/glib-Basic-Types.html#gboolean"
115
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-set-offsets">gimp_layer_set_offsets</a> (<a
116
href="../glib/glib-Basic-Types.html#gint32"
117
>gint32</a> layer_ID,
119
href="../glib/glib-Basic-Types.html#gint"
122
href="../glib/glib-Basic-Types.html#gint"
125
href="../glib/glib-Basic-Types.html#gint32"
126
>gint32</a> <a href="libgimp-gimplayer.html#gimp-layer-create-mask">gimp_layer_create_mask</a> (<a
127
href="../glib/glib-Basic-Types.html#gint32"
128
>gint32</a> layer_ID,
129
<a href="libgimp-gimpenums.html#GimpAddMaskType">GimpAddMaskType</a> mask_type);
131
href="../glib/glib-Basic-Types.html#gint32"
132
>gint32</a> <a href="libgimp-gimplayer.html#gimp-layer-from-mask">gimp_layer_from_mask</a> (<a
133
href="../glib/glib-Basic-Types.html#gint32"
134
>gint32</a> mask_ID);
136
href="../glib/glib-Basic-Types.html#gint32"
137
>gint32</a> <a href="libgimp-gimplayer.html#gimp-layer-get-mask">gimp_layer_get_mask</a> (<a
138
href="../glib/glib-Basic-Types.html#gint32"
139
>gint32</a> layer_ID);
141
href="../glib/glib-Basic-Types.html#gboolean"
142
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-add-mask">gimp_layer_add_mask</a> (<a
143
href="../glib/glib-Basic-Types.html#gint32"
144
>gint32</a> layer_ID,
146
href="../glib/glib-Basic-Types.html#gint32"
147
>gint32</a> mask_ID);
149
href="../glib/glib-Basic-Types.html#gboolean"
150
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-remove-mask">gimp_layer_remove_mask</a> (<a
151
href="../glib/glib-Basic-Types.html#gint32"
152
>gint32</a> layer_ID,
153
<a href="libgimp-gimpenums.html#GimpMaskApplyMode">GimpMaskApplyMode</a> mode);
155
href="../glib/glib-Basic-Types.html#gint32"
156
>gint32</a> <a href="libgimp-gimplayer.html#gimp-layer-new-from-drawable">gimp_layer_new_from_drawable</a> (<a
157
href="../glib/glib-Basic-Types.html#gint32"
158
>gint32</a> drawable_ID,
160
href="../glib/glib-Basic-Types.html#gint32"
161
>gint32</a> dest_image_ID);
163
href="../glib/glib-Basic-Types.html#gboolean"
164
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-get-preserve-trans">gimp_layer_get_preserve_trans</a> (<a
165
href="../glib/glib-Basic-Types.html#gint32"
166
>gint32</a> layer_ID);
168
href="../glib/glib-Basic-Types.html#gboolean"
169
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-set-preserve-trans">gimp_layer_set_preserve_trans</a> (<a
170
href="../glib/glib-Basic-Types.html#gint32"
171
>gint32</a> layer_ID,
173
href="../glib/glib-Basic-Types.html#gboolean"
174
>gboolean</a> preserve_trans);
176
href="../glib/glib-Basic-Types.html#gboolean"
177
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-get-apply-mask">gimp_layer_get_apply_mask</a> (<a
178
href="../glib/glib-Basic-Types.html#gint32"
179
>gint32</a> layer_ID);
181
href="../glib/glib-Basic-Types.html#gboolean"
182
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-set-apply-mask">gimp_layer_set_apply_mask</a> (<a
183
href="../glib/glib-Basic-Types.html#gint32"
184
>gint32</a> layer_ID,
186
href="../glib/glib-Basic-Types.html#gboolean"
187
>gboolean</a> apply_mask);
189
href="../glib/glib-Basic-Types.html#gboolean"
190
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-get-show-mask">gimp_layer_get_show_mask</a> (<a
191
href="../glib/glib-Basic-Types.html#gint32"
192
>gint32</a> layer_ID);
194
href="../glib/glib-Basic-Types.html#gboolean"
195
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-set-show-mask">gimp_layer_set_show_mask</a> (<a
196
href="../glib/glib-Basic-Types.html#gint32"
197
>gint32</a> layer_ID,
199
href="../glib/glib-Basic-Types.html#gboolean"
200
>gboolean</a> show_mask);
202
href="../glib/glib-Basic-Types.html#gboolean"
203
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-get-edit-mask">gimp_layer_get_edit_mask</a> (<a
204
href="../glib/glib-Basic-Types.html#gint32"
205
>gint32</a> layer_ID);
207
href="../glib/glib-Basic-Types.html#gboolean"
208
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-set-edit-mask">gimp_layer_set_edit_mask</a> (<a
209
href="../glib/glib-Basic-Types.html#gint32"
210
>gint32</a> layer_ID,
212
href="../glib/glib-Basic-Types.html#gboolean"
213
>gboolean</a> edit_mask);
215
href="../glib/glib-Basic-Types.html#gdouble"
216
>gdouble</a> <a href="libgimp-gimplayer.html#gimp-layer-get-opacity">gimp_layer_get_opacity</a> (<a
217
href="../glib/glib-Basic-Types.html#gint32"
218
>gint32</a> layer_ID);
220
href="../glib/glib-Basic-Types.html#gboolean"
221
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-set-opacity">gimp_layer_set_opacity</a> (<a
222
href="../glib/glib-Basic-Types.html#gint32"
223
>gint32</a> layer_ID,
225
href="../glib/glib-Basic-Types.html#gdouble"
226
>gdouble</a> opacity);
227
<a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> <a href="libgimp-gimplayer.html#gimp-layer-get-mode">gimp_layer_get_mode</a> (<a
228
href="../glib/glib-Basic-Types.html#gint32"
229
>gint32</a> layer_ID);
231
href="../glib/glib-Basic-Types.html#gboolean"
232
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-set-mode">gimp_layer_set_mode</a> (<a
233
href="../glib/glib-Basic-Types.html#gint32"
234
>gint32</a> layer_ID,
235
<a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> mode);
237
href="../glib/glib-Basic-Types.html#gboolean"
238
>gboolean</a> <a href="libgimp-gimplayer.html#gimp-layer-is-floating-sel">gimp_layer_is_floating_sel</a> (<a
239
href="../glib/glib-Basic-Types.html#gint32"
240
>gint32</a> layer_ID);
241
</pre></div><div class="refsect1" lang="en"><a name="id2594072"></a><h2>Description</h2><p>
242
Operations on a single layer.
244
</p></div><div class="refsect1" lang="en"><a name="id2594081"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2594086"></a><h3><a name="gimp-layer-new"></a>gimp_layer_new ()</h3><a class="indexterm" name="id2594095"></a><pre class="programlisting"><a
245
href="../glib/glib-Basic-Types.html#gint32"
246
>gint32</a> gimp_layer_new (<a
247
href="../glib/glib-Basic-Types.html#gint32"
248
>gint32</a> image_ID,
250
href="../glib/glib-Basic-Types.html#gchar"
253
href="../glib/glib-Basic-Types.html#gint"
256
href="../glib/glib-Basic-Types.html#gint"
259
href="../libgimpbase/libgimpbase-gimpbaseenums.html#GimpImageType"
260
>GimpImageType</a> type,
262
href="../glib/glib-Basic-Types.html#gdouble"
263
>gdouble</a> opacity,
264
<a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> mode);</pre><p>
267
This procedure creates a new layer with the specified width, height,
268
and type. Name, opacity, and mode are also supplied parameters. The
269
new layer still needs to be added to the image, as this is not
270
automatic. Add the new layer with the 'gimp_image_add_layer'
271
command. Other attributes such as layer mask modes, and offsets
272
should be set with explicit procedure calls.</p><p>
274
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>image_ID</tt></i>�:</span></td><td> The image to which to add the layer.
275
</td></tr><tr><td><span class="term"><i class="parameter"><tt>name</tt></i>�:</span></td><td> The layer name.
276
</td></tr><tr><td><span class="term"><i class="parameter"><tt>width</tt></i>�:</span></td><td> The layer width.
277
</td></tr><tr><td><span class="term"><i class="parameter"><tt>height</tt></i>�:</span></td><td> The layer height.
278
</td></tr><tr><td><span class="term"><i class="parameter"><tt>type</tt></i>�:</span></td><td> The layer type.
279
</td></tr><tr><td><span class="term"><i class="parameter"><tt>opacity</tt></i>�:</span></td><td> The layer opacity.
280
</td></tr><tr><td><span class="term"><i class="parameter"><tt>mode</tt></i>�:</span></td><td> The layer combination mode.
281
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The newly created layer.
282
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2594253"></a><h3><a name="gimp-layer-copy"></a>gimp_layer_copy ()</h3><a class="indexterm" name="id2594262"></a><pre class="programlisting"><a
283
href="../glib/glib-Basic-Types.html#gint32"
284
>gint32</a> gimp_layer_copy (<a
285
href="../glib/glib-Basic-Types.html#gint32"
286
>gint32</a> layer_ID);</pre><p>
289
This procedure copies the specified layer and returns the copy. The
290
newly copied layer is for use within the original layer's image. It
291
should not be subsequently added to any other image. If you create
292
a copy of the background layer, remember to add an alpha channel
293
before you add the new layer to the image.</p><p>
295
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer to copy.
296
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The newly copied layer.
297
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2620510"></a><h3><a name="gimp-layer-scale"></a>gimp_layer_scale ()</h3><a class="indexterm" name="id2620518"></a><pre class="programlisting"><a
298
href="../glib/glib-Basic-Types.html#gboolean"
299
>gboolean</a> gimp_layer_scale (<a
300
href="../glib/glib-Basic-Types.html#gint32"
301
>gint32</a> layer_ID,
303
href="../glib/glib-Basic-Types.html#gint"
306
href="../glib/glib-Basic-Types.html#gint"
307
>gint</a> new_height,
309
href="../glib/glib-Basic-Types.html#gboolean"
310
>gboolean</a> local_origin);</pre><p>
311
Scale the layer to the specified extents.
313
This procedure scales the layer so that it's new width and height
314
are equal to the supplied parameters. The \"local_origin\" parameter
315
specifies whether to scale from the center of the layer, or from the
316
image origin. This operation only works if the layer has been added
319
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
320
</td></tr><tr><td><span class="term"><i class="parameter"><tt>new_width</tt></i>�:</span></td><td> New layer width.
321
</td></tr><tr><td><span class="term"><i class="parameter"><tt>new_height</tt></i>�:</span></td><td> New layer height.
322
</td></tr><tr><td><span class="term"><i class="parameter"><tt>local_origin</tt></i>�:</span></td><td> Use a local origin (as opposed to the image origin).
323
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
324
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2620625"></a><h3><a name="gimp-layer-resize"></a>gimp_layer_resize ()</h3><a class="indexterm" name="id2620633"></a><pre class="programlisting"><a
325
href="../glib/glib-Basic-Types.html#gboolean"
326
>gboolean</a> gimp_layer_resize (<a
327
href="../glib/glib-Basic-Types.html#gint32"
328
>gint32</a> layer_ID,
330
href="../glib/glib-Basic-Types.html#gint"
333
href="../glib/glib-Basic-Types.html#gint"
334
>gint</a> new_height,
336
href="../glib/glib-Basic-Types.html#gint"
339
href="../glib/glib-Basic-Types.html#gint"
340
>gint</a> offy);</pre><p>
341
Resize the layer to the specified extents.
343
This procedure resizes the layer so that it's new width and height
344
are equal to the supplied parameters. Offsets are also provided
345
which describe the position of the previous layer's content. This
346
operation only works if the layer has been added to an image.</p><p>
348
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
349
</td></tr><tr><td><span class="term"><i class="parameter"><tt>new_width</tt></i>�:</span></td><td> New layer width.
350
</td></tr><tr><td><span class="term"><i class="parameter"><tt>new_height</tt></i>�:</span></td><td> New layer height.
351
</td></tr><tr><td><span class="term"><i class="parameter"><tt>offx</tt></i>�:</span></td><td> x offset between upper left corner of old and new layers: (old - new).
352
</td></tr><tr><td><span class="term"><i class="parameter"><tt>offy</tt></i>�:</span></td><td> y offset between upper left corner of old and new layers: (old - new).
353
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
354
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2620759"></a><h3><a name="gimp-layer-resize-to-image-size"></a>gimp_layer_resize_to_image_size ()</h3><a class="indexterm" name="id2620770"></a><pre class="programlisting"><a
355
href="../glib/glib-Basic-Types.html#gboolean"
356
>gboolean</a> gimp_layer_resize_to_image_size (<a
357
href="../glib/glib-Basic-Types.html#gint32"
358
>gint32</a> layer_ID);</pre><p>
359
Resize a layer to the image size.
361
This procedure resizes the layer so that it's new width and height
362
are equal to the width and height of its image container.</p><p>
364
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer to resize.
365
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
366
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2620825"></a><h3><a name="gimp-layer-translate"></a>gimp_layer_translate ()</h3><a class="indexterm" name="id2620833"></a><pre class="programlisting"><a
367
href="../glib/glib-Basic-Types.html#gboolean"
368
>gboolean</a> gimp_layer_translate (<a
369
href="../glib/glib-Basic-Types.html#gint32"
370
>gint32</a> layer_ID,
372
href="../glib/glib-Basic-Types.html#gint"
375
href="../glib/glib-Basic-Types.html#gint"
376
>gint</a> offy);</pre><p>
377
Translate the layer by the specified offsets.
379
This procedure translates the layer by the amounts specified in the
380
x and y arguments. These can be negative, and are considered offsets
381
from the current position. This command only works if the layer has
382
been added to an image. All additional layers contained in the image
383
which have the linked flag set to TRUE w ill also be translated by
384
the specified offsets.</p><p>
386
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
387
</td></tr><tr><td><span class="term"><i class="parameter"><tt>offx</tt></i>�:</span></td><td> Offset in x direction.
388
</td></tr><tr><td><span class="term"><i class="parameter"><tt>offy</tt></i>�:</span></td><td> Offset in y direction.
389
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
390
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2620925"></a><h3><a name="gimp-layer-add-alpha"></a>gimp_layer_add_alpha ()</h3><a class="indexterm" name="id2620933"></a><pre class="programlisting"><a
391
href="../glib/glib-Basic-Types.html#gboolean"
392
>gboolean</a> gimp_layer_add_alpha (<a
393
href="../glib/glib-Basic-Types.html#gint32"
394
>gint32</a> layer_ID);</pre><p>
395
Add an alpha channel to the layer if it doesn't already have one.
397
This procedure adds an additional component to the specified layer
398
if it does not already possess an alpha channel. An alpha channel
399
makes it possible to move a layer from the bottom of the layer stack
400
and to clear and erase to transparency, instead of the background
401
color. This transforms images of type RGB to RGBA, GRAY to GRAYA,
402
and INDEXED to INDEXEDA.</p><p>
404
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
405
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
406
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2620991"></a><h3><a name="gimp-layer-set-offsets"></a>gimp_layer_set_offsets ()</h3><a class="indexterm" name="id2620999"></a><pre class="programlisting"><a
407
href="../glib/glib-Basic-Types.html#gboolean"
408
>gboolean</a> gimp_layer_set_offsets (<a
409
href="../glib/glib-Basic-Types.html#gint32"
410
>gint32</a> layer_ID,
412
href="../glib/glib-Basic-Types.html#gint"
415
href="../glib/glib-Basic-Types.html#gint"
416
>gint</a> offy);</pre><p>
417
Set the layer offsets.
419
This procedure sets the offsets for the specified layer. The offsets
420
are relative to the image origin and can be any values. This
421
operation is valid only on layers which have been added to an image.</p><p>
423
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
424
</td></tr><tr><td><span class="term"><i class="parameter"><tt>offx</tt></i>�:</span></td><td> Offset in x direction.
425
</td></tr><tr><td><span class="term"><i class="parameter"><tt>offy</tt></i>�:</span></td><td> Offset in y direction.
426
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
427
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621087"></a><h3><a name="gimp-layer-create-mask"></a>gimp_layer_create_mask ()</h3><a class="indexterm" name="id2621096"></a><pre class="programlisting"><a
428
href="../glib/glib-Basic-Types.html#gint32"
429
>gint32</a> gimp_layer_create_mask (<a
430
href="../glib/glib-Basic-Types.html#gint32"
431
>gint32</a> layer_ID,
432
<a href="libgimp-gimpenums.html#GimpAddMaskType">GimpAddMaskType</a> mask_type);</pre><p>
433
Create a layer mask for the specified specified layer.
435
This procedure creates a layer mask for the specified layer. Layer
436
masks serve as an additional alpha channel for a layer. A number of
437
ifferent types of masks are allowed for initialisation: completely
438
white masks (which will leave the layer fully visible), completely
439
black masks (which will give the layer complete transparency, the
440
layer's already existing alpha channel (which will leave the layer
441
fully visible, but which may be more useful than a white mask), the
442
current selection or a grayscale copy of the layer. The layer mask
443
still needs to be added to the layer. This can be done with a call
444
to 'gimp_layer_add_mask'.</p><p>
446
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer to which to add the mask.
447
</td></tr><tr><td><span class="term"><i class="parameter"><tt>mask_type</tt></i>�:</span></td><td> The type of mask.
448
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The newly created mask.
449
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621146"></a><h3><a name="gimp-layer-from-mask"></a>gimp_layer_from_mask ()</h3><a class="indexterm" name="id2621154"></a><pre class="programlisting"><a
450
href="../glib/glib-Basic-Types.html#gint32"
451
>gint32</a> gimp_layer_from_mask (<a
452
href="../glib/glib-Basic-Types.html#gint32"
453
>gint32</a> mask_ID);</pre><p>
454
Get the specified mask's layer.
456
This procedure returns the specified mask's layer , or -1 if none
459
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>mask_ID</tt></i>�:</span></td><td> Mask for which to return the layer.
460
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The mask's layer.
462
</td></tr></tbody></table></div><p>Since GIMP 2.2
463
</p></div><hr><div class="refsect2" lang="en"><a name="id2621204"></a><h3><a name="gimp-layer-get-mask"></a>gimp_layer_get_mask ()</h3><a class="indexterm" name="id2621211"></a><pre class="programlisting"><a
464
href="../glib/glib-Basic-Types.html#gint32"
465
>gint32</a> gimp_layer_get_mask (<a
466
href="../glib/glib-Basic-Types.html#gint32"
467
>gint32</a> layer_ID);</pre><p>
468
Get the specified layer's mask if it exists.
470
This procedure returns the specified layer's mask, or -1 if none
473
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
474
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The layer mask.
475
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621260"></a><h3><a name="gimp-layer-add-mask"></a>gimp_layer_add_mask ()</h3><a class="indexterm" name="id2621267"></a><pre class="programlisting"><a
476
href="../glib/glib-Basic-Types.html#gboolean"
477
>gboolean</a> gimp_layer_add_mask (<a
478
href="../glib/glib-Basic-Types.html#gint32"
479
>gint32</a> layer_ID,
481
href="../glib/glib-Basic-Types.html#gint32"
482
>gint32</a> mask_ID);</pre><p>
483
Add a layer mask to the specified layer.
485
This procedure adds a layer mask to the specified layer. Layer masks
486
serve as an additional alpha channel for a layer. This procedure
487
will fail if a number of prerequisites aren't met. The layer cannot
488
already have a layer mask. The specified mask must exist and have
489
the same dimensions as the layer. Both the mask and the layer must
490
have been created for use with the specified image.</p><p>
492
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer to receive the mask.
493
</td></tr><tr><td><span class="term"><i class="parameter"><tt>mask_ID</tt></i>�:</span></td><td> The mask to add to the layer.
494
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
495
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621337"></a><h3><a name="gimp-layer-remove-mask"></a>gimp_layer_remove_mask ()</h3><a class="indexterm" name="id2621345"></a><pre class="programlisting"><a
496
href="../glib/glib-Basic-Types.html#gboolean"
497
>gboolean</a> gimp_layer_remove_mask (<a
498
href="../glib/glib-Basic-Types.html#gint32"
499
>gint32</a> layer_ID,
500
<a href="libgimp-gimpenums.html#GimpMaskApplyMode">GimpMaskApplyMode</a> mode);</pre><p>
501
Remove the specified layer mask from the layer.
503
This procedure removes the specified layer mask from the layer. If
504
the mask doesn't exist, an error is returned.</p><p>
506
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer from which to remove mask.
507
</td></tr><tr><td><span class="term"><i class="parameter"><tt>mode</tt></i>�:</span></td><td> Removal mode.
508
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
509
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621415"></a><h3><a name="gimp-layer-new-from-drawable"></a>gimp_layer_new_from_drawable ()</h3><a class="indexterm" name="id2621423"></a><pre class="programlisting"><a
510
href="../glib/glib-Basic-Types.html#gint32"
511
>gint32</a> gimp_layer_new_from_drawable (<a
512
href="../glib/glib-Basic-Types.html#gint32"
513
>gint32</a> drawable_ID,
515
href="../glib/glib-Basic-Types.html#gint32"
516
>gint32</a> dest_image_ID);</pre><p>
517
Create a new layer by copying an existing drawable.
519
This procedure creates a new layer as a copy of the specified
520
drawable. The new layer still needs to be added to the image, as
521
this is not automatic. Add the new layer with the
522
'gimp_image_add_layer' command. Other attributes such as layer mask
523
modes, and offsets should be set with explicit procedure calls.</p><p>
525
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>drawable_ID</tt></i>�:</span></td><td> The source drawable from where the new layer is copied.
526
</td></tr><tr><td><span class="term"><i class="parameter"><tt>dest_image_ID</tt></i>�:</span></td><td> The destination image to which to add the layer.
527
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The newly copied layer.
528
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621498"></a><h3><a name="gimp-layer-get-preserve-trans"></a>gimp_layer_get_preserve_trans ()</h3><a class="indexterm" name="id2621506"></a><pre class="programlisting"><a
529
href="../glib/glib-Basic-Types.html#gboolean"
530
>gboolean</a> gimp_layer_get_preserve_trans (<a
531
href="../glib/glib-Basic-Types.html#gint32"
532
>gint32</a> layer_ID);</pre><p>
533
Get the preserve transperancy setting of the specified layer.
535
This procedure returns the specified layer's preserve transperancy
538
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
539
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The layer's preserve transperancy setting.
540
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621560"></a><h3><a name="gimp-layer-set-preserve-trans"></a>gimp_layer_set_preserve_trans ()</h3><a class="indexterm" name="id2621570"></a><pre class="programlisting"><a
541
href="../glib/glib-Basic-Types.html#gboolean"
542
>gboolean</a> gimp_layer_set_preserve_trans (<a
543
href="../glib/glib-Basic-Types.html#gint32"
544
>gint32</a> layer_ID,
546
href="../glib/glib-Basic-Types.html#gboolean"
547
>gboolean</a> preserve_trans);</pre><p>
548
Set the preserve transperancy setting of the specified layer.
550
This procedure sets the specified layer's preserve transperancy
553
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
554
</td></tr><tr><td><span class="term"><i class="parameter"><tt>preserve_trans</tt></i>�:</span></td><td> The new layer's preserve transperancy setting.
555
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
556
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621640"></a><h3><a name="gimp-layer-get-apply-mask"></a>gimp_layer_get_apply_mask ()</h3><a class="indexterm" name="id2621649"></a><pre class="programlisting"><a
557
href="../glib/glib-Basic-Types.html#gboolean"
558
>gboolean</a> gimp_layer_get_apply_mask (<a
559
href="../glib/glib-Basic-Types.html#gint32"
560
>gint32</a> layer_ID);</pre><p>
561
Get the apply mask of the specified layer.
563
This procedure returns the specified layer's apply mask. If the
564
value is non-zero, then the layer mask for this layer is currently
565
being composited with the layer's alpha channel.</p><p>
567
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
568
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The layer apply mask.
569
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621703"></a><h3><a name="gimp-layer-set-apply-mask"></a>gimp_layer_set_apply_mask ()</h3><a class="indexterm" name="id2621712"></a><pre class="programlisting"><a
570
href="../glib/glib-Basic-Types.html#gboolean"
571
>gboolean</a> gimp_layer_set_apply_mask (<a
572
href="../glib/glib-Basic-Types.html#gint32"
573
>gint32</a> layer_ID,
575
href="../glib/glib-Basic-Types.html#gboolean"
576
>gboolean</a> apply_mask);</pre><p>
577
Set the apply mask of the specified layer.
579
This procedure sets the specified layer's apply mask. This controls
580
whether the layer's mask is currently affecting the alpha channel.
581
If there is no layer mask, this function will return an error.</p><p>
583
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
584
</td></tr><tr><td><span class="term"><i class="parameter"><tt>apply_mask</tt></i>�:</span></td><td> The new layer apply mask.
585
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
586
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621783"></a><h3><a name="gimp-layer-get-show-mask"></a>gimp_layer_get_show_mask ()</h3><a class="indexterm" name="id2621792"></a><pre class="programlisting"><a
587
href="../glib/glib-Basic-Types.html#gboolean"
588
>gboolean</a> gimp_layer_get_show_mask (<a
589
href="../glib/glib-Basic-Types.html#gint32"
590
>gint32</a> layer_ID);</pre><p>
591
Get the show mask of the specified layer.
593
This procedure returns the specified layer's show mask. If the value
594
is non-zero, then the layer mask for this layer is currently being
595
shown instead of the layer.</p><p>
597
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
598
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The layer show mask.
599
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621844"></a><h3><a name="gimp-layer-set-show-mask"></a>gimp_layer_set_show_mask ()</h3><a class="indexterm" name="id2621853"></a><pre class="programlisting"><a
600
href="../glib/glib-Basic-Types.html#gboolean"
601
>gboolean</a> gimp_layer_set_show_mask (<a
602
href="../glib/glib-Basic-Types.html#gint32"
603
>gint32</a> layer_ID,
605
href="../glib/glib-Basic-Types.html#gboolean"
606
>gboolean</a> show_mask);</pre><p>
607
Set the show mask of the specified layer.
609
This procedure sets the specified layer's show mask. This controls
610
whether the layer or it's mask is visible. Non-zero values indicate
611
that the mask should be visible. If the layer has no mask, then this
612
function returns an error.</p><p>
614
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
615
</td></tr><tr><td><span class="term"><i class="parameter"><tt>show_mask</tt></i>�:</span></td><td> The new layer show mask.
616
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
617
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621924"></a><h3><a name="gimp-layer-get-edit-mask"></a>gimp_layer_get_edit_mask ()</h3><a class="indexterm" name="id2621932"></a><pre class="programlisting"><a
618
href="../glib/glib-Basic-Types.html#gboolean"
619
>gboolean</a> gimp_layer_get_edit_mask (<a
620
href="../glib/glib-Basic-Types.html#gint32"
621
>gint32</a> layer_ID);</pre><p>
622
Get the show mask of the specified layer.
624
This procedure returns the specified layer's show mask. If the value
625
is non-zero, then the layer mask for this layer is currently active,
626
and not the layer.</p><p>
628
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
629
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The layer show mask.
630
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2621984"></a><h3><a name="gimp-layer-set-edit-mask"></a>gimp_layer_set_edit_mask ()</h3><a class="indexterm" name="id2621993"></a><pre class="programlisting"><a
631
href="../glib/glib-Basic-Types.html#gboolean"
632
>gboolean</a> gimp_layer_set_edit_mask (<a
633
href="../glib/glib-Basic-Types.html#gint32"
634
>gint32</a> layer_ID,
636
href="../glib/glib-Basic-Types.html#gboolean"
637
>gboolean</a> edit_mask);</pre><p>
638
Set the show mask of the specified layer.
640
This procedure sets the specified layer's show mask. This controls
641
whether the layer or it's mask is currently active for editing. If
642
the specified layer has no layer mask, then this procedure will
643
return an error.</p><p>
645
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
646
</td></tr><tr><td><span class="term"><i class="parameter"><tt>edit_mask</tt></i>�:</span></td><td> The new layer show mask.
647
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
648
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2622063"></a><h3><a name="gimp-layer-get-opacity"></a>gimp_layer_get_opacity ()</h3><a class="indexterm" name="id2622072"></a><pre class="programlisting"><a
649
href="../glib/glib-Basic-Types.html#gdouble"
650
>gdouble</a> gimp_layer_get_opacity (<a
651
href="../glib/glib-Basic-Types.html#gint32"
652
>gint32</a> layer_ID);</pre><p>
653
Get the opacity of the specified layer.
655
This procedure returns the specified layer's opacity.</p><p>
657
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
658
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The layer opacity.
659
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2622122"></a><h3><a name="gimp-layer-set-opacity"></a>gimp_layer_set_opacity ()</h3><a class="indexterm" name="id2622131"></a><pre class="programlisting"><a
660
href="../glib/glib-Basic-Types.html#gboolean"
661
>gboolean</a> gimp_layer_set_opacity (<a
662
href="../glib/glib-Basic-Types.html#gint32"
663
>gint32</a> layer_ID,
665
href="../glib/glib-Basic-Types.html#gdouble"
666
>gdouble</a> opacity);</pre><p>
667
Set the opacity of the specified layer.
669
This procedure sets the specified layer's opacity.</p><p>
671
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
672
</td></tr><tr><td><span class="term"><i class="parameter"><tt>opacity</tt></i>�:</span></td><td> The new layer opacity.
673
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
674
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2622205"></a><h3><a name="gimp-layer-get-mode"></a>gimp_layer_get_mode ()</h3><a class="indexterm" name="id2622215"></a><pre class="programlisting"><a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> gimp_layer_get_mode (<a
675
href="../glib/glib-Basic-Types.html#gint32"
676
>gint32</a> layer_ID);</pre><p>
677
Get the combination mode of the specified layer.
679
This procedure returns the specified layer's combination mode.</p><p>
681
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
682
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The layer combination mode.
683
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2622277"></a><h3><a name="gimp-layer-set-mode"></a>gimp_layer_set_mode ()</h3><a class="indexterm" name="id2622287"></a><pre class="programlisting"><a
684
href="../glib/glib-Basic-Types.html#gboolean"
685
>gboolean</a> gimp_layer_set_mode (<a
686
href="../glib/glib-Basic-Types.html#gint32"
687
>gint32</a> layer_ID,
688
<a href="libgimp-gimpenums.html#GimpLayerModeEffects">GimpLayerModeEffects</a> mode);</pre><p>
689
Set the combination mode of the specified layer.
691
This procedure sets the specified layer's combination mode.</p><p>
693
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
694
</td></tr><tr><td><span class="term"><i class="parameter"><tt>mode</tt></i>�:</span></td><td> The new layer combination mode.
695
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> TRUE on success.
696
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2622369"></a><h3><a name="gimp-layer-is-floating-sel"></a>gimp_layer_is_floating_sel ()</h3><a class="indexterm" name="id2622379"></a><pre class="programlisting"><a
697
href="../glib/glib-Basic-Types.html#gboolean"
698
>gboolean</a> gimp_layer_is_floating_sel (<a
699
href="../glib/glib-Basic-Types.html#gint32"
700
>gint32</a> layer_ID);</pre><p>
701
Is the specified layer a floating selection?
703
This procedure returns whether the layer is a floating selection.
704
Floating selections are special cases of layers which are attached
705
to a specific drawable.</p><p>
707
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>layer_ID</tt></i>�:</span></td><td> The layer.
708
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> Non-zero if the layer is a floating selection.
709
</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libgimp-gimpimage.html"><b><<�gimpimage</b></a></td><td align="right"><a accesskey="n" href="libgimp-gimppaths.html"><b>gimppaths�>></b></a></td></tr></table></body></html>