Commit 4fdf9ebf authored by Øyvind "pippin" Kolås's avatar Øyvind "pippin" Kolås

buffer: add gegl-buffer-formats.h and gegl-bufefr-matrix2.h

The 2x2 matrix is only used by GeglBuffer and its API, gimp-2.10 does not
use the symbols - we are remaining abi compatible but are rearranging
locations of symbols.
parent a6a6ba6f
......@@ -58,6 +58,7 @@ GEGL_introspectable_headers = \
gegl-init.h \
gegl-version.h \
buffer/gegl-buffer.h \
buffer/gegl-buffer-matrix2.h \
buffer/gegl-buffer-iterator.h \
buffer/gegl-buffer-iterator2.h \
buffer/gegl-buffer-backend.h \
......
......@@ -29,6 +29,8 @@ libbuffer_la_SOURCES = \
gegl-buffer-access.c \
gegl-buffer-config.c \
gegl-buffer-config.h \
gegl-buffer-matrix2.c \
gegl-buffer-matrix2.h \
gegl-buffer-index.h \
gegl-buffer-iterator.c \
gegl-buffer-iterator2.c \
......@@ -63,6 +65,7 @@ libbuffer_la_SOURCES = \
gegl-buffer-iterator2.h \
gegl-buffer-iterator-private.h \
gegl-buffer-types.h \
gegl-buffer-formats.h \
gegl-sampler.h \
gegl-sampler-cubic.h \
gegl-sampler-linear.h \
......
......@@ -27,7 +27,7 @@
#include "gegl-buffer.h"
#include "gegl-types.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
#include "gegl-utils.h"
#include "gegl-algorithms.h"
......
......@@ -38,7 +38,7 @@
#include "gegl-tile-backend.h"
#include "gegl-buffer-iterator.h"
#include "gegl-buffer-iterator-private.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
static void gegl_buffer_iterate_read_fringed (GeglBuffer *buffer,
const GeglBufferRectangle *roi,
......
/* This file is part of GEGL
*
* GEGL is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* GEGL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with GEGL; if not, see <https://www.gnu.org/licenses/>.
*
* Copyright 2018 Øyvind Kolås
*/
#ifndef __GEGL_BUFFER_FORMATS_H__
#define __GEGL_BUFFER_FORMATS_H__
#include <babl/babl.h>
G_BEGIN_DECLS
/* the code in babl for looking up models, formats and types is quick -
but when formats end up being used as consts for comparisons in the core of
GEGL, it is good to have even better caching, hence this way of generating
and accessing per compilation unit caches of formats.
*/
#define GEGL_CACHED_BABL(klass, typ, name) \
static inline const Babl *gegl_babl_##typ (void) { static const Babl *type = NULL; if (!type) type = babl_##klass (name); return type; }
GEGL_CACHED_BABL(type, half, "half")
GEGL_CACHED_BABL(type, float, "float")
GEGL_CACHED_BABL(type, u8, "u8")
GEGL_CACHED_BABL(type, u16, "u16")
GEGL_CACHED_BABL(type, u32, "u32")
GEGL_CACHED_BABL(type, double, "double")
GEGL_CACHED_BABL(model, rgb_linear, "RGB")
GEGL_CACHED_BABL(model, rgba_linear, "RGBA")
GEGL_CACHED_BABL(model, rgbA_linear, "RaGaBaA")
GEGL_CACHED_BABL(model, y_linear, "Y")
GEGL_CACHED_BABL(model, ya_linear, "YA")
GEGL_CACHED_BABL(model, yA_linear, "YaA")
static inline gboolean gegl_babl_model_is_linear (const Babl *babl)
{
if (babl == gegl_babl_rgba_linear() ||
babl == gegl_babl_rgbA_linear() ||
babl == gegl_babl_rgb_linear() ||
babl == gegl_babl_y_linear() ||
babl == gegl_babl_ya_linear() ||
babl == gegl_babl_yA_linear())
return TRUE;
return FALSE;
}
GEGL_CACHED_BABL(format, rgba_float, "R'G'B'A float")
GEGL_CACHED_BABL(format, rgba_u8, "R'G'B'A u8")
GEGL_CACHED_BABL(format, rgb_u8, "R'G'B' u8")
GEGL_CACHED_BABL(format, rgbA_float, "R'aG'aB'aA float")
GEGL_CACHED_BABL(format, rgba_linear_float, "RGBA float")
GEGL_CACHED_BABL(format, rgba_linear_u16, "RGBA u16")
GEGL_CACHED_BABL(format, rgbA_linear_float, "RaGaBaA float")
GEGL_CACHED_BABL(format, ya_float, "Y'A float")
GEGL_CACHED_BABL(format, yA_float, "Y'aA float")
GEGL_CACHED_BABL(format, ya_linear_float, "Y float")
GEGL_CACHED_BABL(format, yA_linear_float, "YaA float")
#ifdef G_OS_WIN32
/* one use 16kb of stack before an exception triggered warning on win32 */
#define GEGL_ALLOCA_THRESHOLD 8192
#else
/* on linux/OSX 0.5mb is reasonable, the stack size of new threads is 2MB */
#define GEGL_ALLOCA_THRESHOLD (1024*1024/2)
#endif
G_END_DECLS
#endif /* __GEGL_BUFFER_FORMATS_H__ */
......@@ -6,7 +6,7 @@
#include <glib/gprintf.h>
#include "gegl.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
#include "gegl-buffer-types.h"
#include "gegl-buffer-private.h"
#include "gegl-tile-storage.h"
......
/* This file is part of GEGL
*
* GEGL is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* GEGL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with GEGL; if not, see <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <math.h>
#include "gegl-buffer-matrix2.h"
gboolean
gegl_buffer_matrix2_is_scale (GeglBufferMatrix2 *matrix)
{
return matrix->coeff[0][1] == 0.0 && matrix->coeff[1][0] == 0.0;
}
gdouble
gegl_buffer_matrix2_determinant (GeglBufferMatrix2 *matrix)
{
return matrix->coeff[0][0] * matrix->coeff[1][1] -
matrix->coeff[1][0] * matrix->coeff[0][1];
}
/* This file is part of GEGL
*
* GEGL is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* GEGL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with GEGL; if not, see <https://www.gnu.org/licenses/>.
*
* Copyright 2006-2018 GEGL developers
*/
#ifndef __GEGL_BUFFER_MATRIX2_H__
#define __GEGL_BUFFER_MATRIX2_H__
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS
/* Currenly only used internally.
* Note: If making use of this in public API, add a boxed type for introspection
*/
typedef struct {
gdouble coeff[2][2];
} GeglBufferMatrix2;
/*
* gegl_buffer_matrix2_is_scale:
* @matrix: a #GeglBufferMatrix2
*
* Check if a matrix only does scaling.
*
* Returns TRUE if the matrix only does scaling.
*/
gboolean gegl_buffer_matrix2_is_scale (GeglBufferMatrix2 *matrix);
/*
* gegl_buffer_matrix2_determinant:
* @matrix: a #GeglBufferMatrix2
*
* Returns the determinant of @matrix.
*/
gdouble gegl_buffer_matrix2_determinant (GeglBufferMatrix2 *matrix);
G_END_DECLS
#endif
......@@ -40,15 +40,11 @@
#include "gegl-buffer-types.h"
#include "gegl-buffer-config.h"
#include "gegl-buffer-private.h"
#include "gegl-debug.h"
#include "gegl-tile-storage.h"
#include "gegl-tile-backend-file.h"
#include "gegl-tile-backend-swap.h"
#include "gegl-tile-backend-ram.h"
//#include "opencl/gegl-cl.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
#ifdef GEGL_ENABLE_DEBUG
#define DEBUG_ALLOCATIONS (gegl_debug_flags & GEGL_DEBUG_BUFFER_ALLOC)
......
......@@ -21,7 +21,7 @@
#include <glib-object.h>
#include <babl/babl.h>
#include <gegl-matrix.h>
#include "gegl-buffer-matrix2.h"
#include <gegl-types.h>
#define GEGL_AUTO_ROWSTRIDE 0
......@@ -321,17 +321,6 @@ void gegl_buffer_set (GeglBuffer *buffer
gint rowstride);
/**
* gegl_buffer_set_color:
* @buffer: a #GeglBuffer
* @rect: a rectangular region to fill with a color.
* @color: the GeglColor to fill with.
*
* Sets the region covered by rect to the specified color.
*/
void gegl_buffer_set_color (GeglBuffer *buffer,
const GeglBufferRectangle *rect,
GeglColor *color);
/**
......@@ -476,15 +465,15 @@ GeglBuffer * gegl_buffer_dup (GeglBuffer *buffer);
* is more efficient.
*/
void gegl_buffer_sample_at_level (GeglBuffer *buffer,
gdouble x,
gdouble y,
GeglMatrix2 *scale,
gpointer dest,
const Babl *format,
gint level,
GeglSamplerType sampler_type,
GeglAbyssPolicy repeat_mode);
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);
/**
* gegl_buffer_sample: (skip)
......@@ -512,14 +501,14 @@ void gegl_buffer_sample_at_level (GeglBuffer *buffer,
* gegl_buffer_sampler_new() to create a sampler object instead, which is more
* efficient.
*/
void gegl_buffer_sample (GeglBuffer *buffer,
gdouble x,
gdouble y,
GeglMatrix2 *scale,
gpointer dest,
const Babl *format,
GeglSamplerType sampler_type,
GeglAbyssPolicy repeat_mode);
void gegl_buffer_sample (GeglBuffer *buffer,
gdouble x,
gdouble y,
GeglBufferMatrix2 *scale,
gpointer dest,
const Babl *format,
GeglSamplerType sampler_type,
GeglAbyssPolicy repeat_mode);
......@@ -535,12 +524,12 @@ void gegl_buffer_sample (GeglBuffer *buffer,
G_DEPRECATED
void gegl_buffer_sample_cleanup (GeglBuffer *buffer);
typedef void (*GeglSamplerGetFun) (GeglSampler *self,
gdouble x,
gdouble y,
GeglMatrix2 *scale,
void *output,
GeglAbyssPolicy repeat_mode);
typedef void (*GeglSamplerGetFun) (GeglSampler *self,
gdouble x,
gdouble y,
GeglBufferMatrix2 *scale,
void *output,
GeglAbyssPolicy repeat_mode);
/**
* gegl_sampler_get_fun: (skip)
......@@ -607,12 +596,12 @@ GeglSampler * gegl_buffer_sampler_new_at_level (GeglBuffer *buffer,
*
* Perform a sampling with the provided @sampler.
*/
void gegl_sampler_get (GeglSampler *sampler,
gdouble x,
gdouble y,
GeglMatrix2 *scale,
void *output,
GeglAbyssPolicy repeat_mode);
void gegl_sampler_get (GeglSampler *sampler,
gdouble x,
gdouble y,
GeglBufferMatrix2 *scale,
void *output,
GeglAbyssPolicy repeat_mode);
/* code template utility, updates the jacobian matrix using
* a user defined mapping function for displacement, example
......
......@@ -22,7 +22,7 @@
#include <math.h>
#include "gegl.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
#include "gegl-sampler-cubic.h"
enum
......@@ -38,7 +38,7 @@ static void gegl_sampler_cubic_finalize ( GObject *gobject);
static void gegl_sampler_cubic_get ( GeglSampler *sampler,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
GeglBufferMatrix2*scale,
void *output,
GeglAbyssPolicy repeat_mode);
static void get_property ( GObject *gobject,
......@@ -152,12 +152,12 @@ gegl_sampler_cubic_init (GeglSamplerCubic *self)
}
void
gegl_sampler_cubic_get ( GeglSampler *self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
void *output,
GeglAbyssPolicy repeat_mode)
gegl_sampler_cubic_get ( GeglSampler *self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglBufferMatrix2 *scale,
void *output,
GeglAbyssPolicy repeat_mode)
{
if (! _gegl_sampler_box_get (self, absolute_x, absolute_y, scale,
output, repeat_mode,
......
......@@ -22,7 +22,7 @@
#include <math.h>
#include "gegl.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
#include "gegl-sampler-linear.h"
enum
......@@ -34,7 +34,7 @@ enum
static void gegl_sampler_linear_get ( GeglSampler* restrict self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
GeglBufferMatrix2 *scale,
void* restrict output,
GeglAbyssPolicy repeat_mode);
......@@ -73,10 +73,10 @@ gegl_sampler_linear_init (GeglSamplerLinear *self)
}
void
gegl_sampler_linear_get ( GeglSampler *self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
gegl_sampler_linear_get ( GeglSampler *self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglBufferMatrix2 *scale,
void *output,
GeglAbyssPolicy repeat_mode)
{
......
......@@ -115,7 +115,7 @@
#include <math.h>
#include "gegl.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
#include "gegl-sampler-lohalo.h"
/*
......@@ -134,7 +134,7 @@ enum
static void gegl_sampler_lohalo_get ( GeglSampler* restrict self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
GeglBufferMatrix2 *scale,
void* restrict output,
GeglAbyssPolicy repeat_mode);
......@@ -383,7 +383,7 @@ static void
gegl_sampler_lohalo_get ( GeglSampler* restrict self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
GeglBufferMatrix2 *scale,
void* restrict output,
GeglAbyssPolicy repeat_mode)
{
......
......@@ -20,7 +20,7 @@
#include <string.h>
#include "gegl.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
#include "gegl-buffer-types.h"
#include "gegl-buffer.h"
#include "gegl-buffer-private.h"
......@@ -41,7 +41,7 @@ static void
gegl_sampler_nearest_get (GeglSampler* restrict self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
GeglBufferMatrix2 *scale,
void* restrict output,
GeglAbyssPolicy repeat_mode);
......@@ -206,7 +206,7 @@ static void
gegl_sampler_nearest_get ( GeglSampler* restrict sampler,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
GeglBufferMatrix2 *scale,
void* restrict output,
GeglAbyssPolicy repeat_mode)
{
......
......@@ -152,7 +152,7 @@
#include <math.h>
#include "gegl.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
#include "gegl-sampler-nohalo.h"
/*
......@@ -240,7 +240,7 @@ enum
static void gegl_sampler_nohalo_get ( GeglSampler* restrict self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
GeglBufferMatrix2 *scale,
void* restrict output,
GeglAbyssPolicy repeat_mode);
......@@ -1217,7 +1217,7 @@ static void
gegl_sampler_nohalo_get ( GeglSampler* restrict self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
GeglBufferMatrix2 *scale,
void* restrict output,
GeglAbyssPolicy repeat_mode)
{
......
......@@ -34,7 +34,7 @@
#include "gegl-sampler-cubic.h"
#include "gegl-sampler-nohalo.h"
#include "gegl-sampler-lohalo.h"
#include "gegl-types-internal.h"
#include "gegl-buffer-formats.h"
enum
......@@ -148,12 +148,12 @@ constructed (GObject *self)
}
void
gegl_sampler_get (GeglSampler *self,
gdouble x,
gdouble y,
GeglMatrix2 *scale,
void *output,
GeglAbyssPolicy repeat_mode)
gegl_sampler_get (GeglSampler *self,
gdouble x,
gdouble y,
GeglBufferMatrix2 *scale,
void *output,
GeglAbyssPolicy repeat_mode)
{
if (G_UNLIKELY(!isfinite (x)))
x = 0.0;
......@@ -416,15 +416,15 @@ gegl_sampler_gtype_from_enum (GeglSamplerType sampler_type)
}
static inline void
_gegl_buffer_sample_at_level (GeglBuffer *buffer,
gdouble x,
gdouble y,
GeglMatrix2 *scale,
gpointer dest,
const Babl *format,
gint level,
GeglSamplerType sampler_type,
GeglAbyssPolicy repeat_mode)
_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)
{
GeglSampler *sampler;
......@@ -450,15 +450,15 @@ _gegl_buffer_sample_at_level (GeglBuffer *buffer,
}
void
gegl_buffer_sample_at_level (GeglBuffer *buffer,
gdouble x,
gdouble y,
GeglMatrix2 *scale,
gpointer dest,
const Babl *format,
gint level,
GeglSamplerType sampler_type,
GeglAbyssPolicy repeat_mode)
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)
{
_gegl_buffer_sample_at_level (buffer, x, y, scale, dest,
format, level, sampler_type, repeat_mode);
......@@ -466,14 +466,14 @@ gegl_buffer_sample_at_level (GeglBuffer *buffer,
void
gegl_buffer_sample (GeglBuffer *buffer,
gdouble x,
gdouble y,
GeglMatrix2 *scale,
gpointer dest,
const Babl *format,
GeglSamplerType sampler_type,
GeglAbyssPolicy repeat_mode)
gegl_buffer_sample (GeglBuffer *buffer,
gdouble x,
gdouble y,
GeglBufferMatrix2 *scale,
gpointer dest,
const Babl *format,
GeglSamplerType sampler_type,
GeglAbyssPolicy repeat_mode)
{
_gegl_buffer_sample_at_level (buffer, x, y, scale, dest, format, 0, sampler_type, repeat_mode);
}
......
......@@ -223,13 +223,13 @@ static inline gboolean
_gegl_sampler_box_get (GeglSampler* restrict self,
const gdouble absolute_x,
const gdouble absolute_y,
GeglMatrix2 *scale,
GeglBufferMatrix2 *scale,
void* restrict output,
GeglAbyssPolicy repeat_mode,
GeglSamplerType point_sampler_type,
gint n_samples)
{
if (scale && fabs (gegl_matrix2_determinant (scale)) >= 4.0)
if (scale && fabs (gegl_buffer_matrix2_determinant (scale)) >= 4.0)
{
gfloat result[4] = {0,0,0,0};
gdouble uv_samples_inv;
......@@ -243,7 +243,7 @@ _gegl_sampler_box_get (GeglSampler* restrict self,
gegl_sampler_get_fun (self->point_sampler);
}
if (gegl_matrix2_is_scale (scale))
if (gegl_buffer_matrix2_is_scale (scale))
{
const gdouble u_norm = fabs (scale->coeff[0][0]);
const gdouble v_norm = fabs (scale->coeff[1][1]);
......
......@@ -23,20 +23,6 @@
#include "gegl-matrix.h"
gboolean
gegl_matrix2_is_scale (GeglMatrix2 *matrix)
{
return matrix->coeff[0][1] == 0.0 && matrix->coeff[1][0] == 0.0;
}
gdouble
gegl_matrix2_determinant (GeglMatrix2 *matrix)
{
return matrix->coeff[0][0] * matrix->coeff[1][1] -
matrix->coeff[1][0] * matrix->coeff[0][1];
}
#if 0
static void gegl_matrix3_debug (GeglMatrix3 *matrix)
{
......
......@@ -22,34 +22,10 @@
#include <glib.h>
#include <glib-object.h>
#include <gegl-buffer-matrix2.h>
G_BEGIN_DECLS
/* Currenly only used internally.
* Note: If making use of this in public API, add a boxed type for introspection
*/
typedef struct {
gdouble coeff[2][2];
} GeglMatrix2;
/*
* gegl_matrix2_is_scale:
* @matrix: a #GeglMatrix2
*
* Check if a matrix only does scaling.
*
* Returns TRUE if the matrix only does scaling.
*/
gboolean gegl_matrix2_is_scale (GeglMatrix2 *matrix);
/*
* gegl_matrix2_determinant:
* @matrix: a #GeglMatrix2
*
* Returns the determinant of @matrix.
*/
gdouble gegl_matrix2_determinant (GeglMatrix2 *matrix);
/***
* GeglMatrix3:
*
......
......@@ -348,6 +348,19 @@ GeglNode *gegl_node_new_from_serialized (const gchar *chaindata,
const gchar *path_root);
/**
* gegl_buffer_set_color:
* @buffer: a #GeglBuffer
* @rect: a rectangular region to fill with a color.
* @color: the GeglColor to fill with.
*
* Sets the region covered by rect to the specified color.
*/
void gegl_buffer_set_color (GeglBuffer *buffer,
const GeglBufferRectangle *rect,
GeglColor *color);
G_END_DECLS
#endif /* __GEGL_UTILS_H__ */
......@@ -121,7 +121,7 @@ fractaltrace (GeglBuffer *input,
const Babl *format,
gint level)
{
GeglMatrix2 scale; /* a matrix indicating scaling factors around the
GeglBufferMatrix2 scale; /* a matrix indicating scaling factors around the
current center pixel.
*/
gint x, i, offset;
......
......@@ -330,7 +330,7 @@ process (GeglOperation *operation,
gdouble px, py;
gdouble cen_x, cen_y;
GeglMatrix2 scale; /* a matrix indicating scaling factors around the
GeglBufferMatrix2 scale; /* a matrix indicating scaling factors around the
current center pixel.
*/
......
......@@ -167,7 +167,7 @@ apply_whirl_pinch (gdouble whirl,
for (row = 0; row < roi->height; row++) {
for (col = 0; col < roi->width; col++) {
GeglMatrix2 scale;