[gegl] buffer: use sampler in transform_nearest



commit 16ea30a899223794fab2adab37655fdaf8ff184b
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Jan 11 01:20:59 2018 +0100

    buffer: use sampler in transform_nearest

 operations/transform/transform-core.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index fb925b8..40b4dd9 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -1116,6 +1116,10 @@ transform_nearest (GeglOperation       *operation,
   gint                 px_size   = babl_format_get_bytes_per_pixel (format);
   GeglBufferIterator  *i;
   GeglMatrix3          inverse;
+  GeglSampler *sampler = gegl_buffer_sampler_new_at_level (src, format,
+                                         GEGL_SAMPLER_NEAREST,
+                                         level);
+  GeglSamplerGetFun sampler_get_fun = gegl_sampler_get_fun (sampler);
 
   GeglRectangle  dest_extent = *roi;
   dest_extent.x >>= level;
@@ -1255,12 +1259,10 @@ transform_nearest (GeglOperation       *operation,
           gdouble u = u_float * w_recip;
           gdouble v = v_float * w_recip;
 
-          gegl_buffer_get (src,
-                           GEGL_RECTANGLE((int)u, (int)v, 1, 1),
-                           1.0,
-                           format,
+          sampler_get_fun (sampler,
+                           u, v,
+                           NULL,
                            dest_ptr,
-                           0,
                            GEGL_ABYSS_NONE);
 
           dest_ptr += px_size;


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