[gegl/soc-2013-n-point-deformation: 9/28] clear output buffer



commit 02cdfbc7b06201db574b55aadb4283a3f9365c5c
Author: Marek Dvoroznak <dvoromar gmail com>
Date:   Thu Aug 1 02:04:33 2013 +0200

    clear output buffer
    
    It fixes problem with dirty background.

 operations/external/npd.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/operations/external/npd.c b/operations/external/npd.c
index c589280..53bd7f3 100644
--- a/operations/external/npd.c
+++ b/operations/external/npd.c
@@ -191,6 +191,7 @@ process (GeglOperation       *operation,
   NPDProperties *props = o->chant_data;
   NPDModel *model = &props->model;
   guchar *output_buffer;
+  gint length = gegl_buffer_get_width (input) * gegl_buffer_get_height (input) * 4;
   
   if (props->first_run)
     {
@@ -215,18 +216,21 @@ process (GeglOperation       *operation,
       model->display = display;
       
       o->model = model;
-      NPDModel *m = o->model;
+
+      memcpy (output_buffer, input_image->buffer, length);
       
       props->first_run = FALSE;
     }
   else
     {
       output_buffer = model->display->image.buffer;
+      memset (output_buffer, 0, length);
+      
+//  npd_deform_model (model, o->rigidity);
+      npd_deform_model (model, 2000);
+      npd_draw_model (model, model->display);
     }
 
-//  npd_deform_model (model, o->rigidity);
-  npd_deform_model (model, 2000);
-  npd_draw_model (model, model->display);
 
   gegl_buffer_set (output, NULL, 0, format, output_buffer, GEGL_AUTO_ROWSTRIDE);
   


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