[gnome-photos/wip/foo: 6/10] utils: Add photos_utils_create_pixbuf_from_node



commit a42c928b468d4e0451f0ce5bc912b2bd9eb0745c
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Mar 26 21:59:29 2013 +0100

    utils: Add photos_utils_create_pixbuf_from_node

 src/photos-utils.c |   20 +++++++++++++++++++-
 src/photos-utils.h |    5 ++++-
 2 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-utils.c b/src/photos-utils.c
index c69468d..f6256f1 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -1,6 +1,6 @@
 /*
  * Photos - access, organize and share your photos on GNOME
- * Copyright © 2012 Red Hat, Inc.
+ * Copyright © 2012, 2013 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -41,6 +41,24 @@
 static const gchar *dot_dir;
 
 
+GdkPixbuf *
+photos_utils_create_pixbuf_from_node (GeglNode *node)
+{
+  GdkPixbuf *pixbuf = NULL;
+  GeglNode *save_pixbuf;
+
+  save_pixbuf = gegl_node_new_child (gegl_node_get_parent (node),
+                                     "operation", "gegl:save-pixbuf",
+                                     "pixbuf", &pixbuf,
+                                     NULL);
+  gegl_node_link_many (node, save_pixbuf, NULL);
+  gegl_node_process (save_pixbuf);
+  g_object_unref (save_pixbuf);
+
+  return pixbuf;
+}
+
+
 GIcon *
 photos_utils_create_symbolic_icon (const gchar *name, gint base_size)
 {
diff --git a/src/photos-utils.h b/src/photos-utils.h
index 4083365..2982074 100644
--- a/src/photos-utils.h
+++ b/src/photos-utils.h
@@ -1,6 +1,6 @@
 /*
  * Photos - access, organize and share your photos on GNOME
- * Copyright © 2012 Red Hat, Inc.
+ * Copyright © 2012, 2013 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -27,12 +27,15 @@
 #define PHOTOS_UTILS_H
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gegl.h>
 #include <gio/gio.h>
 #include <glib.h>
 #include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
+GdkPixbuf       *photos_utils_create_pixbuf_from_node     (GeglNode *node);
+
 GIcon           *photos_utils_create_symbolic_icon        (const gchar *name, gint base_size);
 
 const gchar     *photos_utils_dot_dir                     (void);


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