cairo_surface_get_buffer


Description:


[ Version ( since = "3.0.8" ) ]
public Buffer cairo_surface_get_buffer (Surface surface, Object format, bool sync_back)

This function returns a [class@Gegl.

Buffer] containing surface's pixels. It must only be called on image surfaces, calling it on other surface types is an error.

If format is set, the returned buffer will use it. It has to map with surface Cairo format. If unset, the buffer format will be determined from surface. The main difference is that automatically determined format has sRGB space and TRC by default.

If you want the changes to the returned buffer to be synced back to surface data, set sync_back to true. If you don't need this and only want a copy of surface at a given time, false will be less costly.

When sync_back is true, [method@Gegl.Buffer.freeze_changed] and [ method@Gegl.Buffer.thaw_changed] may be useful to block intermediate syncing.

Parameters:

surface

a Cairo surface

format

a Babl format.

sync_back

whether changes on the returned buffer should be synced back to surface.

Returns:

a Buffer


Namespace: Gimp
Package: gimp-3.0