Gimp.Layer
Description: Reference for Gimp.Layer

### Class

# GimpLayer

#### Description [src]

    class Gimp.Layer : Gimp.Drawable {
      parent_instance: GimpDrawable
    }

Operations on a single layer.

#### Hierarchy

#### Ancestors

- GimpDrawable
- GimpItem
- GObject

#### Descendants

- GimpGroupLayer
- GimpLinkLayer
- GimpTextLayer
- GimpVectorLayer

#### Constructors

###### gimp_layer_new

Create a new layer.

###### gimp_layer_new_from_drawable

Create a new layer by copying an existing drawable.

###### gimp_layer_new_from_pixbuf

Create a new layer from a %GdkPixbuf.

since: 2.2

###### gimp_layer_new_from_surface

Create a new layer from a `cairo_surface_t`.

since: 2.8

###### gimp_layer_new_from_visible

Create a new layer from what is visible in an image.

since: 2.6

#### Functions

###### gimp_layer_from_mask

Get the specified mask’s layer.

since: 2.2

###### gimp_layer_get_by_id

Returns a `GimpLayer` representing `layer_id`. This function calls `gimp_item_get_by_id()` and returns the item if it is layer or `NULL` otherwise.

since: 3.0

#### Instance methods

###### gimp_layer_add_alpha

Add an alpha channel to the layer if it doesn’t already have one.

###### gimp_layer_add_mask

Add a layer mask to the specified layer.

###### gimp_layer_copy

Copy a layer.

###### gimp_layer_create_mask

Create a layer mask for the specified layer.

###### gimp_layer_flatten

Remove the alpha channel from the layer if it has one.

since: 2.4

###### gimp_layer_get_apply_mask

Get the apply mask setting of the specified layer.

###### gimp_layer_get_blend_space

Get the blend space of the specified layer.

since: 2.10

###### gimp_layer_get_composite_mode

Get the composite mode of the specified layer.

since: 2.10

###### gimp_layer_get_composite_space

Get the composite space of the specified layer.

since: 2.10

###### gimp_layer_get_edit_mask

Get the edit mask setting of the specified layer.

###### gimp_layer_get_lock_alpha

Get the lock alpha channel setting of the specified layer.

###### gimp_layer_get_mask

Get the specified layer’s mask if it exists.

###### gimp_layer_get_mode

Get the combination mode of the specified layer.

###### gimp_layer_get_opacity

Get the opacity of the specified layer.

###### gimp_layer_get_show_mask

Get the show mask setting of the specified layer.

###### gimp_layer_is_floating_sel

Is the specified layer a floating selection?

###### gimp_layer_remove_mask

Remove the specified layer mask from the layer.

###### gimp_layer_resize

Resize the layer to the specified extents.

###### gimp_layer_resize_to_image_size

Resize a layer to the image size.

###### gimp_layer_scale

Scale the layer using the default interpolation method.

###### gimp_layer_set_apply_mask

Set the apply mask setting of the specified layer.

###### gimp_layer_set_blend_space

Set the blend space of the specified layer.

since: 2.10

###### gimp_layer_set_composite_mode

Set the composite mode of the specified layer.

since: 2.10

###### gimp_layer_set_composite_space

Set the composite space of the specified layer.

since: 2.10

###### gimp_layer_set_edit_mask

Set the edit mask setting of the specified layer.

###### gimp_layer_set_lock_alpha

Set the lock alpha channel setting of the specified layer.

###### gimp_layer_set_mode

Set the combination mode of the specified layer.

###### gimp_layer_set_offsets

Set the layer offsets.

###### gimp_layer_set_opacity

Set the opacity of the specified layer.

###### gimp_layer_set_show_mask

Set the show mask setting of the specified layer.

##### Methods inherited from GimpDrawable (56)

Please see GimpDrawable for a full list of methods.

##### Methods inherited from GimpItem (48)

Please see GimpItem for a full list of methods.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

##### Properties inherited from GimpItem (1)

###### Gimp.Item:id

No description available.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GimpLayerClass {
      GimpDrawableClass parent_class;
      void (* _gimp_reserved0) (
    void
      );
      void (* _gimp_reserved1) (
    void
      );
      void (* _gimp_reserved2) (
    void
      );
      void (* _gimp_reserved3) (
    void
      );
      void (* _gimp_reserved4) (
    void
      );
      void (* _gimp_reserved5) (
    void
      );
      void (* _gimp_reserved6) (
    void
      );
      void (* _gimp_reserved7) (
    void
      );
      void (* _gimp_reserved8) (
    void
      );
      void (* _gimp_reserved9) (
    void
      );

    }

No description available.

###### Class members

`parent_class: GimpDrawableClass`
  No description available.
`_gimp_reserved0: void (* _gimp_reserved0) ( void )`
  No description available.
`_gimp_reserved1: void (* _gimp_reserved1) ( void )`
  No description available.
`_gimp_reserved2: void (* _gimp_reserved2) ( void )`
  No description available.
`_gimp_reserved3: void (* _gimp_reserved3) ( void )`
  No description available.
`_gimp_reserved4: void (* _gimp_reserved4) ( void )`
  No description available.
`_gimp_reserved5: void (* _gimp_reserved5) ( void )`
  No description available.
`_gimp_reserved6: void (* _gimp_reserved6) ( void )`
  No description available.
`_gimp_reserved7: void (* _gimp_reserved7) ( void )`
  No description available.
`_gimp_reserved8: void (* _gimp_reserved8) ( void )`
  No description available.
`_gimp_reserved9: void (* _gimp_reserved9) ( void )`
  No description available.