[gnome-photos/wip/rishi/edit-mode: 17/27] base-item: Add photos_base_item_get_bbox_source



commit 3dbc04f05388bcb48fca83fdb03ebe4d0555207e
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 8d835b2..715d35e 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 c4794d2..d21c7b1 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]