[gimp/soc-2010-cage] app: add gimp_interpolation_to_gegl_filter()



commit 7b97522bc17321cb66d658bc1af2346b9d9f9153
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jun 6 17:41:31 2010 +0200

    app: add gimp_interpolation_to_gegl_filter()

 app/gegl/gimp-gegl-utils.c |   16 ++++++++++++++++
 app/gegl/gimp-gegl-utils.h |    9 +++++----
 2 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index 8b08766..602a6a8 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -152,3 +152,19 @@ gimp_layer_mode_to_gegl_operation (GimpLayerModeEffects mode)
 
   return "gegl:over";
 }
+
+const gchar *
+gimp_interpolation_to_gegl_filter (GimpInterpolationType interpolation)
+{
+  switch (interpolation)
+    {
+    case GIMP_INTERPOLATION_NONE:    return "nearest";
+    case GIMP_INTERPOLATION_LINEAR:  return "linear";
+    case GIMP_INTERPOLATION_CUBIC:   return "cubic";
+    case GIMP_INTERPOLATION_LANCZOS: return "lanczos";
+    default:
+      break;
+    }
+
+  return "nearest";
+}
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index 5d5fc3b..6c2fd09 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -22,12 +22,13 @@
 #define __GIMP_GEGL_UTILS_H__
 
 
-const Babl  * gimp_bpp_to_babl_format           (guint                bpp,
-                                                 gboolean             linear) G_GNUC_CONST;
+const Babl  * gimp_bpp_to_babl_format           (guint                  bpp,
+                                                 gboolean               linear) G_GNUC_CONST;
 
-TileManager * gimp_buffer_to_tiles              (GeglBuffer          *buffer);
+TileManager * gimp_buffer_to_tiles              (GeglBuffer            *buffer);
 
-const gchar * gimp_layer_mode_to_gegl_operation (GimpLayerModeEffects mode) G_GNUC_CONST;
+const gchar * gimp_layer_mode_to_gegl_operation (GimpLayerModeEffects   mode) G_GNUC_CONST;
+const gchar * gimp_interpolation_to_gegl_filter (GimpInterpolationType  interpolation) G_GNUC_CONST;
 
 
 #endif /* __GIMP_GEGL_UTILS_H__ */



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