[gnome-photos/wip/rishi/edit-mode: 15/25] base-item: Add photos_base_item_get_bbox_source



commit ad50b82ad6291a3fab4a2b9b891c408b67c44877
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 0b5f61f..568b712 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1333,6 +1333,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 ac8cec3..c277106 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]