[gegl] slic: add progress reporting



commit 7603ef8d44a14f41b492480127dbaabf5c48f662
Author: Thomas Manni <thomas manni free fr>
Date:   Mon May 16 10:56:44 2022 +0200

    slic: add progress reporting

 operations/common/slic.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/operations/common/slic.c b/operations/common/slic.c
index 410d77814..f8b5f7739 100644
--- a/operations/common/slic.c
+++ b/operations/common/slic.c
@@ -387,6 +387,8 @@ process (GeglOperation       *operation,
   gint        n_iterations;
   gint        i;
 
+  gegl_operation_progress (operation, 0.0, "");
+
   labels = gegl_buffer_new (src_region, babl_format_n (babl_type ("u32"), 1));
 
   /* restrict cluster size to the maximum buffer dimension */
@@ -412,12 +414,18 @@ process (GeglOperation       *operation,
                      format);
 
       update_clusters (clusters, cluster_size);
+
+      gegl_operation_progress (operation,
+                               (gdouble) (i+0.5) / n_iterations,
+                               "");
     }
 
   /* apply clusters colors to output */
 
   set_output (output, labels, clusters, format);
 
+  gegl_operation_progress (operation, 1.0, "");
+
   g_object_unref (labels);
   g_array_free (clusters, TRUE);
 


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