Gegl.Buffer.linear_new_from_data
Description: Reference for Gegl.Buffer.linear_new_from_data

### Constructor

# Gegl Bufferlinear_new_from_data

#### Declaration [src]

    GeglBuffer*
    gegl_buffer_linear_new_from_data (
      const gpointer data,
      const Babl* format,
      const GeglRectangle* extent,
      gint rowstride,
      GDestroyNotify destroy_fn,
      gpointer destroy_fn_data
    )

#### Description [src]

Creates a GeglBuffer backed by a linear memory buffer that already exists, of the given `extent` in the specified `format`. babl_format (“R’G’B’A u8”) for instance to make a normal 8bit buffer.

This method is not directly available to language bindings.

#### Parameters

`data`

  Type: `const gpointer`

  A pointer to a linear buffer in memory.

  The argument can be `NULL`.

`format`

  Type: `Babl`

  The format of the data in memory.

  The data is owned by the caller of the function.

`extent`

  Type: `GeglRectangle`

  The dimensions (and upper left coordinates) of linear buffer.

  The data is owned by the caller of the function.

`rowstride`

  Type: `gint`

  The number of bytes between rowstarts in memory (or 0 to autodetect)

`destroy_fn`

  Type: `GDestroyNotify`

  Function to call to free data or NULL if memory should not be freed.

`destroy_fn_data`

  Type: `gpointer`

  Extra argument to be passed to void destroy(ptr, data) type function.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

#### Return value

Type: `GeglBuffer`

A GeglBuffer that can be used as any other GeglBuffer.

The caller of the function takes ownership of the data, and is responsible for freeing it.