[gnome-photos/wip/rishi/edit-mode: 16/29] base-item: Add photos_base_item_get_bbox_source



commit c9ebdef47bdab1a38ec205f3c666fa9943a102c8
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Jun 24 09:17:57 2015 +0200

    base-item: Add photos_base_item_get_bbox_source
    
    This is similar to cd695e2bdf936cbc8c74694119fc876273f538a5 except that
    we make it clear that it is the bounding box of the original source
    image before any editing operations were performed on it.

 src/photos-base-item.c |   17 +++++++++++++++++
 src/photos-base-item.h |    2 ++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 87a6f92..cafef65 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1341,6 +1341,23 @@ photos_base_item_get_author (PhotosBaseItem *self)
 }
 
 
+gboolean
+photos_base_item_get_bbox_source (PhotosBaseItem *self, GeglRectangle *bbox)
+{
+  PhotosBaseItemPrivate *priv = self->priv;
+  gboolean ret_val = FALSE;
+
+  if (priv->buffer_source == NULL)
+    goto out;
+
+  *bbox = gegl_node_get_bounding_box (priv->buffer_source);
+  ret_val = TRUE;
+
+ out:
+  return ret_val;
+}
+
+
 gint64
 photos_base_item_get_date_created (PhotosBaseItem *self)
 {
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index 31f942e..11e3e73 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -108,6 +108,8 @@ gchar              *photos_base_item_download_finish         (PhotosBaseItem *se
 
 const gchar        *photos_base_item_get_author              (PhotosBaseItem *self);
 
+gboolean            photos_base_item_get_bbox_source         (PhotosBaseItem *self, GeglRectangle *bbox);
+
 gint64              photos_base_item_get_date_created        (PhotosBaseItem *self);
 
 const gchar        *photos_base_item_get_default_app_name    (PhotosBaseItem *self);


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