[gimp/soc-2010-cage] gimpoperationcage: iterate accordingly to cage's bounding box. pre-copy the input buffer to the outp



commit df7d3ed480fcc93c35d60c53bc93d7ea3db796c4
Author: Michael Muré <batolettre gmail com>
Date:   Fri Jul 16 23:04:00 2010 +0200

    gimpoperationcage: iterate accordingly to cage's bounding box.
    pre-copy the input buffer to the output.

 app/gegl/gimpoperationcage.c |   11 +++++++----
 app/tools/gimpcagetool.c     |    4 ++--
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/app/gegl/gimpoperationcage.c b/app/gegl/gimpoperationcage.c
index 339bbeb..306f6d7 100644
--- a/app/gegl/gimpoperationcage.c
+++ b/app/gegl/gimpoperationcage.c
@@ -138,7 +138,7 @@ gimp_operation_cage_process (GeglOperation       *operation,
   Babl *format_io = babl_format ("RGBA float");
   Babl *format_coef = babl_format_n (babl_type ("float"), op_cage->cage->cage_vertice_number);
   
-  gint in, out, coef_vertices, coef_edges;
+  gint in, coef_vertices, coef_edges;
   gint i;
   GeglRectangle rect;
   GeglBufferIterator *it;
@@ -148,11 +148,14 @@ gimp_operation_cage_process (GeglOperation       *operation,
   
   gimp_cage_compute_coefficient (cage);
   
-  it = gegl_buffer_iterator_new (in_buf, roi, format_io, GEGL_BUFFER_READ);
+  it = gegl_buffer_iterator_new (in_buf, &cage->bounding_box, format_io, GEGL_BUFFER_READ);
   in = 0;
   
-  coef_vertices = gegl_buffer_iterator_add (it, cage->cage_vertices_coef, roi, format_coef, GEGL_BUFFER_READ);
-  coef_edges = gegl_buffer_iterator_add (it, cage->cage_edges_coef, roi, format_coef, GEGL_BUFFER_READ);
+  coef_vertices = gegl_buffer_iterator_add (it, cage->cage_vertices_coef, &cage->bounding_box, format_coef, GEGL_BUFFER_READ);
+  coef_edges = gegl_buffer_iterator_add (it, cage->cage_edges_coef, &cage->bounding_box, format_coef, GEGL_BUFFER_READ);
+  
+  /* pre-copy the input buffer to the out buffer */
+  gegl_buffer_copy (in_buf, roi, out_buf, roi);
   
   /* iterate on GeglBuffer */
   while (gegl_buffer_iterator_next (it))
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index 861b595..df05d56 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -306,14 +306,14 @@ gimp_cage_tool_motion (GimpTool         *tool,
 
   gimp_draw_tool_pause (draw_tool);
 
-  /*
+  
   if (ct->handle_moved >= 0)
   {
     gimp_cage_move_cage_point  (cage,
                                 ct->handle_moved,
                                 coords->x,
                                 coords->y);
-  } */
+  }
 
   gimp_draw_tool_resume (draw_tool);
 }



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