gegl-buffer-iterator

gegl-buffer-iterator

Functions

GeglBufferIterator * gegl_buffer_iterator_empty_new ()
GeglBufferIterator * gegl_buffer_iterator_new ()
gint gegl_buffer_iterator_add ()
void gegl_buffer_iterator_stop ()
gboolean gegl_buffer_iterator_next ()

Types and Values

Description

Functions

gegl_buffer_iterator_empty_new ()

GeglBufferIterator *
gegl_buffer_iterator_empty_new (int max_slots);

Returns

a new [structGegl.BufferIterator ] without any sub-iterators.


gegl_buffer_iterator_new ()

GeglBufferIterator *
gegl_buffer_iterator_new (GeglBuffer *buffer,
                          const GeglRectangle *roi,
                          gint level,
                          const Babl *format,
                          GeglAccessMode access_mode,
                          GeglAbyssPolicy abyss_policy,
                          gint max_slots);

Creates a new [structGegl.BufferIterator ]. The iterator can use one or more sub-iterators to iterate over one or more [classGegl.Buffer ]. [structGegl.BufferIterator ] takes care of accessing the given buffers in the most optimal ways.

See the documentation of [method.Gegl.BufferIterator.add] and [method.Gegl.BufferIterator.next].

[attributes skip-reason=babl_since_7dcbb732]

Parameters

buffer

a [classGegl.Buffer ] to iterate over

 

roi

the region in buffer to iterate over

 

level

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

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

 

access_mode

whether we need reading or writing to this buffer one of [flagsGegl.AccessMode.READ ], [flagsGegl.AccessMode.WRITE ] and [flagsGegl.AccessMode.READWRITE ].

 

abyss_policy

how requests outside the buffer extent are handled.

 

max_slots

the maximum number of buffer iterators.

 

Returns

a new [structGegl.BufferIterator ] with one sub-iterator.


gegl_buffer_iterator_add ()

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

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 [methodGegl.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 [classGegl.Buffer ] (in particular, if the same [classGegl.Buffer ] 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 [propertyGegl.Buffer :shift-x] and [propertyGegl.Buffer :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.

[attributes skip-reason=babl_since_7dcbb732]

Parameters

iterator

a [structGegl.BufferIterator ]

 

buffer

a [classGegl.Buffer ] to iterate over

 

roi

the region in buffer to iterate over

 

level

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

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

 

access_mode

whether we need reading or writing to this buffer.

 

abyss_policy

how requests outside the buffer extent are handled.

 

Returns

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


gegl_buffer_iterator_stop ()

void
gegl_buffer_iterator_stop (GeglBufferIterator *iterator);

Cancels the current iteration and invalidates the [structGegl.BufferIterator ].

[attributes skip-reason=unknown_since_f0408f3f]

Parameters

iterator

a GeglBufferIterator

 

gegl_buffer_iterator_next ()

gboolean
gegl_buffer_iterator_next (GeglBufferIterator *iterator);

Do an iteration. If there is more data to process, a new set of linear chunks of memory becomes available in all items via [structGegl.BufferIteratorItem ].

Changed data from a previous iteration step will be saved now. When there is no more data to be processed FALSE will be returned (and the [structGegl.BufferIterator ] becomes invalid).

[attributes skip-reason=unknown_since_f0408f3f]

Parameters

iterator

a GeglBufferIterator

 

Returns

TRUE if there is more work FALSE if iteration is complete.

Types and Values

GEGL_BUFFER_READ

#define GEGL_BUFFER_READ      GEGL_ACCESS_READ

GEGL_BUFFER_WRITE

#define GEGL_BUFFER_WRITE     GEGL_ACCESS_WRITE

GEGL_BUFFER_READWRITE

#define GEGL_BUFFER_READWRITE GEGL_ACCESS_READWRITE

GeglBufferIteratorPriv

typedef struct _GeglBufferIteratorPriv GeglBufferIteratorPriv;