mirror of https://github.com/GNOME/gimp.git
app: migrate gimpoperationcagecoefcalc to new iterator api
This commit is contained in:
parent
95358ca1fa
commit
822f9f0d2b
|
@ -20,6 +20,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||||
|
#define GEGL_ITERATOR2_API
|
||||||
#include <gegl.h>
|
#include <gegl.h>
|
||||||
|
|
||||||
#include "libgimpmath/gimpmath.h"
|
#include "libgimpmath/gimpmath.h"
|
||||||
|
@ -212,17 +213,17 @@ gimp_operation_cage_coef_calc_process (GeglOperation *operation,
|
||||||
n_cage_vertices = gimp_cage_config_get_n_points (config);
|
n_cage_vertices = gimp_cage_config_get_n_points (config);
|
||||||
|
|
||||||
it = gegl_buffer_iterator_new (output, roi, 0, format,
|
it = gegl_buffer_iterator_new (output, roi, 0, format,
|
||||||
GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE);
|
GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE, 1);
|
||||||
|
|
||||||
while (gegl_buffer_iterator_next (it))
|
while (gegl_buffer_iterator_next (it))
|
||||||
{
|
{
|
||||||
/* iterate inside the roi */
|
/* iterate inside the roi */
|
||||||
gint n_pixels = it->length;
|
gint n_pixels = it->length;
|
||||||
gint x = it->roi->x; /* initial x */
|
gint x = it->items[0].roi.x; /* initial x */
|
||||||
gint y = it->roi->y; /* and y coordinates */
|
gint y = it->items[0].roi.y; /* and y coordinates */
|
||||||
gint j;
|
gint j;
|
||||||
|
|
||||||
gfloat *coef = it->data[0];
|
gfloat *coef = it->items[0].data;
|
||||||
|
|
||||||
while(n_pixels--)
|
while(n_pixels--)
|
||||||
{
|
{
|
||||||
|
@ -282,9 +283,9 @@ gimp_operation_cage_coef_calc_process (GeglOperation *operation,
|
||||||
|
|
||||||
/* update x and y coordinates */
|
/* update x and y coordinates */
|
||||||
x++;
|
x++;
|
||||||
if (x >= (it->roi->x + it->roi->width))
|
if (x >= (it->items[0].roi.x + it->items[0].roi.width))
|
||||||
{
|
{
|
||||||
x = it->roi->x;
|
x = it->items[0].roi.x;
|
||||||
y++;
|
y++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue