static gboolean gegl_affine_is_intermediate_node (OpAffine *affine) { GSList *connections; GeglOperation *op = GEGL_OPERATION (affine); connections = gegl_pad_get_connections (gegl_node_get_pad (op->node, "output")); if (! connections) return FALSE; do { GeglOperation *sink; sink = gegl_connection_get_sink_node (connections->data)->operation; if (! IS_OP_AFFINE (sink) || strcmp (affine->filter, OP_AFFINE (sink)->filter)) return FALSE; } while ((connections = g_slist_next (connections))); return TRUE; }
GList * gegl_graph_get_connected_output_contexts (GeglGraphTraversal *path, GeglPad *output_pad) { GList *result = NULL; GSList *targets = gegl_pad_get_connections (output_pad); GSList *targets_iter; for (targets_iter = targets; targets_iter; targets_iter = g_slist_next (targets_iter)) { GeglNode *target_node = gegl_connection_get_sink_node (targets_iter->data); GeglOperationContext *target_context = g_hash_table_lookup (path->contexts, target_node); /* Only include this target if it's part of the current path */ if (target_context) { const gchar *target_pad_name = gegl_pad_get_name (gegl_connection_get_sink_pad (targets_iter->data)); ContextConnection *result_element = g_new0 (ContextConnection, 1); result_element->name = target_pad_name; result_element->context = target_context; result = g_list_prepend (result, result_element); } } return result; }
void gegl_dot_util_add_connection (GString *string, GeglConnection *connection) { GeglNode *source; GeglNode *sink; GeglPad *source_pad; GeglPad *sink_pad; source = gegl_connection_get_source_node (connection); sink = gegl_connection_get_sink_node (connection); source_pad = gegl_connection_get_source_pad (connection); sink_pad = gegl_connection_get_sink_pad (connection); g_string_append_printf (string, "op_%p:%s -> op_%p:%s;\n", source, gegl_pad_get_name (source_pad), sink, gegl_pad_get_name (sink_pad)); }