[gegl] crop: don't depend on the input node's bounding box ...



commit 9b3e9422e0fa296965525dd9fd2f502c83574a4f
Author: Ell <ell_se yahoo com>
Date:   Tue Dec 6 16:00:01 2016 -0500

    crop: don't depend on the input node's bounding box ...
    
    ... in get_invalidated_by_change() and get_required_for_output()
    
    This partially reverts commit 09e6133a340b666245749b682d9b76dd8b0d26d7.
    
    The dependency on the input's boudning box is mostly important for
    calculating the size of the output buffer (see the commit message of
    the aforementioned commit), and not strictly required for these
    functions (altough possibly more accurate).  This dependency did,
    however, cause at least one issue (see previous commit), and the
    calculation of the input's bounding box can be more expensive than
    we'd like here, so reverting it for now, to stay on the safe side.

 operations/core/crop.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/operations/core/crop.c b/operations/core/crop.c
index 26d687d..3812fa3 100644
--- a/operations/core/crop.c
+++ b/operations/core/crop.c
@@ -106,7 +106,13 @@ gegl_crop_get_invalidated_by_change (GeglOperation       *operation,
                                      const gchar         *input_pad,
                                      const GeglRectangle *input_region)
 {
-  GeglRectangle result = gegl_crop_get_bounding_box (operation);
+  GeglProperties *o = GEGL_PROPERTIES (operation);
+  GeglRectangle   result;
+
+  result.x      = o->x;
+  result.y      = o->y;
+  result.width  = o->width;
+  result.height = o->height;
 
   gegl_rectangle_intersect (&result, &result, input_region);
 
@@ -118,7 +124,13 @@ gegl_crop_get_required_for_output (GeglOperation       *operation,
                                    const gchar         *input_pad,
                                    const GeglRectangle *roi)
 {
-  GeglRectangle result = gegl_crop_get_bounding_box (operation);
+  GeglProperties *o = GEGL_PROPERTIES (operation);
+  GeglRectangle   result;
+
+  result.x      = o->x;
+  result.y      = o->y;
+  result.width  = o->width;
+  result.height = o->height;
 
   gegl_rectangle_intersect (&result, &result, roi);
   return result;


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