[gimp/metadata-browser] app: add gimp_gegl_buffer_get_tiles()



commit 1e8329c97a95330929f85538416c74dda2a4a1be
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 21 00:51:49 2012 +0100

    app: add gimp_gegl_buffer_get_tiles()

 app/gegl/gimp-gegl-utils.c            |   17 +++++++++++++++++
 app/gegl/gimp-gegl-utils.h            |    2 ++
 app/gegl/gimptilebackendtilemanager.c |    8 ++++++++
 app/gegl/gimptilebackendtilemanager.h |    2 ++
 4 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index 441cae2..3b416e3 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -236,6 +236,23 @@ gimp_tile_manager_create_buffer (TileManager *tm,
   return buffer;
 }
 
+/* temp hack */
+GeglTileBackend * gegl_buffer_backend (GeglBuffer *buffer);
+
+TileManager *
+gimp_gegl_buffer_get_tiles (GeglBuffer *buffer)
+{
+  GeglTileBackend *backend;
+
+  g_return_val_if_fail (GEGL_IS_BUFFER (buffer), NULL);
+
+  backend = gegl_buffer_backend (buffer);
+
+  g_return_val_if_fail (GIMP_IS_TILE_BACKEND_TILE_MANAGER (backend), NULL);
+
+  return gimp_tile_backend_tile_manager_get_tiles (backend);
+}
+
 void
 gimp_gegl_buffer_refetch_tiles (GeglBuffer *buffer)
 {
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index b94262b..1a65bfe 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -38,6 +38,8 @@ GeglBuffer  * gimp_gegl_buffer_new               (const GeglRectangle   *rect,
 GeglBuffer  * gimp_tile_manager_create_buffer    (TileManager           *tm,
                                                   const Babl            *format,
                                                   gboolean               write);
+TileManager * gimp_gegl_buffer_get_tiles         (GeglBuffer            *buffer);
+
 GeglBuffer  * gimp_pixbuf_create_buffer          (GdkPixbuf             *pixbuf);
 
 void          gimp_gegl_buffer_refetch_tiles     (GeglBuffer            *buffer);
diff --git a/app/gegl/gimptilebackendtilemanager.c b/app/gegl/gimptilebackendtilemanager.c
index d236821..043bf270 100644
--- a/app/gegl/gimptilebackendtilemanager.c
+++ b/app/gegl/gimptilebackendtilemanager.c
@@ -280,3 +280,11 @@ gimp_tile_backend_tile_manager_new (TileManager *tm,
 
   return ret;
 }
+
+TileManager *
+gimp_tile_backend_tile_manager_get_tiles (GeglTileBackend *backend)
+{
+  g_return_val_if_fail (GIMP_IS_TILE_BACKEND_TILE_MANAGER (backend), NULL);
+
+  return GIMP_TILE_BACKEND_TILE_MANAGER (backend)->priv->tile_manager;
+}
diff --git a/app/gegl/gimptilebackendtilemanager.h b/app/gegl/gimptilebackendtilemanager.h
index 0f68f63..54b34ae 100644
--- a/app/gegl/gimptilebackendtilemanager.h
+++ b/app/gegl/gimptilebackendtilemanager.h
@@ -56,6 +56,8 @@ GeglTileBackend * gimp_tile_backend_tile_manager_new      (TileManager *tm,
                                                            const Babl  *format,
                                                            gboolean     write);
 
+TileManager     * gimp_tile_backend_tile_manager_get_tiles (GeglTileBackend *backend);
+
 
 G_END_DECLS
 



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