gimplayer: GIMP Library Reference Manual

## gimplayer gimplayer |

## Functions

gint32 | gimp_layer_new ()
gint32 | gimp_layer_new_from_drawable ()
gint32 | gimp_layer_new_from_visible ()
gint32 | gimp_layer_new_from_pixbuf ()
gint32 | gimp_layer_new_from_surface ()
gint32 | gimp_layer_group_new ()
gint32 | gimp_layer_copy ()
gboolean | gimp_layer_scale ()
gboolean | gimp_layer_scale_full ()
gboolean | gimp_layer_resize ()
gboolean | gimp_layer_resize_to_image_size ()
gboolean | gimp_layer_translate ()
gboolean | gimp_layer_add_alpha ()
gboolean | gimp_layer_flatten ()
gboolean | gimp_layer_set_offsets ()
gint32 | gimp_layer_create_mask ()
gint32 | gimp_layer_from_mask ()
gint32 | gimp_layer_get_mask ()
gboolean | gimp_layer_add_mask ()
gboolean | gimp_layer_remove_mask ()
gboolean | gimp_layer_get_lock_alpha ()
gboolean | gimp_layer_set_lock_alpha ()
gboolean | gimp_layer_get_preserve_trans ()
gboolean | gimp_layer_set_preserve_trans ()
gboolean | gimp_layer_get_apply_mask ()
gboolean | gimp_layer_set_apply_mask ()
gboolean | gimp_layer_get_show_mask ()
gboolean | gimp_layer_set_show_mask ()
gboolean | gimp_layer_get_edit_mask ()
gboolean | gimp_layer_set_edit_mask ()
gdouble | gimp_layer_get_opacity ()
gboolean | gimp_layer_set_opacity ()
GimpLayerModeEffects | gimp_layer_get_mode ()
gboolean | gimp_layer_set_mode ()
gboolean | gimp_layer_is_floating_sel ()

## Description

## Functions

### gimp_layer_new ()

    gint32
    gimp_layer_new (gint32 image_ID,
                    const gchar *name,
                    gint width,
                    gint height,
                    GimpImageType type,
                    gdouble opacity,
                    GimpLayerModeEffects mode);

### gimp_layer_new_from_drawable ()

    gint32
    gimp_layer_new_from_drawable (gint32 drawable_ID,
                                  gint32 dest_image_ID);

### gimp_layer_new_from_visible ()

    gint32
    gimp_layer_new_from_visible (gint32 image_ID,
                                 gint32 dest_image_ID,
                                 const gchar *name);

Since: GIMP 2.6

### gimp_layer_new_from_pixbuf ()

    gint32
    gimp_layer_new_from_pixbuf (gint32 image_ID,
                                const gchar *name,
                                GdkPixbuf *pixbuf,
                                gdouble opacity,
                                GimpLayerModeEffects mode,
                                gdouble progress_start,
                                gdouble progress_end);

Since: GIMP 2.4

### gimp_layer_new_from_surface ()

    gint32
    gimp_layer_new_from_surface (gint32 image_ID,
                                 const gchar *name,
                                 cairo_surface_t *surface,
                                 gdouble progress_start,
                                 gdouble progress_end);

Since: GIMP 2.8

### gimp_layer_group_new ()

    gint32
    gimp_layer_group_new (gint32 image_ID);

Since: GIMP 2.8

### gimp_layer_copy ()

    gint32
    gimp_layer_copy (gint32 layer_ID);

### gimp_layer_scale ()

    gboolean
    gimp_layer_scale (gint32 layer_ID,
                      gint new_width,
                      gint new_height,
                      gboolean local_origin);

### gimp_layer_scale_full ()

    gboolean
    gimp_layer_scale_full (gint32 layer_ID,
                           gint new_width,
                           gint new_height,
                           gboolean local_origin,
                           GimpInterpolationType interpolation);

`gimp_layer_scale_full` is deprecated and should not be used in newly-written code.

Use `gimp_layer_scale()` instead.

Since: GIMP 2.6

### gimp_layer_resize ()

    gboolean
    gimp_layer_resize (gint32 layer_ID,
                       gint new_width,
                       gint new_height,
                       gint offx,
                       gint offy);

`gimp_layer_resize` is deprecated and should not be used in newly-written code.

### gimp_layer_resize_to_image_size ()

    gboolean
    gimp_layer_resize_to_image_size (gint32 layer_ID);

### gimp_layer_translate ()

    gboolean
    gimp_layer_translate (gint32 layer_ID,
                          gint offx,
                          gint offy);

### gimp_layer_add_alpha ()

    gboolean
    gimp_layer_add_alpha (gint32 layer_ID);

### gimp_layer_flatten ()

    gboolean
    gimp_layer_flatten (gint32 layer_ID);

Since: GIMP 2.4

### gimp_layer_set_offsets ()

    gboolean
    gimp_layer_set_offsets (gint32 layer_ID,
                            gint offx,
                            gint offy);

### gimp_layer_create_mask ()

    gint32
    gimp_layer_create_mask (gint32 layer_ID,
                            GimpAddMaskType mask_type);

### gimp_layer_from_mask ()

    gint32
    gimp_layer_from_mask (gint32 mask_ID);

Since: GIMP 2.2

### gimp_layer_get_mask ()

    gint32
    gimp_layer_get_mask (gint32 layer_ID);

### gimp_layer_add_mask ()

    gboolean
    gimp_layer_add_mask (gint32 layer_ID,
                         gint32 mask_ID);

### gimp_layer_remove_mask ()

    gboolean
    gimp_layer_remove_mask (gint32 layer_ID,
                            GimpMaskApplyMode mode);

### gimp_layer_get_lock_alpha ()

    gboolean
    gimp_layer_get_lock_alpha (gint32 layer_ID);

### gimp_layer_set_lock_alpha ()

    gboolean
    gimp_layer_set_lock_alpha (gint32 layer_ID,
                               gboolean lock_alpha);

### gimp_layer_get_preserve_trans ()

    gboolean
    gimp_layer_get_preserve_trans (gint32 layer_ID);

`gimp_layer_get_preserve_trans` is deprecated and should not be used in newly-written code.

### gimp_layer_set_preserve_trans ()

    gboolean
    gimp_layer_set_preserve_trans (gint32 layer_ID,
                                   gboolean preserve_trans);

`gimp_layer_set_preserve_trans` is deprecated and should not be used in newly-written code.

### gimp_layer_get_apply_mask ()

    gboolean
    gimp_layer_get_apply_mask (gint32 layer_ID);

### gimp_layer_set_apply_mask ()

    gboolean
    gimp_layer_set_apply_mask (gint32 layer_ID,
                               gboolean apply_mask);

### gimp_layer_get_show_mask ()

    gboolean
    gimp_layer_get_show_mask (gint32 layer_ID);

### gimp_layer_set_show_mask ()

    gboolean
    gimp_layer_set_show_mask (gint32 layer_ID,
                              gboolean show_mask);

### gimp_layer_get_edit_mask ()

    gboolean
    gimp_layer_get_edit_mask (gint32 layer_ID);

### gimp_layer_set_edit_mask ()

    gboolean
    gimp_layer_set_edit_mask (gint32 layer_ID,
                              gboolean edit_mask);

### gimp_layer_get_opacity ()

    gdouble
    gimp_layer_get_opacity (gint32 layer_ID);

### gimp_layer_set_opacity ()

    gboolean
    gimp_layer_set_opacity (gint32 layer_ID,
                            gdouble opacity);

### gimp_layer_get_mode ()

    GimpLayerModeEffects
    gimp_layer_get_mode (gint32 layer_ID);

### gimp_layer_set_mode ()

    gboolean
    gimp_layer_set_mode (gint32 layer_ID,
                         GimpLayerModeEffects mode);

### gimp_layer_is_floating_sel ()

    gboolean
    gimp_layer_is_floating_sel (gint32 layer_ID);

## Types and Values