gegl-buffer

## gegl-buffer gegl-buffer |

## Functions

GeglBuffer * | gegl_buffer_new ()
GeglBuffer * | gegl_buffer_new_for_backend ()
void | gegl_buffer_add_handler ()
void | gegl_buffer_remove_handler ()
GeglBuffer * | gegl_buffer_open ()
void | gegl_buffer_save ()
GeglBuffer * | gegl_buffer_load ()
void | gegl_buffer_flush ()
GeglBuffer * | gegl_buffer_create_sub_buffer ()
const GeglRectangle * | gegl_buffer_get_extent ()
gboolean | gegl_buffer_set_extent ()
gboolean | gegl_buffer_set_abyss ()
#define | gegl_buffer_get_x()
#define | gegl_buffer_get_y()
#define | gegl_buffer_get_width()
#define | gegl_buffer_get_height()
#define | gegl_buffer_get_pixel_count()
void | gegl_buffer_get ()
void | gegl_buffer_set ()
void | gegl_buffer_set_color_from_pixel ()
void | gegl_buffer_set_pattern ()
const Babl * | gegl_buffer_get_format ()
const Babl * | gegl_buffer_set_format ()
void | gegl_buffer_clear ()
void | gegl_buffer_copy ()
GeglBuffer * | gegl_buffer_dup ()
void | gegl_buffer_sample_at_level ()
void | gegl_buffer_sample ()
void | gegl_buffer_sample_cleanup ()
void | (*GeglSamplerGetFun) ()
GeglSamplerGetFun | gegl_sampler_get_fun ()
GeglSampler * | gegl_buffer_sampler_new ()
GeglSampler * | gegl_buffer_sampler_new_at_level ()
void | gegl_sampler_get ()
#define | gegl_sampler_compute_scale()
const GeglRectangle * | gegl_sampler_get_context_rect ()
GeglBuffer * | gegl_buffer_linear_new ()
GeglBuffer * | gegl_buffer_linear_new_from_data ()
gpointer | gegl_buffer_linear_open ()
void | gegl_buffer_linear_close ()
const GeglRectangle * | gegl_buffer_get_abyss ()
glong | gegl_buffer_signal_connect ()
void | gegl_buffer_freeze_changed ()
void | gegl_buffer_thaw_changed ()
void | gegl_buffer_flush_ext ()

## Types and Values

#define | GEGL_AUTO_ROWSTRIDE
struct | GeglRectangle
| GeglBuffer
| GeglSampler
| GeglTileBackend

## Description

## Functions

### gegl_buffer_new ()

    GeglBuffer *
    gegl_buffer_new (const GeglRectangle *extent,
                     const Babl *format);

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

[skip]

#### Parameters

extent | the geometry of the buffer (origin, width and height) a GeglRectangle. |
format | the Babl pixel format to be used, create one with babl_format("RGBA u8") and similar. |

### gegl_buffer_new_for_backend ()

    GeglBuffer *
    gegl_buffer_new_for_backend (const GeglRectangle *extent,
                                 GeglTileBackend *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.

returns a GeglBuffer, that holds a reference to the provided backend.

#### Parameters

extent | the geometry of the buffer (origin, width and height) a GeglRectangle. |
backend | an instance of a GeglTileBackend subclass. |

### gegl_buffer_add_handler ()

    void
    gegl_buffer_add_handler (GeglBuffer *buffer,
                             gpointer handler);

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

#### Parameters

buffer | a GeglBuffer |
handler | a GeglTileHandler |

### gegl_buffer_remove_handler ()

    void
    gegl_buffer_remove_handler (GeglBuffer *buffer,
                                gpointer handler);

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

#### Parameters

buffer | a GeglBuffer |
handler | a GeglTileHandler |

### gegl_buffer_open ()

    GeglBuffer *
    gegl_buffer_open (const gchar *path);

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.

#### Parameters

path | the path to a gegl buffer on disk. |

#### Returns

a GeglBuffer object.

[transfer full]

### gegl_buffer_save ()

    void
    gegl_buffer_save (GeglBuffer *buffer,
                      const gchar *path,
                      const GeglRectangle *roi);

Write a GeglBuffer to a file.

#### Parameters

buffer | a GeglBuffer. | [transfer none]
path | the path where the gegl buffer will be saved, any writable GIO uri is valid. |
roi | the region of interest to write, this is the tiles that will be collected and written to disk. |

### gegl_buffer_load ()

    GeglBuffer *
    gegl_buffer_load (const gchar *path);

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.

#### Parameters

path | the path to a gegl buffer on disk. |

#### Returns

a GeglBuffer object.

[transfer full]

### gegl_buffer_flush ()

    void
    gegl_buffer_flush (GeglBuffer *buffer);

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

#### Parameters

buffer | a GeglBuffer |

### gegl_buffer_create_sub_buffer ()

    GeglBuffer *
    gegl_buffer_create_sub_buffer (GeglBuffer *buffer,
                                   const GeglRectangle *extent);

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

#### Parameters

buffer | parent buffer. | [transfer none]
extent | coordinates of new buffer. | [transfer none]

#### Returns

the new sub buffer.

[transfer full]

### gegl_buffer_get_extent ()

    const GeglRectangle *
    gegl_buffer_get_extent (GeglBuffer *buffer);

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

#### Parameters

buffer | the buffer to operate on. |

### gegl_buffer_set_extent ()

    gboolean
    gegl_buffer_set_extent (GeglBuffer *buffer,
                            const GeglRectangle *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.

Returns TRUE if the change of extent was successful.

#### Parameters

buffer | the buffer to operate on. |
extent | new extent. |

### gegl_buffer_set_abyss ()

    gboolean
    gegl_buffer_set_abyss (GeglBuffer *buffer,
                           const GeglRectangle *abyss);

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

Returns TRUE if the change of abyss was successful.

#### Parameters

buffer | the buffer to operate on. |
abyss | new abyss. |

### gegl_buffer_get_x()

    #define gegl_buffer_get_x(buffer)        (gegl_buffer_get_extent(buffer)->x)

Evaluates to the X coordinate of the upper left corner of the buffer's extent.

#### Parameters

buffer | a GeglBuffer |

### gegl_buffer_get_y()

    #define gegl_buffer_get_y(buffer)        (gegl_buffer_get_extent(buffer)->y)

Evaluates to the Y coordinate of the upper left corner of the buffer's extent.

#### Parameters

buffer | a GeglBuffer |

### gegl_buffer_get_width()

    #define gegl_buffer_get_width(buffer)    (gegl_buffer_get_extent(buffer)->width)

Evaluates to the width of the buffer's extent.

#### Parameters

buffer | a GeglBuffer |

### gegl_buffer_get_height()

    #define gegl_buffer_get_height(buffer)   (gegl_buffer_get_extent(buffer)->height)

Evaluates to the height of the buffer's extent.

#### Parameters

buffer | a GeglBuffer |

### gegl_buffer_get_pixel_count()

    #define gegl_buffer_get_pixel_count(buffer) (gegl_buffer_get_width(buffer) * gegl_buffer_get_height(buffer))

Returns the number of pixels of the extent of the buffer.

#### Parameters

buffer | a GeglBuffer |

### gegl_buffer_get ()

    void
    gegl_buffer_get (GeglBuffer *buffer,
                     const GeglRectangle *rect,
                     gdouble scale,
                     const Babl *format,
                     gpointer dest,
                     gint rowstride,
                     GeglAbyssPolicy repeat_mode);

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.

[skip]

#### Parameters

buffer | the buffer to retrieve data from. |
rect | the coordinates we want to retrieve data from, and width/height of destination buffer, if NULL equal to the extent of the buffer. The coordinates and dimensions are after scale has been applied. |
scale | sampling scale, 1.0 = pixel for pixel 2.0 = magnify, 0.5 scale down. |
format | the BablFormat to store in the linear buffer `dest` . |
dest | the memory destination for a linear buffer for the pixels, the size needed depends on the requested BablFormat. |
rowstride | rowstride in bytes, or GEGL_AUTO_ROWSTRIDE to compute the rowstride based on the width and bytes per pixel for the specified format. |
repeat_mode | how requests outside the buffer extent are handled. Valid values: GEGL_ABYSS_NONE (abyss pixels are zeroed), GEGL_ABYSS_WHITE (abyss pixels are white), GEGL_ABYSS_BLACK (abyss pixels are black), GEGL_ABYSS_CLAMP (coordinates are clamped to the abyss rectangle), GEGL_ABYSS_LOOP (buffer contents are tiled if outside of the abyss rectangle) this argument also takes a GEGL_BUFFER_FILTER value or'ed into it, allowing to specify trade-off of performance/quality, valid values are: GEGL_BUFFER_FILTER_NEAREST, GEGL_BUFFER_FILTER_BILINEAR, GEGL_BUFFER_FILTER_BOX and GEGL_BUFFER_FILTER_AUTO. |

### gegl_buffer_set ()

    void
    gegl_buffer_set (GeglBuffer *buffer,
                     const GeglRectangle *rect,
                     gint mipmap_level,
                     const Babl *format,
                     const void *src,
                     gint rowstride);

Store a linear raster buffer into the GeglBuffer.

[skip]

#### Parameters

buffer | the buffer to modify. |
rect | the coordinates we want to change the data of and the width/height of the linear buffer being set. the data when setting. |
mipmap_level | the scale level being set, 0 = 1:1 = default = base mipmap level, 1 = 1:2, 2=1:4, 3=1:8 .. |
format | the babl_format the linear buffer `src` . |
src | linear buffer of image data to be stored in `buffer` . |
rowstride | rowstride in bytes, or GEGL_AUTO_ROWSTRIDE to compute the rowstride based on the width and bytes per pixel for the specified format. |

### gegl_buffer_set_color_from_pixel ()

    void
    gegl_buffer_set_color_from_pixel (GeglBuffer *buffer,
                                      const GeglRectangle *rect,
                                      gconstpointer pixel,
                                      const Babl *pixel_format);

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

#### Parameters

buffer | a GeglBuffer |
rect | a rectangular region to fill with a color. |
pixel | pointer to the data of a single pixel |
pixel_format | the babl format of the pixel, if missing - the soft format of dst. |

### gegl_buffer_set_pattern ()

    void
    gegl_buffer_set_pattern (GeglBuffer *buffer,
                             const GeglRectangle *rect,
                             GeglBuffer *pattern,
                             gint x_offset,
                             gint y_offset);

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.

#### Parameters

buffer | a GeglBuffer |
rect | the region of `buffer` to fill |
pattern | a GeglBuffer to be repeated as a pattern |
x_offset | where the pattern starts horizontally |
y_offset | where the pattern starts vertical |

### gegl_buffer_get_format ()

    const Babl *
    gegl_buffer_get_format (GeglBuffer *buffer);

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

[skip]

#### Parameters

buffer | a GeglBuffer |

#### Returns

the babl format used for storing pixels in the buffer.

### gegl_buffer_set_format ()

    const Babl *
    gegl_buffer_set_format (GeglBuffer *buffer,
                            const Babl *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.

[skip]

#### Parameters

buffer | a GeglBuffer |
format | the new babl format, must have same bpp as original format. |

#### Returns

the new babl format or NULL if the passed-in buffer was incompatible (then the original format is still used).

### gegl_buffer_clear ()

    void
    gegl_buffer_clear (GeglBuffer *buffer,
                       const GeglRectangle *roi);

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

#### Parameters

buffer | a GeglBuffer |
roi | a rectangular region |

### gegl_buffer_copy ()

    void
    gegl_buffer_copy (GeglBuffer *src,
                      const GeglRectangle *src_rect,
                      GeglAbyssPolicy repeat_mode,
                      GeglBuffer *dst,
                      const GeglRectangle *dst_rect);

Copy a region from source buffer to destination buffer.

If the babl_formats of the buffers are the same, and the tile boundaries align, this will create copy-on-write tiles in the destination buffer.

This function never does any scaling. When src_rect and dst_rect do not have the same width and height, the size of src_rect is used.

#### Parameters

src | source buffer. | [transfer none]
src_rect | source rectangle (or NULL to copy entire source buffer) |
repeat_mode | the abyss policy to be using if src_rect is outside src's extent. |
dst | destination buffer. | [transfer none]
dst_rect | position of upper left destination pixel (or NULL to match `src_rect` ) |

### gegl_buffer_dup ()

    GeglBuffer *
    gegl_buffer_dup (GeglBuffer *buffer);

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

#### Parameters

buffer | the GeglBuffer to duplicate. | [transfer none]

#### Returns

the new buffer.

[transfer full]

### gegl_buffer_sample_at_level ()

    void
    gegl_buffer_sample_at_level (GeglBuffer *buffer,
                                 gdouble x,
                                 gdouble y,
                                 GeglBufferMatrix2 *scale,
                                 gpointer dest,
                                 const Babl *format,
                                 gint level,
                                 GeglSamplerType sampler_type,
                                 GeglAbyssPolicy repeat_mode);

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

If you intend to take multiple samples, consider using `gegl_buffer_sampler_new_at_level()` to create a sampler object instead, which is more efficient.

[skip]

#### Parameters

buffer | the GeglBuffer to sample from |
x | x coordinate to sample in buffer coordinates |
y | y coordinate to sample in buffer coordinates |
scale | a matrix that indicates scaling factors, see gegl_sampler_compute_scale the same. |
dest | buffer capable of storing one pixel in `format` . |
format | the format to store the sampled color in. |
level | mipmap level to sample from (`x` and `y` are level 0 coordinates) |
sampler_type | the sampler type to use, to be ported from working code. Valid values: GEGL_SAMPLER_NEAREST, GEGL_SAMPLER_LINEAR, GEGL_SAMPLER_CUBIC, GEGL_SAMPLER_NOHALO and GEGL_SAMPLER_LOHALO |
repeat_mode | how requests outside the buffer extent are handled. Valid values: GEGL_ABYSS_NONE (abyss pixels are zeroed), GEGL_ABYSS_WHITE (abyss pixels are white), GEGL_ABYSS_BLACK (abyss pixels are black), GEGL_ABYSS_CLAMP (coordinates are clamped to the abyss rectangle), GEGL_ABYSS_LOOP (buffer contents are tiled if outside of the abyss rectangle). |

### gegl_buffer_sample ()

    void
    gegl_buffer_sample (GeglBuffer *buffer,
                        gdouble x,
                        gdouble y,
                        GeglBufferMatrix2 *scale,
                        gpointer dest,
                        const Babl *format,
                        GeglSamplerType sampler_type,
                        GeglAbyssPolicy repeat_mode);

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

If you intend to take multiple samples, consider using `gegl_buffer_sampler_new()` to create a sampler object instead, which is more efficient.

[skip]

#### Parameters

buffer | the GeglBuffer to sample from |
x | x coordinate to sample in buffer coordinates |
y | y coordinate to sample in buffer coordinates |
scale | a matrix that indicates scaling factors, see gegl_sampler_compute_scale the same. |
dest | buffer capable of storing one pixel in `format` . |
format | the format to store the sampled color in. |
sampler_type | the sampler type to use, to be ported from working code. Valid values: GEGL_SAMPLER_NEAREST, GEGL_SAMPLER_LINEAR, GEGL_SAMPLER_CUBIC, GEGL_SAMPLER_NOHALO and GEGL_SAMPLER_LOHALO |
repeat_mode | how requests outside the buffer extent are handled. Valid values: GEGL_ABYSS_NONE (abyss pixels are zeroed), GEGL_ABYSS_WHITE (abyss pixels are white), GEGL_ABYSS_BLACK (abyss pixels are black), GEGL_ABYSS_CLAMP (coordinates are clamped to the abyss rectangle), GEGL_ABYSS_LOOP (buffer contents are tiled if outside of the abyss rectangle). |

### gegl_buffer_sample_cleanup ()

    void
    gegl_buffer_sample_cleanup (GeglBuffer *buffer);

`gegl_buffer_sample_cleanup` has been deprecated since version 0.4.2 and should not be used in newly-written code.

This function has no effect. It is not necessary to call it after using `gegl_buffer_sample()` or `gegl_buffer_sample_at_level()`.

Clean up resources used by sampling framework of buffer.

#### Parameters

buffer | the GeglBuffer to sample from |

### GeglSamplerGetFun ()

    void
    (*GeglSamplerGetFun) (GeglSampler *self,
                          gdouble x,
                          gdouble y,
                          GeglBufferMatrix2 *scale,
                          void *output,
                          GeglAbyssPolicy repeat_mode);

### gegl_sampler_get_fun ()

    GeglSamplerGetFun
    gegl_sampler_get_fun (GeglSampler *sampler);

Get the raw sampler function, the raw sampler function does not do additional NaN / inifinity checks on passed in coordinates.

[skip]

### gegl_buffer_sampler_new ()

    GeglSampler *
    gegl_buffer_sampler_new (GeglBuffer *buffer,
                             const Babl *format,
                             GeglSamplerType sampler_type);

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

Samplers only hold weak references to buffers, so if its buffer is freed the sampler will become invalid.

[skip]

#### Parameters

buffer | buffer to create a new sampler for |
format | format we want data back in |
sampler_type | the sampler type to use, to be ported from working code. Valid values: GEGL_SAMPLER_NEAREST, GEGL_SAMPLER_LINEAR, GEGL_SAMPLER_CUBIC, GEGL_SAMPLER_NOHALO and GEGL_SAMPLER_LOHALO |

### gegl_buffer_sampler_new_at_level ()

    GeglSampler *
    gegl_buffer_sampler_new_at_level (GeglBuffer *buffer,
                                      const Babl *format,
                                      GeglSamplerType sampler_type,
                                      gint level);

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

Samplers only hold weak references to buffers, so if its buffer is freed the sampler will become invalid.

[skip]

#### Parameters

buffer | buffer to create a new sampler for |
format | format we want data back in |
sampler_type | the sampler type to use, |
level | the mipmap level to create a sampler for to be ported from working code. Valid values: GEGL_SAMPLER_NEAREST, GEGL_SAMPLER_LINEAR, GEGL_SAMPLER_CUBIC, GEGL_SAMPLER_NOHALO and GEGL_SAMPLER_LOHALO |

### gegl_sampler_get ()

    void
    gegl_sampler_get (GeglSampler *sampler,
                      gdouble x,
                      gdouble y,
                      GeglBufferMatrix2 *scale,
                      void *output,
                      GeglAbyssPolicy repeat_mode);

Perform a sampling with the provided `sampler` .

#### Parameters

sampler | a GeglSampler gotten from gegl_buffer_sampler_new |
x | x coordinate to sample |
y | y coordinate to sample |
scale | matrix representing extent of sampling area in source buffer. |
output | memory location for output data. |
repeat_mode | how requests outside the buffer extent are handled. Valid values: GEGL_ABYSS_NONE (abyss pixels are zeroed), GEGL_ABYSS_WHITE (abyss pixels are white), GEGL_ABYSS_BLACK (abyss pixels are black), GEGL_ABYSS_CLAMP (coordinates are clamped to the abyss rectangle), GEGL_ABYSS_LOOP (buffer contents are tiled if outside of the abyss rectangle). |

### gegl_sampler_compute_scale()

    #define             gegl_sampler_compute_scale(matrix, x, y)

### gegl_sampler_get_context_rect ()

    const GeglRectangle *
    gegl_sampler_get_context_rect (GeglSampler *sampler);

#### Parameters

sampler | a GeglSampler gotten from gegl_buffer_sampler_new |

#### Returns

The context rectangle of the given `sampler` .

### gegl_buffer_linear_new ()

    GeglBuffer *
    gegl_buffer_linear_new (const GeglRectangle *extent,
                            const Babl *format);

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.

[skip]

#### Parameters

extent | dimensions of buffer. |
format | desired pixel format. |

#### Returns

a GeglBuffer that can be used as any other GeglBuffer.

### gegl_buffer_linear_new_from_data ()

    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);

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.

[skip]

#### Parameters

data | a pointer to a linear buffer in memory. |
format | the format of the data in memory |
extent | the dimensions (and upper left coordinates) of linear buffer. |
rowstride | the number of bytes between rowstarts in memory (or 0 to autodetect) |
destroy_fn | function to call to free data or NULL if memory should not be freed. |
destroy_fn_data | extra argument to be passed to void destroy(ptr, data) type function. |

#### Returns

a GeglBuffer that can be used as any other GeglBuffer.

### gegl_buffer_linear_open ()

    gpointer
    gegl_buffer_linear_open (GeglBuffer *buffer,
                             const GeglRectangle *extent,
                             gint *rowstride,
                             const Babl *format);

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

[skip]

#### Parameters

buffer | a GeglBuffer. |
extent | region to open, pass NULL for entire buffer. |
rowstride | return location for rowstride. |
format | desired format or NULL to use buffers format. |

#### Returns

a pointer to a linear memory region describing the buffer, if the request is compatible with the underlying data storage direct access to the underlying data is provided. Otherwise, it returns a copy of the data.

### gegl_buffer_linear_close ()

    void
    gegl_buffer_linear_close (GeglBuffer *buffer,
                              gpointer linear);

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

#### Parameters

buffer | a GeglBuffer. |
linear | a previously returned buffer. |

### gegl_buffer_get_abyss ()

    const GeglRectangle *
    gegl_buffer_get_abyss (GeglBuffer *buffer);

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

#### Parameters

buffer | a GeglBuffer. |

### gegl_buffer_signal_connect ()

    glong
    gegl_buffer_signal_connect (GeglBuffer *buffer,
                                const char *detailed_signal,
                                GCallback c_handler,
                                gpointer data);

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.

#### Parameters

buffer | a GeglBuffer |
detailed_signal | only "changed" expected for now |
c_handler | (scope async) : c function callback |
data | user data: |

#### Returns

an handle like g_signal_connect.

### gegl_buffer_freeze_changed ()

    void
    gegl_buffer_freeze_changed (GeglBuffer *buffer);

Blocks emission of the "changed" signal for `buffer` .

While the signal is blocked, changes to `buffer` are accumulated, and will be emitted once the signal is unblocked, using `gegl_buffer_thaw_changed()`.

#### Parameters

buffer | a GeglBuffer |

### gegl_buffer_thaw_changed ()

    void
    gegl_buffer_thaw_changed (GeglBuffer *buffer);

Unblocks emission of the "changed" signal for `buffer` .

Once all calls to `gegl_buffer_freeze_changed()` are matched by corresponding calls to `gegl_buffer_freeze_changed()`, all accumulated changes are emitted.

#### Parameters

buffer | a GeglBuffer |

### gegl_buffer_flush_ext ()

    void
    gegl_buffer_flush_ext (GeglBuffer *buffer,
                           const GeglRectangle *rect);

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.

#### Parameters

buffer | a GeglBuffer |
rect | rectangle |

## Types and Values

### GEGL_AUTO_ROWSTRIDE

    #define             GEGL_AUTO_ROWSTRIDE

### struct GeglRectangle

    struct GeglRectangle {
      gint x;
      gint y;
      gint width;
      gint height;
    };

### GeglBuffer

    typedef struct {
      GeglTileHandler   parent_instance; /* which is a GeglTileHandler which has a
                                            source field which is used for chaining
                                            sub buffers with their anchestors */

      GeglRectangle     extent;        /* the dimensions of the buffer */

      const Babl       *format;  /* the pixel format used for pixels in this
                                    buffer */
      const Babl  *soft_format;  /* the format the buffer pretends to be, might
                                    be different from format */

      gint              shift_x; /* The relative offset of origins compared with */
      gint              shift_y; /* anchestral tile_storage buffer, during       */
                                 /* construction relative to immediate source    */

      GeglRectangle     abyss;
      gboolean          abyss_tracks_extent; /* specifies whether the abyss rectangle
                                                should track any modifications to the
                                                extent rectangle */

      GeglTileStorage  *tile_storage;

      gint              tile_width;
      gint              tile_height;
      gchar            *path;

      gint              lock_count;

      gpointer         *alloc_stack_trace; /* Stack trace for allocation,
                                              useful for debugging */
      gint              alloc_stack_size;

      gint              changed_signal_connections; /* to avoid firing changed signals
                                                       with no listeners */
      gint              changed_signal_freeze_count;
      GeglRectangle     changed_signal_accumulator;

      GeglTileBackend  *backend;
    } GeglBuffer;

### GeglSampler

    typedef struct {
      GObject                    parent_instance;

      GeglSamplerGetFun          get;
      GeglSamplerInterpolateFun  interpolate;
    } GeglSampler;

### GeglTileBackend

    typedef struct {
      GeglTileSource          parent_instance;
      GeglTileBackendPrivate *priv;
    } GeglTileBackend;