[gimp] app: add gimp_gegl_node_is_area_filter_operation()



commit f6c4e4912a9d60275a28053c6aa70abf6ea4aaeb
Author: Ell <ell_se yahoo com>
Date:   Sun Jul 28 11:42:01 2019 +0300

    app: add gimp_gegl_node_is_area_filter_operation()
    
    ... which determines if a node is an area filter operation.  If the
    node is a meta op, we conservatively return TRUE, as it may involve
    an area-filter op.

 app/gegl/gimp-gegl-utils.c | 19 +++++++++++++++++++
 app/gegl/gimp-gegl-utils.h |  1 +
 2 files changed, 20 insertions(+)
---
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index 92d04f0f10..ada1e40bf9 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -152,6 +152,25 @@ gimp_gegl_node_is_point_operation (GeglNode *node)
          GEGL_IS_OPERATION_POINT_COMPOSER3 (operation);
 }
 
+gboolean
+gimp_gegl_node_is_area_filter_operation (GeglNode *node)
+{
+  GeglOperation *operation;
+
+  g_return_val_if_fail (GEGL_IS_NODE (node), FALSE);
+
+  operation = gegl_node_get_gegl_operation (node);
+
+  if (! operation)
+    return FALSE;
+
+  return GEGL_IS_OPERATION_AREA_FILTER (operation) ||
+         /* be conservative and return TRUE for meta ops, since they may
+          * involve an area op
+          */
+         GEGL_IS_OPERATION_META (operation);
+}
+
 const Babl *
 gimp_gegl_node_get_format (GeglNode    *node,
                            const gchar *pad_name)
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index cade90e392..d854866e9e 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -34,6 +34,7 @@ void         gimp_gegl_progress_connect              (GeglNode            *node,
 
 gboolean     gimp_gegl_node_is_source_operation      (GeglNode            *node);
 gboolean     gimp_gegl_node_is_point_operation       (GeglNode            *node);
+gboolean     gimp_gegl_node_is_area_filter_operation (GeglNode            *node);
 
 const Babl * gimp_gegl_node_get_format               (GeglNode            *node,
                                                       const gchar         *pad_name);


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