[gegl/soc-2011-ops] Added cubism op



commit e6466bf21686e2259de01278581ee4f1077033d4
Author: Robert Sasu <sasu robert gmail com>
Date:   Wed Jul 6 14:49:02 2011 +0300

    Added cubism op

 operations/workshop/cubism.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/operations/workshop/cubism.c b/operations/workshop/cubism.c
index 9ae3a62..9620f7e 100644
--- a/operations/workshop/cubism.c
+++ b/operations/workshop/cubism.c
@@ -264,14 +264,16 @@ set_background_color (gfloat              *dst_buf,
   tmp.width  = extended->width;
   tmp.height = result->y - extended->y;
 
+
+/*get previously calculated pixels*/
+
+/*top*/
   if (tmp.height)
      {
      tmp_buf = g_new0 (gfloat, tmp.width * tmp.height * 4);
      gegl_buffer_get (input, 1.0, &tmp, babl_format ("RGBA float"), tmp_buf,
                       GEGL_AUTO_ROWSTRIDE);
 
-     printf("1: %d %d %d %d\n", tmp.x, tmp.y, tmp.width, tmp.height);
-
      for (i=0; i<tmp.width * tmp.height * 4; i++)
          dst_buf[i] = tmp_buf[i];
      g_free (tmp_buf);
@@ -281,13 +283,13 @@ set_background_color (gfloat              *dst_buf,
   tmp.width  = result->x - extended->x;   
   tmp.height = extended->height - (result->y - extended->y);
 
+/*left*/
   if (tmp.width)
      {
      tmp_buf = g_new0 (gfloat, tmp.width * tmp.height * 4);
      gegl_buffer_get (input, 1.0, &tmp, babl_format ("RGBA float"), tmp_buf,
                       GEGL_AUTO_ROWSTRIDE);
 
-     printf("2: %d %d %d %d\n", tmp.x, tmp.y, tmp.width, tmp.height);
      offset = (extended->width - 1) * (result->y - extended->y) * 4;
  
      for (i=0; i<tmp.height; i++)
@@ -315,7 +317,6 @@ fill_poly_color (Polygon             *poly,
                  const GeglRectangle *extended,
                  const GeglRectangle *boundary,
                  gfloat              *dst_buf,
-                 gfloat              *src_buf,
                  gfloat              *color)
 {
   gdouble       dmin_x = 0.0;
@@ -535,7 +536,6 @@ process (GeglOperation       *operation,
   gint    cols, rows, num_tiles, count;
   gint   *random_indices;
   gfloat *dst_buf;
-  gfloat *src_buf;
 
   Polygon poly;
   gint    i;
@@ -550,7 +550,6 @@ process (GeglOperation       *operation,
                            boundary.height);
 
   dst_buf = g_new0 (gfloat, extended.width * extended.height * 4);
-  src_buf = g_new0 (gfloat, extended.width * extended.height * 4);
 
   if (!o->background)
     {
@@ -567,9 +566,6 @@ process (GeglOperation       *operation,
 
   set_background_color (dst_buf, &extended, bg_col, input, result);
 
-  gegl_buffer_get (input, 1.0, &extended, babl_format ("RGBA float"), src_buf,
-                   GEGL_AUTO_ROWSTRIDE);
-
   num_tiles = (rows + 1) * (cols + 1);
 
   random_indices = g_new0 (gint, num_tiles);
@@ -618,7 +614,7 @@ process (GeglOperation       *operation,
                         GEGL_INTERPOLATION_NEAREST);
  
     fill_poly_color (&poly, input, output, &extended, &boundary, 
-                     dst_buf, src_buf, color);
+                     dst_buf, color);
     }
   
   gegl_buffer_set (output, &extended, format, dst_buf, GEGL_AUTO_ROWSTRIDE);



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