Gegl.BufferIterator.add

### Method

# Gegl BufferIteratoradd

#### Declaration [src]

    gint
    gegl_buffer_iterator_add (
      GeglBufferIterator* iterator,
      GeglBuffer* buffer,
      const GeglRectangle* roi,
      gint level,
      const Babl* format,
      GeglAccessMode access_mode,
      GeglAbyssPolicy abyss_policy
    )

#### Description [src]

Adds an additional buffer sub-iterator into `iterator` that will be processed in sync with the first one (unless this is the first sub-iterator).

The iterator prioritizes accessing tile data of `buffer` directly but if the `buffer` doesn’t align with the first one for tile access the corresponding scans and regions will be serialized automatically using `gegl_buffer_get()`. The `roi` of all buffer sub-iterators added after the first one will have their dimensions set to the first one.

If `buffer` shares its tiles with a previously-added `GeglBuffer` (in particular, if the same `GeglBuffer` is added more than once), and at least one of the buffers is accessed for writing, the corresponding iterated-over areas should either completely overlap, or not overlap at all, in the coordinate system of the underlying tile storage (that is, after shifting each area by the corresponding buffer’s `GeglBuffer:shift-x` and `GeglBuffer:shift-y` properties). If the areas overlap, at most one of the buffers may be accessed for writing, and the data pointers of the corresponding iterator items may refer to the same data.

This method is not directly available to language bindings.

skip-reason | babl_since_7dcbb732

#### Parameters

`buffer`

  Type: `GeglBuffer`

  A `GeglBuffer` to iterate over.

  The data is owned by the caller of the method.

`roi`

  Type: `GeglRectangle`

  The region in `buffer` to iterate over.

  The data is owned by the caller of the method.

`level`

  Type: `gint`

  The level at which we are iterating. The `roi` will indicate the extent at 1:1. `x`, `y`, `width` and `height` are `/ (2^level)`.

`format`

  Type: `Babl`

  The format we want to process this buffers data in, pass 0 to use the buffers format.

  The data is owned by the caller of the method.

`access_mode`

  Type: `GeglAccessMode`

  Whether we need reading or writing to this buffer.

`abyss_policy`

  Type: `GeglAbyssPolicy`

  How requests outside the buffer extent are handled.

#### Return value

Type: `gint`

An integer handle refering to the indice in the iterator structure of the added sub-iterator.