Constructor

GeglBufferlinear_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 constructor is not directly available to language bindings

Parameters

data const gpointer
 

A pointer to a linear buffer in memory.

 The argument can be NULL.
format Babl
 

The format of the data in memory.

 The data is owned by the caller of the function.
extent GeglRectangle
 

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

 The data is owned by the caller of the function.
rowstride gint
 

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

destroy_fn GDestroyNotify
 

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

destroy_fn_data 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

Returns: 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.