[gimp/blend-tool-fun: 3/5] operations: Use input for the shapeburst distance map in Blend.



commit 49b8fd2285b47428b008abc47048eef3c7b6e1c7
Author: Michael Henning <drawoc darkrefraction com>
Date:   Sun Apr 26 23:01:13 2015 -0400

    operations: Use input for the shapeburst distance map in Blend.

 app/operations/gimpoperationblend.c |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/app/operations/gimpoperationblend.c b/app/operations/gimpoperationblend.c
index 5759e32..6bc774e 100644
--- a/app/operations/gimpoperationblend.c
+++ b/app/operations/gimpoperationblend.c
@@ -751,11 +751,9 @@ gradient_calc_shapeburst_angular_factor (GeglBuffer *dist_buffer,
                                          gdouble     x,
                                          gdouble     y)
 {
-  gint   ix = CLAMP (x, 0.0, gegl_buffer_get_width  (dist_buffer) - 0.7);
-  gint   iy = CLAMP (y, 0.0, gegl_buffer_get_height (dist_buffer) - 0.7);
   gfloat value;
 
-  gegl_buffer_get (dist_buffer, GEGL_RECTANGLE (ix, iy, 1, 1), 1.0,
+  gegl_buffer_get (dist_buffer, GEGL_RECTANGLE (x, y, 1, 1), 1.0,
                    NULL, &value,
                    GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
 
@@ -770,11 +768,9 @@ gradient_calc_shapeburst_spherical_factor (GeglBuffer *dist_buffer,
                                            gdouble     x,
                                            gdouble     y)
 {
-  gint   ix = CLAMP (x, 0.0, gegl_buffer_get_width  (dist_buffer) - 0.7);
-  gint   iy = CLAMP (y, 0.0, gegl_buffer_get_height (dist_buffer) - 0.7);
   gfloat value;
 
-  gegl_buffer_get (dist_buffer, GEGL_RECTANGLE (ix, iy, 1, 1), 1.0,
+  gegl_buffer_get (dist_buffer, GEGL_RECTANGLE (x, y, 1, 1), 1.0,
                    NULL, &value,
                    GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
 
@@ -789,11 +785,9 @@ gradient_calc_shapeburst_dimpled_factor (GeglBuffer *dist_buffer,
                                          gdouble     x,
                                          gdouble     y)
 {
-  gint   ix = CLAMP (x, 0.0, gegl_buffer_get_width  (dist_buffer) - 0.7);
-  gint   iy = CLAMP (y, 0.0, gegl_buffer_get_height (dist_buffer) - 0.7);
   gfloat value;
 
-  gegl_buffer_get (dist_buffer, GEGL_RECTANGLE (ix, iy, 1, 1), 1.0,
+  gegl_buffer_get (dist_buffer, GEGL_RECTANGLE (x, y, 1, 1), 1.0,
                    NULL, &value,
                    GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
 
@@ -1042,11 +1036,7 @@ gimp_operation_blend_process (GeglOperation       *operation,
     case GIMP_GRADIENT_SHAPEBURST_SPHERICAL:
     case GIMP_GRADIENT_SHAPEBURST_DIMPLED:
       rbd.dist = sqrt (SQR (ex - sx) + SQR (ey - sy));
-      /*rbd.dist_buffer = gradient_precalc_shapeburst (image, drawable,
-                                                     buffer_region,
-                                                     rbd.dist, progress);*/
-      /* FIXME */
-      g_return_val_if_reached (FALSE);
+      rbd.dist_buffer = input;
       break;
 
     default:
@@ -1162,8 +1152,5 @@ gimp_operation_blend_process (GeglOperation       *operation,
 
   g_object_unref (rbd.gradient);
 
-  if (rbd.dist_buffer)
-    g_object_unref (rbd.dist_buffer);
-
   return TRUE;
 }


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