[gegl] transform: do not transform empty/infinite rectangles



commit f93a762d4332c33d8d8febd28987572eb5a0d7ca
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Fri Dec 7 18:38:05 2012 +0100

    transform: do not transform empty/infinite rectangles
    
    transforming the infinite_plane forced the user
    to gegl:crop before and after the transform, because
    the transformed rectangle easily suffered from integer
    overflows.
    
    the empty rectangle was likely dilated because of floor/ceil
    and the meaning of graph not ready to render lost.

 operations/transform/transform-core.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index 8a8a2be..38d092f 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -494,17 +494,15 @@ gegl_transform_get_bounding_box (GeglOperation *op)
   if (gegl_operation_source_get_bounding_box (op, "input"))
     in_rect = *gegl_operation_source_get_bounding_box (op, "input");
 
+  if (gegl_rectangle_is_empty (&in_rect) ||
+      gegl_rectangle_is_infinite_plane (&in_rect))
+    return in_rect;
+
   gegl_transform_create_composite_matrix (transform, &matrix);
 
   if (gegl_transform_is_intermediate_node (transform) ||
       gegl_matrix3_is_identity (&matrix))
-    {
-      /*
-       * Is in_rect = {0,0,0,0} (an empty rectangle since
-       * width=height=0) used to communicate something?
-       */
-      return in_rect;
-    }
+    return in_rect;
 
 #if 0
   /*



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