[gegl] polar-coordinates: use a sampler instead of gegl_buffer_sample



commit 9d594d0e85a280c2b46f603a55a5070970d6e2cf
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Jul 1 07:42:32 2014 +0200

    polar-coordinates: use a sampler instead of gegl_buffer_sample

 operations/common/polar-coordinates.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/operations/common/polar-coordinates.c b/operations/common/polar-coordinates.c
index ed67a6b..345bade 100644
--- a/operations/common/polar-coordinates.c
+++ b/operations/common/polar-coordinates.c
@@ -323,6 +323,8 @@ process (GeglOperation       *operation,
   GeglProperties          *o            = GEGL_PROPERTIES (operation);
   GeglRectangle            boundary     = get_effective_area (operation);
   const Babl              *format       = babl_format ("RGBA float");
+  GeglSampler             *sampler      = gegl_buffer_sampler_new (
+                                    input, format, GEGL_SAMPLER_NOHALO);
 
   gint      x,y;
   gfloat   *src_buf, *dst_buf;
@@ -361,8 +363,8 @@ process (GeglOperation       *operation,
 #undef gegl_unmap
 
         if (inside)
-          gegl_buffer_sample (input, px, py, &scale, dest, format,
-                              GEGL_SAMPLER_NOHALO, GEGL_ABYSS_NONE);
+          gegl_sampler_get (sampler, px, py, &scale, dest,
+                            GEGL_ABYSS_NONE);
         else
           for (i=0; i<4; i++)
             dest[i] = 0.0;
@@ -376,6 +378,8 @@ process (GeglOperation       *operation,
   g_free (src_buf);
   g_free (dst_buf);
 
+  g_object_unref (sampler);
+
   return  TRUE;
 }
 


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