workshop: migrate ops to new iterator api

parent 749443cc
......@@ -17,6 +17,7 @@
*
*/
#define GEGL_ITERATOR2_API
#include <stdio.h>
#include "config.h"
#include <glib/gi18n-lib.h>
......
......@@ -17,6 +17,7 @@
*
*/
#define GEGL_ITERATOR2_API
#include <stdio.h>
#include "config.h"
#include <glib/gi18n-lib.h>
......
......@@ -734,13 +734,13 @@ static inline void pixel_duster_add_probes_for_transparent (PixelDuster *duster)
0,
format,
GEGL_ACCESS_WRITE,
GEGL_ABYSS_NONE);
GEGL_ABYSS_NONE, 1);
while (gegl_buffer_iterator_next (i))
{
gint x = i->roi[0].x;
gint y = i->roi[0].y;
gint n_pixels = i->roi[0].width * i->roi[0].height;
float *out_pix = i->data[0];
gint x = i->items[0].roi.x;
gint y = i->items[0].roi.y;
gint n_pixels = i->items[0].roi.width * i->items[0].roi.height;
float *out_pix = i->items[0].data;
while (n_pixels--)
{
if (out_pix[3] <= 0.001 ||
......@@ -753,9 +753,9 @@ static inline void pixel_duster_add_probes_for_transparent (PixelDuster *duster)
out_pix += 4;
x++;
if (x >= i->roi[0].x + i->roi[0].width)
if (x >= i->items[0].roi.x + i->items[0].roi.width)
{
x = i->roi[0].x;
x = i->items[0].roi.x;
y++;
}
}
......
......@@ -19,6 +19,7 @@
*
*/
#define GEGL_ITERATOR2_API
#include "config.h"
#include <glib/gi18n-lib.h>
......@@ -177,11 +178,11 @@ assign_pixels_to_clusters (GeglBuffer *input,
GeglBufferIterator *iter;
iter = gegl_buffer_iterator_new (input, NULL, 0, babl_format ("CIE Lab float"),
GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
GEGL_ACCESS_READ, GEGL_ABYSS_NONE, 1);
while (gegl_buffer_iterator_next (iter))
{
gfloat *pixel = iter->data[0];
gfloat *pixel = iter->items[0].data;
glong n_pixels = iter->length;
while (n_pixels--)
......@@ -242,15 +243,15 @@ set_output (GeglBuffer *input,
GeglBufferIterator *iter;
iter = gegl_buffer_iterator_new (output, NULL, 0, babl_format ("CIE Lab float"),
GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE, 2);
gegl_buffer_iterator_add (iter, input, NULL, 0, babl_format ("CIE Lab float"),
GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (iter))
{
gfloat *out_pixel = iter->data[0];
gfloat *in_pixel = iter->data[1];
gfloat *out_pixel = iter->items[0].data;
gfloat *in_pixel = iter->items[1].data;
glong n_pixels = iter->length;
while (n_pixels--)
......@@ -395,4 +396,4 @@ gegl_op_class_init (GeglOpClass *klass)
NULL);
}
#endif
\ No newline at end of file
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment