### Class

# Gegl Buffer

#### Description

    final class Gegl.Buffer : Gegl.TileHandler {
      /* No available fields */
    }

No description available.

#### Hierarchy

#### Ancestors

- GeglTileHandler
- GeglTileSource
- GObject

#### Constructors

###### gegl_buffer_introspectable_new

Create a new GeglBuffer with the given format and dimensions.

###### gegl_buffer_linear_new

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

###### gegl_buffer_linear_new_from_data

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.

###### gegl_buffer_new

Create a new GeglBuffer of a given format with a given extent. It is possible to pass in NULL for both extent and format, a NULL extent creates an empty buffer and a NULL format makes the buffer default to “RGBA float”.

###### gegl_buffer_new_for_backend

Create a new GeglBuffer from a backend, if NULL is passed in the extent of the buffer will be inherited from the extent of the backend.

#### Functions

###### gegl_buffer_load

Loads an existing GeglBuffer from disk, if it has previously been saved with gegl_buffer_save it should be possible to open through any GIO transport, buffers that have been used as swap needs random access to be opened.

###### gegl_buffer_open

Open an existing on-disk GeglBuffer, this buffer is opened in a monitored state so multiple instances of gegl can share the same buffer. Sets on one buffer are reflected in the other.

###### gegl_buffer_swap_create_file

Generates a unique filename in the GEGL swap directory, suitable for using as swap space. When the file is no longer needed, it may be removed with gegl_buffer_swap_remove_file(); otherwise, it will be removed when `gegl_exit()` is called.

###### gegl_buffer_swap_has_file

Tests if `path` is a swap file, that is, if it has been created with gegl_buffer_swap_create_file(), and hasn’t been removed yet.

###### gegl_buffer_swap_remove_file

Removes a swap file, generated using gegl_buffer_swap_create_file(), unlinking the file, if exists.

#### Instance methods

###### gegl_buffer_add_handler

Add a new tile handler in the existing chain of tile handler of a GeglBuffer.

###### gegl_buffer_clear

Clears the provided rectangular region by setting all the associated memory to 0.

###### gegl_buffer_copy

Copy a region from source buffer to destination buffer.

###### gegl_buffer_create_sub_buffer

Create a new sub GeglBuffer, that is a view on a larger buffer.

###### gegl_buffer_dup

Duplicate a buffer (internally uses gegl_buffer_copy). Aligned tiles will create copy-on-write clones in the new buffer.

###### gegl_buffer_flush

Flushes all unsaved data to disk, this is not necessary for shared geglbuffers opened with gegl_buffer_open since they auto-sync on writes.

###### gegl_buffer_flush_ext

Invokes the external flush function, if any is set on the provided buffer - this ensures that data pending - in the current implementation only OpenCL - externally to be synchronized with the buffer. Multi threaded code should call such a synchronization before branching out to avoid each of the threads having an implicit synchronization of its own.

###### gegl_buffer_freeze_changed

Blocks emission of the “changed” signal for `buffer`.

###### gegl_buffer_get

Fetch a rectangular linear buffer of pixel data from the GeglBuffer, the data is converted to the desired BablFormat, if the BablFormat stored and fetched is the same this amounts to a series of memcpy’s aligned to demux the tile structure into a linear buffer.

###### gegl_buffer_get_abyss

Return the abyss extent of a buffer, this expands out to the parents extent in subbuffers.

###### gegl_buffer_get_extent

Returns a pointer to a GeglRectangle structure defining the geometry of a specific GeglBuffer, this is also the default width/height of buffers passed in to gegl_buffer_set and gegl_buffer_get (with a scale of 1.0 at least).

###### gegl_buffer_get_format

Get the babl format of the buffer, this might not be the format the buffer was originally created with, you need to use gegl_buffer_set_format (buf, NULL); to retrieve the original format (potentially having saved away the original format of the buffer to re-set it.)

###### gegl_buffer_get_tile

No description available.

###### gegl_buffer_introspectable_get

Fetch a rectangular linear buffer of pixel data from the GeglBuffer.

###### gegl_buffer_introspectable_set

Store a linear raster buffer into the GeglBuffer.

###### gegl_buffer_iterator_new

Create a new buffer iterator, this buffer will be iterated through in linear chunks, some chunks might be full tiles the coordinates, see the documentation of gegl_buffer_iterator_next for how to use it and destroy it.

###### gegl_buffer_linear_close

This function makes sure GeglBuffer and underlying code is aware of changes being made to the linear buffer. If the request was not a compatible one it is written back to the buffer. Multiple concurrent users can be handed the same buffer (both raw access and converted).

###### gegl_buffer_linear_open

Raw direct random access to the full data of a buffer in linear memory.

###### gegl_buffer_remove_handler

Remove the provided tile handler in the existing chain of tile handler of a GeglBuffer.

###### gegl_buffer_sample

Query interpolate pixel values at a given coordinate using a specified form of interpolation.

###### gegl_buffer_sample_at_level

Query interpolate pixel values at a given coordinate using a specified form of interpolation.

###### gegl_buffer_sample_cleanup

Clean up resources used by sampling framework of buffer.

deprecated: 0.4.2

###### gegl_buffer_sampler_new

Create a new sampler, when you are done with the sampler, g_object_unref it.

###### gegl_buffer_sampler_new_at_level

Create a new sampler, when you are done with the sampler, g_object_unref it.

###### gegl_buffer_save

Write a GeglBuffer to a file.

###### gegl_buffer_set

Store a linear raster buffer into the GeglBuffer.

###### gegl_buffer_set_abyss

Changes the size and position of the abyss rectangle of a buffer.

###### gegl_buffer_set_color

Sets the region covered by rect to the specified color.

###### gegl_buffer_set_color_from_pixel

Sets the region covered by rect to the the provided pixel.

###### gegl_buffer_set_extent

Changes the size and position that is considered active in a buffer, this operation is valid on any buffer, reads on subbuffers outside the master buffer’s extent are at the moment undefined.

###### gegl_buffer_set_format

Set the babl format of the buffer, setting the babl format of the buffer requires the new format to have exactly the same bytes per pixel as the original format. If NULL is passed in the format of the buffer is reset to the original format.

###### gegl_buffer_set_pattern

Fill a region with a repeating pattern. Offsets parameters are relative to the origin (0, 0) and not to the rectangle. So be carefull about the origin of `pattern` and `buffer` extents.

###### gegl_buffer_share_storage

Checks if a pair of buffers share the same underlying tile storage.

###### gegl_buffer_signal_connect

This function should be used instead of g_signal_connect when connecting to the GeglBuffer::changed signal handler, GeglBuffer contains additional machinery to avoid the overhead of changes when no signal handler have been connected, if regular g_signal_connect is used; then no signals will be emitted.

###### gegl_buffer_thaw_changed

Unblocks emission of the “changed” signal for `buffer`.

##### Methods inherited from GeglTileHandler (9)

###### gegl_tile_handler_create_tile

Create a new tile associated with this tile handler.

###### gegl_tile_handler_damage_rect

No description available.

###### gegl_tile_handler_damage_tile

No description available.

###### gegl_tile_handler_dup_tile

Create a duplicate of `tile`, associated with this tile handler.

###### gegl_tile_handler_get_source_tile

Fetches the tile at the given coordinates from `handler` source. If the tile doesn’t exist, or if `handler` doesn’t have a source, creates a new tile associated with this tile handler.

###### gegl_tile_handler_get_tile

Fetches the tile at the given coordinates from `handler`. If the tile doesn’t exist, creates a new tile associated with this tile handler.

###### gegl_tile_handler_lock

No description available.

###### gegl_tile_handler_set_source

No description available.

###### gegl_tile_handler_unlock

No description available.

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

Please see GObject for a full list of methods.

#### Properties

###### Gegl.Buffer:abyss-height

No description available.

###### Gegl.Buffer:abyss-width

No description available.

###### Gegl.Buffer:abyss-x

No description available.

###### Gegl.Buffer:abyss-y

No description available.

###### Gegl.Buffer:backend

No description available.

###### Gegl.Buffer:format

No description available.

###### Gegl.Buffer:height

No description available.

###### Gegl.Buffer:initialized

No description available.

###### Gegl.Buffer:path

No description available.

###### Gegl.Buffer:pixels

No description available.

###### Gegl.Buffer:px-size

No description available.

###### Gegl.Buffer:shift-x

No description available.

###### Gegl.Buffer:shift-y

No description available.

###### Gegl.Buffer:tile-height

No description available.

###### Gegl.Buffer:tile-width

No description available.

###### Gegl.Buffer:width

No description available.

###### Gegl.Buffer:x

No description available.

###### Gegl.Buffer:y

No description available.

##### Properties inherited from GeglTileHandler (1)

###### Gegl.TileHandler:source

No description available.

#### Signals

###### Gegl.Buffer::changed

No description available.

##### 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.