[gegl/abyss: 1/3] abyss policy: add a repeat_mode parameter in gegl_buffer_sample and gegl_sampler_get. Treatment not



commit 675b54492ba91ff4e8cb8a86a482ccea84a5924f
Author: Michael Murà <batolettre gmail com>
Date:   Sun Sep 11 09:56:29 2011 +0200

    abyss policy: add a repeat_mode parameter in gegl_buffer_sample and gegl_sampler_get. Treatment not implemented yet.

 gegl/buffer/gegl-buffer-access.c         |    5 ++-
 gegl/buffer/gegl-buffer.h                |   22 ++++++++++----
 gegl/buffer/gegl-sampler-cubic.c         |   44 +++++++++++++++-------------
 gegl/buffer/gegl-sampler-lanczos.c       |   38 +++++++++++++-----------
 gegl/buffer/gegl-sampler-linear.c        |    6 ++-
 gegl/buffer/gegl-sampler-lohalo.c        |   38 +++++++++++++-----------
 gegl/buffer/gegl-sampler-nearest.c       |   38 +++++++++++++-----------
 gegl/buffer/gegl-sampler.c               |   19 ++++++------
 gegl/buffer/gegl-sampler.h               |   46 +++++++++++++++--------------
 gegl/gegl-enums.h                        |   11 +++++++
 gegl/gegl-plugin.h                       |   15 +++++----
 operations/affine/affine.c               |    2 +-
 operations/common/map-absolute.c         |    2 +-
 operations/common/map-relative.c         |    3 +-
 operations/common/mirrors.c              |    2 +-
 operations/workshop/convolution-matrix.c |    3 +-
 operations/workshop/cubism.c             |    2 +-
 operations/workshop/ditto.c              |    3 +-
 operations/workshop/external/gluas.c     |    6 ++-
 operations/workshop/fractal-trace.c      |    4 +-
 operations/workshop/lens-distortion.c    |    3 +-
 operations/workshop/noise-spread.c       |    6 ++-
 operations/workshop/plasma.c             |    8 ++--
 operations/workshop/polar-coordinates.c  |    2 +-
 operations/workshop/ripple.c             |    3 +-
 operations/workshop/whirl-pinch.c        |    6 ++--
 26 files changed, 191 insertions(+), 146 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 92e7648..8778130 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -1076,7 +1076,8 @@ gegl_buffer_sample (GeglBuffer       *buffer,
                     GeglMatrix2      *scale,
                     gpointer          dest,
                     const Babl       *format,
-                    GeglSamplerType   sampler_type)
+                    GeglSamplerType   sampler_type,
+                    GeglRepeatMode    repeat_mode)
 {
   GType desired_type;
   g_return_if_fail (GEGL_IS_BUFFER (buffer));
@@ -1110,7 +1111,7 @@ gegl_buffer_sample (GeglBuffer       *buffer,
       gegl_sampler_prepare (buffer->sampler);
     }
 
-  gegl_sampler_get (buffer->sampler, x, y, scale, dest);
+  gegl_sampler_get (buffer->sampler, x, y, scale, dest, repeat_mode);
 }
 
 void
diff --git a/gegl/buffer/gegl-buffer.h b/gegl/buffer/gegl-buffer.h
index 0df7e3c..c6f2382 100644
--- a/gegl/buffer/gegl-buffer.h
+++ b/gegl/buffer/gegl-buffer.h
@@ -323,6 +323,10 @@ GeglBuffer *    gegl_buffer_dup               (GeglBuffer       *buffer);
  * to be ported from working code. Valid values: GEGL_SAMPLER_NEAREST,
  * GEGL_SAMPLER_LINEAR, GEGL_SAMPLER_CUBIC,
  * GEGL_SAMPLER_LANCZOS and GEGL_SAMPLER_LOHALO
+ * @repeat_mode: how request outside the buffer extent are handled.
+ * Valid values: GEGL_REPEAT_MODE_CLAMP, GEGL_REPEAT_MODE_LOOP,
+ * GEGL_REPEAT_MODE_BLACK, GEGL_REPEAT_MODE_WHITE, GEGL_REPEAT_MODE_ZERO,
+ * GEGL_REPEAT_MODE_ONE
  *
  * Query interpolate pixel values at a given coordinate using a specified form
  * of interpolation. The samplers used cache for a small neighbourhood of the
@@ -334,7 +338,8 @@ void gegl_buffer_sample (GeglBuffer       *buffer,
                          GeglMatrix2      *scale,
                          gpointer          dest,
                          const Babl       *format,
-                         GeglSamplerType   sampler_type);
+                         GeglSamplerType   sampler_type,
+                         GeglRepeatMode    repeat_mode);
 
 
 
@@ -384,14 +389,19 @@ GeglSampler * gegl_buffer_sampler_new (GeglBuffer       *buffer,
  * @y: y coordinate to sample
  * @scale: matrix representing extent of sampling area in source buffer.
  * @output: memory location for output data.
+ * @repeat_mode: how request outside the buffer extent are handled.
+ * Valid values: GEGL_REPEAT_MODE_CLAMP, GEGL_REPEAT_MODE_LOOP,
+ * GEGL_REPEAT_MODE_BLACK, GEGL_REPEAT_MODE_WHITE, GEGL_REPEAT_MODE_ZERO,
+ * GEGL_REPEAT_MODE_ONE
  *
  * Perform a sampling with the provided @sampler.
  */
-void  gegl_sampler_get         (GeglSampler *sampler,
-                                gdouble      x,
-                                gdouble      y,
-                                GeglMatrix2 *scale,
-                                void        *output);
+void  gegl_sampler_get   (GeglSampler     *sampler,
+                          gdouble          x,
+                          gdouble          y,
+                          GeglMatrix2     *scale,
+                          void            *output,
+                          GeglRepeatMode   repeat_mode);
 
 /**
  * gegl_sampler_get_context_rect:
diff --git a/gegl/buffer/gegl-sampler-cubic.c b/gegl/buffer/gegl-sampler-cubic.c
index 684d1f1..6a3f62c 100644
--- a/gegl/buffer/gegl-sampler-cubic.c
+++ b/gegl/buffer/gegl-sampler-cubic.c
@@ -37,22 +37,23 @@ enum
 };
 
 static void      gegl_sampler_cubic_finalize (GObject      *gobject);
-static void      gegl_sampler_cubic_get (GeglSampler  *sampler,
-                                         gdouble       x,
-                                         gdouble       y,
-                                         GeglMatrix2  *scale,
-                                         void         *output);
-static void      get_property           (GObject      *gobject,
-                                         guint         prop_id,
-                                         GValue       *value,
-                                         GParamSpec   *pspec);
-static void      set_property           (GObject      *gobject,
-                                         guint         prop_id,
-                                         const GValue *value,
-                                         GParamSpec   *pspec);
-static inline gfloat cubicKernel       (gfloat        x,
-                                        gfloat        b,
-                                        gfloat        c);
+static void      gegl_sampler_cubic_get (GeglSampler     *sampler,
+                                         gdouble          x,
+                                         gdouble          y,
+                                         GeglMatrix2     *scale,
+                                         void            *output,
+                                         GeglRepeatMode   repeat_mode);
+static void      get_property           (GObject         *gobject,
+                                         guint            prop_id,
+                                         GValue          *value,
+                                         GParamSpec      *pspec);
+static void      set_property           (GObject         *gobject,
+                                         guint            prop_id,
+                                         const GValue    *value,
+                                         GParamSpec      *pspec);
+static inline gfloat cubicKernel        (gfloat           x,
+                                         gfloat           b,
+                                         gfloat           c);
 
 
 G_DEFINE_TYPE (GeglSamplerCubic, gegl_sampler_cubic, GEGL_TYPE_SAMPLER)
@@ -133,11 +134,12 @@ gegl_sampler_cubic_init (GeglSamplerCubic *self)
 }
 
 void
-gegl_sampler_cubic_get (GeglSampler *self,
-                        gdouble      x,
-                        gdouble      y,
-                        GeglMatrix2 *scale,
-                        void        *output)
+gegl_sampler_cubic_get (GeglSampler     *self,
+                        gdouble          x,
+                        gdouble          y,
+                        GeglMatrix2     *scale,
+                        void            *output,
+                        GeglRepeatMode   repeat_mode)
 {
   GeglSamplerCubic *cubic = (GeglSamplerCubic*)(self);
   GeglRectangle     context_rect;
diff --git a/gegl/buffer/gegl-sampler-lanczos.c b/gegl/buffer/gegl-sampler-lanczos.c
index 1f67267..9f890b2 100644
--- a/gegl/buffer/gegl-sampler-lanczos.c
+++ b/gegl/buffer/gegl-sampler-lanczos.c
@@ -43,19 +43,20 @@ enum
 
 static inline gdouble sinc (gdouble x);
 static void           lanczos_lookup (GeglSamplerLanczos *sampler);
-static void           gegl_sampler_lanczos_get (GeglSampler  *sampler,
-                                                gdouble       x,
-                                                gdouble       y,
-                                                GeglMatrix2  *scale,
-                                                void         *output);
-static void           get_property             (GObject      *gobject,
-                                                guint         prop_id,
-                                                GValue       *value,
-                                                GParamSpec   *pspec);
-static void           set_property             (GObject      *gobject,
-                                                guint         prop_id,
-                                                const GValue *value,
-                                                GParamSpec   *pspec);
+static void           gegl_sampler_lanczos_get (GeglSampler    *sampler,
+                                                gdouble         x,
+                                                gdouble         y,
+                                                GeglMatrix2    *scale,
+                                                void           *output,
+                                                GeglRepeatMode  repeat_mode);
+static void           get_property             (GObject        *gobject,
+                                                guint           prop_id,
+                                                GValue         *value,
+                                                GParamSpec     *pspec);
+static void           set_property             (GObject        *gobject,
+                                                guint           prop_id,
+                                                const GValue   *value,
+                                                GParamSpec     *pspec);
 static GObject *
 gegl_sampler_lanczos_constructor (GType                  type,
                                   guint                  n_params,
@@ -143,11 +144,12 @@ finalize (GObject *object)
 }
 
 void
-gegl_sampler_lanczos_get (GeglSampler *self,
-                          gdouble      x,
-                          gdouble      y,
-                          GeglMatrix2 *scale,
-                          void        *output)
+gegl_sampler_lanczos_get (GeglSampler    *self,
+                          gdouble         x,
+                          gdouble         y,
+                          GeglMatrix2    *scale,
+                          void           *output,
+                          GeglRepeatMode  repeat_mode)
 {
   GeglSamplerLanczos      *lanczos      = GEGL_SAMPLER_LANCZOS (self);
   GeglRectangle            context_rect = self->context_rect[0];
diff --git a/gegl/buffer/gegl-sampler-linear.c b/gegl/buffer/gegl-sampler-linear.c
index 57370bf..ef8c00f 100644
--- a/gegl/buffer/gegl-sampler-linear.c
+++ b/gegl/buffer/gegl-sampler-linear.c
@@ -66,7 +66,8 @@ static void gegl_sampler_linear_get (GeglSampler* restrict self,
                                      const gdouble         x,
                                      const gdouble         y,
                                      GeglMatrix2          *scale,
-                                     void*        restrict output);
+                                     void*        restrict output,
+                                     GeglRepeatMode        repeat_mode);
 
 static void set_property (GObject*      gobject,
                           guint         property_id,
@@ -107,7 +108,8 @@ gegl_sampler_linear_get (GeglSampler* restrict self,
                          const gdouble         absolute_x,
                          const gdouble         absolute_y,
                          GeglMatrix2          *scale,
-                         void*        restrict output)
+                         void*        restrict output,
+                         GeglRepeatMode        repeat_mode)
 {
   const gint pixels_per_buffer_row = 64;
   const gint channels = 4;
diff --git a/gegl/buffer/gegl-sampler-lohalo.c b/gegl/buffer/gegl-sampler-lohalo.c
index 731d344..79ce6e5 100644
--- a/gegl/buffer/gegl-sampler-lohalo.c
+++ b/gegl/buffer/gegl-sampler-lohalo.c
@@ -254,17 +254,18 @@ enum
 };
 
 
-static void gegl_sampler_lohalo_get (      GeglSampler* restrict self,
-                                     const gdouble               absolute_x,
-                                     const gdouble               absolute_y,
-                                           GeglMatrix2          *scale,
-                                           void*        restrict output);
+static void gegl_sampler_lohalo_get (GeglSampler* restrict  self,
+                                     const gdouble          absolute_x,
+                                     const gdouble          absolute_y,
+                                     GeglMatrix2           *scale,
+                                     void*        restrict  output,
+                                     GeglRepeatMode         repeat_mode);
 
 
-static void set_property (      GObject*    gobject,
-                                guint       property_id,
-                          const GValue*     value,
-                                GParamSpec* pspec);
+static void set_property (GObject*      gobject,
+                          guint         property_id,
+                          const GValue* value,
+                          GParamSpec*   pspec);
 
 
 static void get_property (GObject*    gobject,
@@ -1304,11 +1305,12 @@ level_1_ewa_update (const gint              j,
 
 
 static void
-gegl_sampler_lohalo_get (      GeglSampler* restrict self,
-                         const gdouble               absolute_x,
-                         const gdouble               absolute_y,
-                         GeglMatrix2                *scale,
-                               void*        restrict output)
+gegl_sampler_lohalo_get (GeglSampler* restrict  self,
+                         const gdouble          absolute_x,
+                         const gdouble          absolute_y,
+                         GeglMatrix2           *scale,
+                         void*        restrict  output,
+                         GeglRepeatMode         repeat_mode)
 {
   /*
    * Needed constants related to the input pixel value pointer
@@ -2432,10 +2434,10 @@ gegl_sampler_lohalo_get (      GeglSampler* restrict self,
 
 
 static void
-set_property (      GObject*    gobject,
-                    guint       property_id,
-              const GValue*     value,
-                    GParamSpec* pspec)
+set_property (GObject*      gobject,
+              guint         property_id,
+              const GValue* value,
+              GParamSpec*   pspec)
 {
   /* G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); */
 }
diff --git a/gegl/buffer/gegl-sampler-nearest.c b/gegl/buffer/gegl-sampler-nearest.c
index 46fd9a1..54c2773 100644
--- a/gegl/buffer/gegl-sampler-nearest.c
+++ b/gegl/buffer/gegl-sampler-nearest.c
@@ -32,19 +32,20 @@ enum
   PROP_LAST
 };
 
-static void    gegl_sampler_nearest_get (GeglSampler  *self,
-                                         gdouble       x,
-                                         gdouble       y,
-                                         GeglMatrix2  *scale,
-                                         void         *output);
-static void    set_property             (GObject      *gobject,
-                                         guint         prop_id,
-                                         const GValue *value,
-                                         GParamSpec   *pspec);
-static void    get_property             (GObject      *gobject,
-                                         guint         prop_id,
-                                         GValue       *value,
-                                         GParamSpec   *pspec);
+static void    gegl_sampler_nearest_get (GeglSampler    *self,
+                                         gdouble         x,
+                                         gdouble         y,
+                                         GeglMatrix2    *scale,
+                                         void           *output,
+                                         GeglRepeatMode  repeat_mode);
+static void    set_property             (GObject        *gobject,
+                                         guint           prop_id,
+                                         const GValue   *value,
+                                         GParamSpec     *pspec);
+static void    get_property             (GObject        *gobject,
+                                         guint           prop_id,
+                                         GValue         *value,
+                                         GParamSpec     *pspec);
 
 G_DEFINE_TYPE (GeglSamplerNearest, gegl_sampler_nearest, GEGL_TYPE_SAMPLER)
 
@@ -72,11 +73,12 @@ gegl_sampler_nearest_init (GeglSamplerNearest *self)
 }
 
 void
-gegl_sampler_nearest_get (GeglSampler *self,
-                          gdouble      x,
-                          gdouble      y,
-                          GeglMatrix2 *scale,
-                          void        *output)
+gegl_sampler_nearest_get (GeglSampler    *self,
+                          gdouble         x,
+                          gdouble         y,
+                          GeglMatrix2    *scale,
+                          void           *output,
+                          GeglRepeatMode  repeat_mode)
 {
   gfloat             *sampler_bptr;
   sampler_bptr = gegl_sampler_get_from_buffer (self, (gint)x, (gint)y);
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index 8037ca9..f54d005 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -58,10 +58,10 @@ static void get_property (GObject    *gobject,
                           GValue     *value,
                           GParamSpec *pspec);
 
-static void set_property (      GObject      *gobject,
-                                guint         property_id,
+static void set_property (GObject      *gobject,
+                          guint         property_id,
                           const GValue *value,
-                                GParamSpec   *pspec);
+                          GParamSpec   *pspec);
 
 static void set_buffer (GeglSampler  *self,
                         GeglBuffer   *buffer);
@@ -116,13 +116,14 @@ gegl_sampler_init (GeglSampler *self)
 }
 
 void
-gegl_sampler_get (GeglSampler *self,
-                  gdouble      x,
-                  gdouble      y,
-                  GeglMatrix2 *scale,
-                  void        *output)
+gegl_sampler_get (GeglSampler     *self,
+                  gdouble          x,
+                  gdouble          y,
+                  GeglMatrix2     *scale,
+                  void            *output,
+                  GeglRepeatMode   repeat_mode)
 {
-  self->get (self, x, y, scale, output);
+  self->get (self, x, y, scale, output, repeat_mode);
 }
 
 void
diff --git a/gegl/buffer/gegl-sampler.h b/gegl/buffer/gegl-sampler.h
index 1e5b5f7..4eae3dd 100644
--- a/gegl/buffer/gegl-sampler.h
+++ b/gegl/buffer/gegl-sampler.h
@@ -38,11 +38,12 @@ typedef struct _GeglSamplerClass GeglSamplerClass;
 struct _GeglSampler
 {
   GObject       parent_instance;
-  void (* get) (GeglSampler *self,
-                gdouble      x,
-                gdouble      y,
-                GeglMatrix2 *scale,
-                void        *output);
+  void (* get) (GeglSampler     *self,
+                gdouble          x,
+                gdouble          y,
+                GeglMatrix2     *scale,
+                void            *output,
+                GeglRepeatMode  repeat_mode);
   /* we cache the getter in the instance, (being able to return the
      function pointer itself and cache it outside the calling loop
      would be even quicker.
@@ -65,14 +66,15 @@ struct _GeglSamplerClass
 {
   GObjectClass  parent_class;
 
-  void (* prepare)   (GeglSampler *self);
-  void (* get)       (GeglSampler *self,
-                      gdouble      x,
-                      gdouble      y,
-                      GeglMatrix2 *scale,
-                      void        *output);
- void  (*set_buffer) (GeglSampler  *self,
-                      GeglBuffer   *buffer);
+  void (* prepare)   (GeglSampler     *self);
+  void (* get)       (GeglSampler     *self,
+                      gdouble          x,
+                      gdouble          y,
+                      GeglMatrix2     *scale,
+                      void            *output,
+                      GeglRepeatMode   repeat_mode);
+ void  (*set_buffer) (GeglSampler     *self,
+                      GeglBuffer      *buffer);
 };
 
 GType gegl_sampler_get_type    (void) G_GNUC_CONST;
@@ -82,11 +84,12 @@ void  gegl_sampler_prepare     (GeglSampler *self);
 void  gegl_sampler_set_buffer  (GeglSampler *self,
                                 GeglBuffer  *buffer);
 
-void  gegl_sampler_get         (GeglSampler *self,
-                                gdouble      x,
-                                gdouble      y,
-                                GeglMatrix2 *scale,
-                                void        *output);
+void  gegl_sampler_get         (GeglSampler     *sampler,
+                                gdouble          x,
+                                gdouble          y,
+                                GeglMatrix2     *scale,
+                                void            *output,
+                                GeglRepeatMode   repeat_mode);
 
 gfloat * gegl_sampler_get_from_buffer (GeglSampler *sampler,
                                        gint         x,
@@ -95,10 +98,9 @@ gfloat * gegl_sampler_get_from_mipmap (GeglSampler *sampler,
                                        gint         x,
                                        gint         y,
                                        gint         level);
-gfloat *
-gegl_sampler_get_ptr (GeglSampler         *sampler,
-                      gint                 x,
-                      gint                 y);
+gfloat * gegl_sampler_get_ptr         (GeglSampler *sampler,
+                                       gint         x,
+                                       gint         y);
 
 G_END_DECLS
 
diff --git a/gegl/gegl-enums.h b/gegl/gegl-enums.h
index b896575..0577ec2 100644
--- a/gegl/gegl-enums.h
+++ b/gegl/gegl-enums.h
@@ -41,6 +41,17 @@ typedef enum {
 GType gegl_sampler_type_get_type   (void) G_GNUC_CONST;
 #define GEGL_TYPE_SAMPLER_TYPE (gegl_sampler_type_get_type())
 
+typedef enum {
+  GEGL_REPEAT_MODE_CLAMP,
+  GEGL_REPEAT_MODE_LOOP,
+  GEGL_REPEAT_MODE_BLACK,
+  GEGL_REPEAT_MODE_WHITE,
+  GEGL_REPEAT_MODE_ZERO,
+  GEGL_REPEAT_MODE_ONE
+} GeglRepeatMode;
+GType gegl_repeat_mode_get_type   (void) G_GNUC_CONST;
+#define GEGL_REPEAT_MODE_TYPE (gegl_repeat_mode_get_type())
+
 /*
  * Operation specific enum
  */
diff --git a/gegl/gegl-plugin.h b/gegl/gegl-plugin.h
index 0ba48c9..98774f2 100644
--- a/gegl/gegl-plugin.h
+++ b/gegl/gegl-plugin.h
@@ -123,16 +123,17 @@ const gchar   * gegl_extension_handler_get_saver   (const gchar         *extensi
 typedef struct
 {
   GObject       parent_instance;
-  void (* get) (GeglSampler *self,
-                gdouble      x,
-                gdouble      y,
-                GeglMatrix2 *scale,
-                void        *output);
+  void (* get) (GeglSampler    *self,
+                gdouble         x,
+                gdouble         y,
+                GeglMatrix2    *scale,
+                void           *output,
+                GeglRepeatMode  repeat_mode);
 } SamplerMock;
 
 
-#define gegl_sampler_get(sampler,x,y,scale,dest) \
-  ((SamplerMock*)(sampler))->get((sampler),(x),(y),(scale),(dest))
+#define gegl_sampler_get(sampler,x,y,scale,dest,repeat) \
+  ((SamplerMock*)(sampler))->get((sampler),(x),(y),(scale),(dest),(repeat))
 
 #include <glib-object.h>
 #include <babl/babl.h>
diff --git a/operations/affine/affine.c b/operations/affine/affine.c
index aa74c75..3b49f65 100644
--- a/operations/affine/affine.c
+++ b/operations/affine/affine.c
@@ -703,7 +703,7 @@ affine_generic (GeglBuffer  *dest,
 
            for (x = roi->width; x--;)
              {
-               gegl_sampler_get (sampler, u_float, v_float, &inverse_jacobian, dest_ptr);
+               gegl_sampler_get (sampler, u_float, v_float, &inverse_jacobian, dest_ptr, GEGL_REPEAT_MODE_ZERO);
                dest_ptr+=4;
                u_float += inverse.coeff [0][0];
                v_float += inverse.coeff [1][0];
diff --git a/operations/common/map-absolute.c b/operations/common/map-absolute.c
index 11fffda..f0745ff 100644
--- a/operations/common/map-absolute.c
+++ b/operations/common/map-absolute.c
@@ -100,7 +100,7 @@ process (GeglOperation       *operation,
                 }
               else
                 {
-                  gegl_sampler_get (sampler, coords[0], coords[1], NULL, out);
+                  gegl_sampler_get (sampler, coords[0], coords[1], NULL, out, GEGL_REPEAT_MODE_ZERO);
                 }
 
               coords += 2;
diff --git a/operations/common/map-relative.c b/operations/common/map-relative.c
index 20d6517..a4f6c4b 100644
--- a/operations/common/map-relative.c
+++ b/operations/common/map-relative.c
@@ -108,7 +108,8 @@ process (GeglOperation       *operation,
                 {
                   gegl_sampler_get (sampler, x+coords[0] * scaling,
                                              y+coords[1] * scaling,
-                                             NULL, out);
+                                             NULL, out,
+                                             GEGL_REPEAT_MODE_ZERO);
                 }
 
               coords += 2;
diff --git a/operations/common/mirrors.c b/operations/common/mirrors.c
index cf50185..02fa77d 100644
--- a/operations/common/mirrors.c
+++ b/operations/common/mirrors.c
@@ -234,7 +234,7 @@ apply_mirror (double               mirror_angle,
 
 
 #ifndef DO_NOT_USE_BUFFER_SAMPLE
-        gegl_buffer_sample (src, cx, cy, NULL, &dst_buf[(row * roi->width + col) * 4], format, GEGL_SAMPLER_LINEAR);
+        gegl_buffer_sample (src, cx, cy, NULL, &dst_buf[(row * roi->width + col) * 4], format, GEGL_SAMPLER_LINEAR, GEGL_REPEAT_MODE_ZERO);
 #endif
 
 #ifdef DO_NOT_USE_BUFFER_SAMPLE
diff --git a/operations/workshop/convolution-matrix.c b/operations/workshop/convolution-matrix.c
index 4bb023d..8420b56 100644
--- a/operations/workshop/convolution-matrix.c
+++ b/operations/workshop/convolution-matrix.c
@@ -274,7 +274,8 @@ convolve_pixel(gfloat               *src_buf,
                     gfloat temp_color[4];
                     gegl_buffer_sample (input, s_x, s_y, NULL, temp_color,
                                         babl_format ("RGBA float"),
-                                        GEGL_SAMPLER_NEAREST);
+                                        GEGL_SAMPLER_NEAREST,
+                                        GEGL_REPEAT_MODE_ZERO);
                     if (i!=3 && o->weight)
                       sum += matrix[x][y] * temp_color[i]
                         * temp_color[3];
diff --git a/operations/workshop/cubism.c b/operations/workshop/cubism.c
index 4809ecf..910a54c 100644
--- a/operations/workshop/cubism.c
+++ b/operations/workshop/cubism.c
@@ -514,7 +514,7 @@ process (GeglOperation       *operation,
       iy = CLAMP (y, boundary.y, boundary.y + boundary.height - 1);
 
       gegl_buffer_sample (input, ix, iy, NULL, color, format,
-                          GEGL_SAMPLER_NEAREST);
+                          GEGL_SAMPLER_NEAREST, GEGL_REPEAT_MODE_ZERO);
 
       fill_poly_color (&poly, &extended, &boundary, dst_buf, color);
     }
diff --git a/operations/workshop/ditto.c b/operations/workshop/ditto.c
index b7b6cb4..105fd45 100644
--- a/operations/workshop/ditto.c
+++ b/operations/workshop/ditto.c
@@ -70,7 +70,8 @@ process (GeglOperation       *operation,
                         x,
                         y,
                         NULL,
-                        out_pixel);
+                        out_pixel,
+                        GEGL_REPEAT_MODE_ZERO);
 
       out_pixel += 4;
 
diff --git a/operations/workshop/external/gluas.c b/operations/workshop/external/gluas.c
index 536f1d9..4959663 100644
--- a/operations/workshop/external/gluas.c
+++ b/operations/workshop/external/gluas.c
@@ -244,7 +244,8 @@ get_rgba_pixel (void       *data,
         return;
       gegl_buffer_sample (p->in_drawable, x, y, NULL, buf,
                           p->rgba_float,
-                          GEGL_SAMPLER_NEAREST);
+                          GEGL_SAMPLER_NEAREST,
+                          GEGL_REPEAT_MODE_ZERO);
       for (i = 0; i < 4; i++)
         pixel[i] = buf[i];
     }
@@ -255,7 +256,8 @@ get_rgba_pixel (void       *data,
         return;
       gegl_buffer_sample (p->aux_drawable, x, y, NULL, buf,
                           p->rgba_float,
-                          GEGL_SAMPLER_NEAREST);
+                          GEGL_SAMPLER_NEAREST,
+                          GEGL_REPEAT_MODE_ZERO);
       for (i = 0; i < 4; i++)
         pixel[i] = buf[i];
     }
diff --git a/operations/workshop/fractal-trace.c b/operations/workshop/fractal-trace.c
index 199ea52..4646932 100644
--- a/operations/workshop/fractal-trace.c
+++ b/operations/workshop/fractal-trace.c
@@ -174,7 +174,7 @@ fractaltrace (GeglBuffer          *input,
       if (0 <= px && px < picture->width && 0 <= py && py < picture->height)
         {
           gegl_buffer_sample (input, px, py, &scale, dest, format,
-                              GEGL_SAMPLER_LOHALO);
+                              GEGL_SAMPLER_LOHALO, GEGL_REPEAT_MODE_ZERO);
         }
       else
         {
@@ -207,7 +207,7 @@ fractaltrace (GeglBuffer          *input,
                 }
 
               gegl_buffer_sample (input, px, py, &scale, dest, format,
-                                  GEGL_SAMPLER_LOHALO);
+                                  GEGL_SAMPLER_LOHALO, GEGL_REPEAT_MODE_ZERO);
               break;
 
             case BACKGROUND_TYPE_TRANSPARENT:
diff --git a/operations/workshop/lens-distortion.c b/operations/workshop/lens-distortion.c
index 9e8c68e..a7001cc 100644
--- a/operations/workshop/lens-distortion.c
+++ b/operations/workshop/lens-distortion.c
@@ -239,7 +239,8 @@ lens_distort_func (gfloat              *src_buf,
             {
               gegl_buffer_sample (input, x, y, NULL, temp,
                                   babl_format ("RGBA float"),
-                                  GEGL_SAMPLER_NEAREST);
+                                  GEGL_SAMPLER_NEAREST,
+                                  GEGL_REPEAT_MODE_ZERO);
             }
           else
             {
diff --git a/operations/workshop/noise-spread.c b/operations/workshop/noise-spread.c
index 72bf4fb..b00bc42 100644
--- a/operations/workshop/noise-spread.c
+++ b/operations/workshop/noise-spread.c
@@ -90,9 +90,11 @@ apply_spread (gint                 x_amount,
       calc_sample_coords (x1, y1, x_amount, y_amount, gr, &x, &y);
       /* Only displace the pixel if it's within the bounds of the image. */
       if (x >= 0 && x < img_width && y >= 0 && y < img_height)
-        gegl_buffer_sample (src, x, y, NULL, &dst_buf[(y1 * roi->width + x1) * 4], format,  GEGL_SAMPLER_LINEAR);
+        gegl_buffer_sample (src, x, y, NULL, &dst_buf[(y1 * roi->width + x1) * 4], format,
+                            GEGL_SAMPLER_LINEAR, GEGL_REPEAT_MODE_ZERO);
       else /* Else just copy it */
-        gegl_buffer_sample (src, x1, y1, NULL, &dst_buf[(y1 * roi->width + x1) * 4], format,  GEGL_SAMPLER_LINEAR);
+        gegl_buffer_sample (src, x1, y1, NULL, &dst_buf[(y1 * roi->width + x1) * 4], format,
+                            GEGL_SAMPLER_LINEAR, GEGL_REPEAT_MODE_ZERO);
     } /* for */
   } /* for */
 
diff --git a/operations/workshop/plasma.c b/operations/workshop/plasma.c
index cacbdfb..f40d8ba 100644
--- a/operations/workshop/plasma.c
+++ b/operations/workshop/plasma.c
@@ -219,13 +219,13 @@ do_plasma_big (PlasmaContext *context,
         return FALSE;
 
       gegl_buffer_sample (context->output, x1, y1, NULL, tl, babl_format ("RGBA float"),
-                          GEGL_SAMPLER_NEAREST);
+                          GEGL_SAMPLER_NEAREST, GEGL_REPEAT_MODE_ZERO);
       gegl_buffer_sample (context->output, x1, y2, NULL, bl, babl_format ("RGBA float"),
-                          GEGL_SAMPLER_NEAREST);
+                          GEGL_SAMPLER_NEAREST, GEGL_REPEAT_MODE_ZERO);
       gegl_buffer_sample (context->output, x2, y1, NULL, tr, babl_format ("RGBA float"),
-                          GEGL_SAMPLER_NEAREST);
+                          GEGL_SAMPLER_NEAREST, GEGL_REPEAT_MODE_ZERO);
       gegl_buffer_sample (context->output, x2, y2, NULL, br, babl_format ("RGBA float"),
-                          GEGL_SAMPLER_NEAREST);
+                          GEGL_SAMPLER_NEAREST, GEGL_REPEAT_MODE_ZERO);
 
       ran = context->o->turbulence / (2.0 * scale_depth);
 
diff --git a/operations/workshop/polar-coordinates.c b/operations/workshop/polar-coordinates.c
index e3880ae..b0e8ac8 100644
--- a/operations/workshop/polar-coordinates.c
+++ b/operations/workshop/polar-coordinates.c
@@ -343,7 +343,7 @@ process (GeglOperation       *operation,
 
         if (inside)
           gegl_buffer_sample (input, px, py, &scale, dest, format,
-                              GEGL_SAMPLER_LOHALO);
+                              GEGL_SAMPLER_LOHALO, GEGL_REPEAT_MODE_ZERO);
         else
           for (i=0; i<4; i++)
             dest[i] = 0.0;
diff --git a/operations/workshop/ripple.c b/operations/workshop/ripple.c
index 2370841..78c030e 100644
--- a/operations/workshop/ripple.c
+++ b/operations/workshop/ripple.c
@@ -123,7 +123,8 @@ process (GeglOperation       *operation,
                         coordsx,
                         coordsy,
                         NULL,
-                        out_pixel);
+                        out_pixel,
+                        GEGL_REPEAT_MODE_ZERO);
 
       out_pixel += 4;
 
diff --git a/operations/workshop/whirl-pinch.c b/operations/workshop/whirl-pinch.c
index 5e71e8f..7977878 100644
--- a/operations/workshop/whirl-pinch.c
+++ b/operations/workshop/whirl-pinch.c
@@ -158,7 +158,7 @@ apply_whirl_pinch (gdouble whirl, gdouble pinch, gdouble radius,
         gegl_sampler_compute_scale (scale, roi->x + col, roi->y + row);
         gegl_unmap (roi->x + col, roi->y + row, cx, cy);
 
-        gegl_sampler_get (sampler, cx, cy, &scale, &dst_buf[(row * roi->width + col) * 4]);
+        gegl_sampler_get (sampler, cx, cy, &scale, &dst_buf[(row * roi->width + col) * 4], GEGL_REPEAT_MODE_ZERO);
     } /* for */
   } /* for */
 
@@ -226,9 +226,9 @@ process (GeglOperation       *operation,
                 o->radius,
                 boundary.width / 2.0,
                 boundary.height / 2.0,
-		format,
+                format,
                 input,
-		&boundary,
+                &boundary,
                 output,
                 &boundary,
                 result);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]