[gegl] operations: cartoon: always call progress() with 0.0 and 1.0



commit 29e5d5939c47dd8cc7c521d92cd51dc25ead20d6
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 11 22:47:59 2016 +0200

    operations: cartoon: always call progress() with 0.0 and 1.0
    
    so the GUI knows start/end.

 operations/common/cartoon.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/operations/common/cartoon.c b/operations/common/cartoon.c
index 7bd4efc..1f4ab3f 100644
--- a/operations/common/cartoon.c
+++ b/operations/common/cartoon.c
@@ -230,23 +230,27 @@ process (GeglOperation       *operation,
   grey_blur_buffer (input, o->mask_radius, &dest1, &dest2);
 
   sampler1 = gegl_buffer_sampler_new_at_level (dest1,
-                                      babl_format ("Y' float"),
-                                      GEGL_SAMPLER_LINEAR,
-                                      level);
+                                               babl_format ("Y' float"),
+                                               GEGL_SAMPLER_LINEAR,
+                                               level);
 
   sampler2 = gegl_buffer_sampler_new_at_level (dest2,
-                                      babl_format ("Y' float"),
-                                      GEGL_SAMPLER_LINEAR,
-                                      level);
+                                               babl_format ("Y' float"),
+                                               GEGL_SAMPLER_LINEAR,
+                                               level);
 
   ramp = compute_ramp (sampler1, sampler2, result, o->pct_black);
 
-  iter = gegl_buffer_iterator_new (output, result, 0, babl_format ("Y'CbCrA float"),
+  iter = gegl_buffer_iterator_new (output, result, 0,
+                                   babl_format ("Y'CbCrA float"),
                                    GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
-  gegl_buffer_iterator_add (iter, input, result, 0, babl_format ("Y'CbCrA float"),
+  gegl_buffer_iterator_add (iter, input, result, 0,
+                            babl_format ("Y'CbCrA float"),
                             GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
 
 
+  gegl_operation_progress (operation, 0.0, "");
+
   while (gegl_buffer_iterator_next (iter))
     {
       gfloat *out_pixel = iter->data[0];
@@ -293,10 +297,12 @@ process (GeglOperation       *operation,
 
           }
         pixels += iter->roi[0].width;
-        gegl_operation_progress (operation, pixels / tot_pixels, "a");
+        gegl_operation_progress (operation, pixels / tot_pixels, "");
       }
     }
 
+  gegl_operation_progress (operation, 1.0, "");
+
   g_object_unref (sampler1);
   g_object_unref (sampler2);
 


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