[gegl/soc-2011-warp: 20/31] prefix function point_lerp and point_dist with gegl_path_



commit 9843470d1551607b6eab42d151714c7238fecd9b
Author: Michael Murà <batolettre gmail com>
Date:   Mon Aug 1 20:20:04 2011 +0200

    prefix function point_lerp and point_dist with gegl_path_

 gegl/property-types/gegl-path.c |   36 ++++++++++++++++++------------------
 gegl/property-types/gegl-path.h |    4 ++--
 operations/external/path.c      |    4 ++--
 operations/workshop/warp.c      |    4 ++--
 4 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/gegl/property-types/gegl-path.c b/gegl/property-types/gegl-path.c
index a0a3c4c..184dfaa 100644
--- a/gegl/property-types/gegl-path.c
+++ b/gegl/property-types/gegl-path.c
@@ -1281,14 +1281,14 @@ bezier2 (GeglPathItem  *prev,
   Point ab,bc,cd,abbc,bccd;
 
   if (prev->type == 'c')
-    point_lerp (&ab, &prev->point[2], &curve->point[0], t);
+    gegl_path_point_lerp (&ab, &prev->point[2], &curve->point[0], t);
   else
-    point_lerp (&ab, &prev->point[0], &curve->point[0], t);
-  point_lerp (&bc, &curve->point[0], &curve->point[1], t);
-  point_lerp (&cd, &curve->point[1], &curve->point[2], t);
-  point_lerp (&abbc, &ab, &bc,t);
-  point_lerp (&bccd, &bc, &cd,t);
-  point_lerp (dest, &abbc, &bccd, t);
+    gegl_path_point_lerp (&ab, &prev->point[0], &curve->point[0], t);
+  gegl_path_point_lerp (&bc, &curve->point[0], &curve->point[1], t);
+  gegl_path_point_lerp (&cd, &curve->point[1], &curve->point[2], t);
+  gegl_path_point_lerp (&abbc, &ab, &bc,t);
+  gegl_path_point_lerp (&bccd, &bc, &cd,t);
+  gegl_path_point_lerp (dest, &abbc, &bccd, t);
 }
 
 static void
@@ -1466,7 +1466,7 @@ gegl_path_list_calc (GeglPathList *path,
               b.x = iter->d.point[0].x;
               b.y = iter->d.point[0].y;
 
-              distance = point_dist (&a, &b);
+              distance = gegl_path_point_dist (&a, &b);
               next_pos += distance;
 
               if (pos <= next_pos)
@@ -1474,7 +1474,7 @@ gegl_path_list_calc (GeglPathList *path,
                   Point spot;
                   gfloat ratio = (pos - traveled) / (next_pos - traveled);
 
-                  point_lerp (&spot, &a, &b, ratio);
+                  gegl_path_point_lerp (&spot, &a, &b, ratio);
 
                   *xd = spot.x;
                   *yd = spot.y;
@@ -1536,7 +1536,7 @@ gegl_path_list_calc_values (GeglPathList *path,
               b.x = iter->d.point[0].x;
               b.y = iter->d.point[0].y;
 
-              distance = point_dist (&a, &b);
+              distance = gegl_path_point_dist (&a, &b);
               next_pos += distance;
 
               while (next_sample <= next_pos)
@@ -1544,7 +1544,7 @@ gegl_path_list_calc_values (GeglPathList *path,
                   Point spot;
                   gfloat ratio = (next_sample - traveled) / (next_pos - traveled);
 
-                  point_lerp (&spot, &a, &b, ratio);
+                  gegl_path_point_lerp (&spot, &a, &b, ratio);
 
                   xs[i]=spot.x;
                   ys[i]=spot.y;
@@ -1604,7 +1604,7 @@ gegl_path_list_get_length (GeglPathList *path)
               b.x = iter->d.point[0].x;
               b.y = iter->d.point[0].y;
 
-              distance = point_dist (&a, &b);
+              distance = gegl_path_point_dist (&a, &b);
               traveled_length += distance;
 
               x = b.x;
@@ -1627,18 +1627,18 @@ gegl_path_list_get_length (GeglPathList *path)
 
 /***** Point *****/
 void
-point_lerp (Point  *dest,
-      Point  *a,
-      Point  *b,
-      gfloat  t)
+gegl_path_point_lerp (Point  *dest,
+                      Point  *a,
+                      Point  *b,
+                      gfloat  t)
 {
   dest->x = a->x + (b->x-a->x) * t;
   dest->y = a->y + (b->y-a->y) * t;
 }
 
 gdouble
-point_dist (Point *a,
-            Point *b)
+gegl_path_point_dist (Point *a,
+                      Point *b)
 {
   return sqrt ((a->x-b->x)*(a->x-b->x) +
                (a->y-b->y)*(a->y-b->y));
diff --git a/gegl/property-types/gegl-path.h b/gegl/property-types/gegl-path.h
index 6d40683..c54cdbc 100644
--- a/gegl/property-types/gegl-path.h
+++ b/gegl/property-types/gegl-path.h
@@ -462,7 +462,7 @@ GeglPathList *        gegl_path_get_flat_path (GeglPath *path);
  *
  * linear interpolation between two Points
  */
-void                  point_lerp              (Point            *dest,
+void                  gegl_path_point_lerp    (Point            *dest,
                                                Point            *a,
                                                Point            *b,
                                                gfloat            t);
@@ -474,7 +474,7 @@ void                  point_lerp              (Point            *dest,
  *
  * Compute the distance between Point @a and @b
  */
-gdouble               point_dist              (Point            *a,
+gdouble               gegl_path_point_dist    (Point            *a,
                                                Point            *b);
 
 G_END_DECLS
diff --git a/operations/external/path.c b/operations/external/path.c
index c88642a..27fbc2c 100644
--- a/operations/external/path.c
+++ b/operations/external/path.c
@@ -162,7 +162,7 @@ gegl_path_stroke (GeglBuffer *buffer,
 
               spacing = 0.2 * radius;
 
-              distance = point_dist (&a, &b);
+              distance = gegl_path_point_dist (&a, &b);
 
               leftover = need_to_travel - traveled_length;
               offset = spacing - leftover;
@@ -178,7 +178,7 @@ gegl_path_stroke (GeglBuffer *buffer,
                     gfloat ratio = local_pos / distance;
                     gfloat radius = linewidth/2;
 
-                    point_lerp (&spot, &a, &b, ratio);
+                    gegl_path_point_lerp (&spot, &a, &b, ratio);
 
                     gegl_path_stamp (buffer, clip_rect,
                       spot.x, spot.y, radius, hardness, color, opacity);
diff --git a/operations/workshop/warp.c b/operations/workshop/warp.c
index 55c3ad8..651d186 100644
--- a/operations/workshop/warp.c
+++ b/operations/workshop/warp.c
@@ -338,7 +338,7 @@ process (GeglOperation       *operation,
     {
       event = event->next;
       next = *(event->d.point);
-      dist = point_dist (&next, &prev);
+      dist = gegl_path_point_dist (&next, &prev);
       stamps = dist / spacing;
 
       if (stamps < 1)
@@ -350,7 +350,7 @@ process (GeglOperation       *operation,
         {
           for (i = 0; i < stamps; i++)
             {
-              point_lerp (&lerp, &prev, &next, (i * spacing) / dist);
+              gegl_path_point_lerp (&lerp, &prev, &next, (i * spacing) / dist);
               stamp (o, result, lerp.x, lerp.y);
             }
           prev = lerp;



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