Method

GimpImageget_layers

Declaration [src]

GimpLayer**
gimp_image_get_layers (
  GimpImage* image,
  gint* num_layers
)

Description [src]

Returns the list of root layers contained in the specified image.

This procedure returns the list of root layers contained in the specified image. The order of layers is from topmost to bottommost. Note that this is not the full list of layers, but only the root layers, i.e. layers with no parents themselves. If you need all layers, it is up to you to verify that any of these layers is a group layer with gimp_item_is_group() and to obtain its children with gimp_item_get_children() (possibly recursively checking if these have children too).

This method is not directly available to language bindings.

Parameters

num_layers

Type: gint*

The number of root layers contained in the image.

The argument will be set by the function.

Return value

Type: An array of GimpLayer*

     The list of layers contained in the image.
     The returned value must be freed with g_free().

The length of the array is in the num_layers argument.
The caller of the method takes ownership of the data container, but not the data inside it.