[gegl/soc-2011-warp] map-absolute, map-relative: add a property to choose the sampler



commit ada787047145e10825347a48628515cc73a594c2
Author: Michael Murà <batolettre gmail com>
Date:   Sun Jul 3 11:51:15 2011 +0200

    map-absolute, map-relative: add a property to choose the sampler

 operations/common/map-absolute.c |    9 +++++----
 operations/common/map-relative.c |    7 ++++---
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/operations/common/map-absolute.c b/operations/common/map-absolute.c
index d913035..d6f5588 100644
--- a/operations/common/map-absolute.c
+++ b/operations/common/map-absolute.c
@@ -26,10 +26,12 @@
 #include "buffer/gegl-sampler.h"
 #include "buffer/gegl-buffer-iterator.h"
 
-#include <stdio.h>
 
 #ifdef GEGL_CHANT_PROPERTIES
 
+gegl_chant_interpolation (interpolation, _("Interpolation"),
+                          GEGL_INTERPOLATION_CUBIC, _("Sampler used internaly"))
+
 #else
 
 #define GEGL_CHANT_TYPE_COMPOSER
@@ -65,18 +67,17 @@ process (GeglOperation       *operation,
          GeglBuffer          *output,
          const GeglRectangle *result)
 {
+  GeglChantO           *o = GEGL_CHANT_PROPERTIES (operation);
   Babl                 *format_io, *format_coords;
   GeglSampler          *sampler;
   GType                 desired_type;
-  GeglInterpolation     interpolation;
   GeglBufferIterator   *it;
   gint                  index_in, index_out, index_coords;
 
   format_io = babl_format ("RGBA float");
   format_coords = babl_format_n (babl_type ("float"), 2);
 
-  interpolation = gegl_buffer_interpolation_from_string ("cubic");
-  desired_type = gegl_sampler_type_from_interpolation (interpolation);
+  desired_type = gegl_sampler_type_from_interpolation (o->interpolation);
 
   sampler = g_object_new (desired_type,
                           "format", format_io,
diff --git a/operations/common/map-relative.c b/operations/common/map-relative.c
index fd6bb8b..43cef31 100644
--- a/operations/common/map-relative.c
+++ b/operations/common/map-relative.c
@@ -33,6 +33,8 @@
 gegl_chant_double (scaling, _("Scaling"), 0.0, 5000.0, 1.0,
        _("scaling factor of displacement, indicates how large spatial"
          " displacement a relative mapping value of 1.0 corresponds to."))
+gegl_chant_interpolation (interpolation, _("Interpolation"),
+                          GEGL_INTERPOLATION_CUBIC, _("Sampler used internaly"))
 
 #else
 
@@ -69,18 +71,17 @@ process (GeglOperation       *operation,
          GeglBuffer          *output,
          const GeglRectangle *result)
 {
+  GeglChantO           *o = GEGL_CHANT_PROPERTIES (operation);
   Babl                 *format_io, *format_coords;
   GeglSampler          *sampler;
   GType                 desired_type;
-  GeglInterpolation     interpolation;
   GeglBufferIterator   *it;
   gint                  index_in, index_out, index_coords;
 
   format_io = babl_format ("RGBA float");
   format_coords = babl_format_n (babl_type ("float"), 2);
 
-  interpolation = gegl_buffer_interpolation_from_string ("cubic");
-  desired_type = gegl_sampler_type_from_interpolation (interpolation);
+  desired_type = gegl_sampler_type_from_interpolation (o->interpolation);
 
   sampler = g_object_new (desired_type,
                           "format", format_io,



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