[gegl] gegl: Rename source_region to need_rect
- From: Martin Nordholts <martinn src gnome org>
- To: svn-commits-list gnome org
- Subject: [gegl] gegl: Rename source_region to need_rect
- Date: Mon, 8 Jun 2009 13:38:03 -0400 (EDT)
commit b345c0bff7a3a8683ab4525072fba3a025a5eb87
Author: Martin Nordholts <martinn src gnome org>
Date: Mon Jun 8 19:16:22 2009 +0200
gegl: Rename source_region to need_rect
Do the renames
gegl_operation_calc_source_regions() ->
gegl_operation_calc_need_rects()
and
gegl_operation_set_source_region() ->
gegl_operation_set_need_rect()
since that is in line with the conventions in the rest of GEGL, in
particular name of GeglNode struct members. Also add a comment
explaning what the need rect is.
---
gegl/operation/gegl-operation.h | 2 +-
gegl/operation/gegl-operations.c | 32 ++++++++++++++++++++++++--------
gegl/process/gegl-cr-visitor.c | 2 +-
3 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/gegl/operation/gegl-operation.h b/gegl/operation/gegl-operation.h
index 9d781e7..d15953c 100644
--- a/gegl/operation/gegl-operation.h
+++ b/gegl/operation/gegl-operation.h
@@ -219,7 +219,7 @@ GParamSpec ** gegl_list_properties (const gchar *operation_type,
/* internal utility functions used by gegl, these should not be used
* externally */
-gboolean gegl_operation_calc_source_regions (GeglOperation *operation,
+gboolean gegl_operation_calc_need_rects (GeglOperation *operation,
gpointer context_id);
void gegl_operation_path_prop_changed (GeglPath *path,
GeglOperation *operation);
diff --git a/gegl/operation/gegl-operations.c b/gegl/operation/gegl-operations.c
index 7fac4b2..dc8f06a 100644
--- a/gegl/operation/gegl-operations.c
+++ b/gegl/operation/gegl-operations.c
@@ -129,11 +129,24 @@ gegl_operation_gtype_cleanup (void)
}
}
+/**
+ * gegl_operation_set_need_rect:
+ * @operation:
+ * @context_id:
+ * @input_pad_name:
+ * @region:
+ *
+ * Calculates the need rect for the node feeding into @input_pad_name
+ * for the given graph evaluation that is identified by
+ * @context_id. The need rect of a node mathematically depends on the
+ * ROI that is being evaluated and is the area that evaluation of the
+ * ROI depends on for the node in question.
+ **/
static void
-gegl_operation_set_source_region (GeglOperation *operation,
- gpointer context_id,
- const gchar *input_pad_name,
- const GeglRectangle *region)
+gegl_operation_set_need_rect (GeglOperation *operation,
+ gpointer context_id,
+ const gchar *input_pad_name,
+ const GeglRectangle *region)
{
GeglNode *child; /* the node which need rect we are affecting */
GeglRectangle child_need; /* the need rect of the child */
@@ -185,9 +198,10 @@ gegl_operation_set_source_region (GeglOperation *operation,
gegl_node_set_need_rect (child, context_id, &child_need);
}
}
+
gboolean
-gegl_operation_calc_source_regions (GeglOperation *operation,
- gpointer context_id)
+gegl_operation_calc_need_rects (GeglOperation *operation,
+ gpointer context_id)
{
GSList *input_pads;
GeglOperationContext *context;
@@ -196,14 +210,16 @@ gegl_operation_calc_source_regions (GeglOperation *operation,
context = gegl_node_get_context (operation->node, context_id);
request = context->need_rect;
- /* for each input, get_required_for_output use gegl_operation_set_source_region() */
+ /* For each input, do get_required_for_output() then use
+ * gegl_operation_set_need_rect()
+ */
for (input_pads = operation->node->input_pads;input_pads;input_pads=input_pads->next)
{
const gchar *pad_name = gegl_pad_get_name (input_pads->data);
GeglRectangle rect;
rect = gegl_operation_get_required_for_output (operation, pad_name, &request);
- gegl_operation_set_source_region (operation, context_id, pad_name, &rect);
+ gegl_operation_set_need_rect (operation, context_id, pad_name, &rect);
}
return TRUE;
}
diff --git a/gegl/process/gegl-cr-visitor.c b/gegl/process/gegl-cr-visitor.c
index 142cfa2..c34f54a 100644
--- a/gegl/process/gegl-cr-visitor.c
+++ b/gegl/process/gegl-cr-visitor.c
@@ -63,7 +63,7 @@ gegl_cr_visitor_visit_node (GeglVisitor *self,
GEGL_VISITOR_CLASS (gegl_cr_visitor_parent_class)->visit_node (self, node);
- gegl_operation_calc_source_regions (node->operation, self->context_id);
+ gegl_operation_calc_need_rects (node->operation, self->context_id);
if (!context->cached)
{
gegl_rectangle_intersect (&context->result_rect, &node->have_rect, &context->need_rect);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]