about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--converter/other/svgtopam.c21
-rw-r--r--lib/libppmd.c25
-rw-r--r--lib/ppmdraw.h12
3 files changed, 52 insertions, 6 deletions
diff --git a/converter/other/svgtopam.c b/converter/other/svgtopam.c
index 5e276f6c..a97599cd 100644
--- a/converter/other/svgtopam.c
+++ b/converter/other/svgtopam.c
@@ -216,7 +216,16 @@ makePoint(uint const x,
     return p;
 }
 
+static ppmd_point
+makePpmdPoint(point const arg) {
 
+    ppmd_point p;
+
+    p.x = arg.x;
+    p.y = arg.y;
+
+    return p;
+}
 
 typedef enum {
     PATH_MOVETO,
@@ -448,12 +457,12 @@ outlineObject(path *           const pathP,
                     pm_message("Doing cubic spline to (%u, %u)",
                                dest.x, dest.y);
                 /* We need to write ppmd_spline4() */
-                ppmd_spline4(NULL, 0, 0, 0,
-                             currentPos.x, currentPos.y,
-                             ctl1.x, ctl1.y,
-                             ctl2.x, ctl2.y,
-                             dest.x, dest.y,
-                             ppmd_fill_drawproc, fillObjP);
+                ppmd_spline4p(NULL, 0, 0, 0,
+                              makePpmdPoint(currentPos),
+                              makePpmdPoint(dest),
+                              makePpmdPoint(ctl1),
+                              makePpmdPoint(ctl2),
+                              ppmd_fill_drawprocp, fillObjP);
                 currentPos = dest;
             } break;
             }
diff --git a/lib/libppmd.c b/lib/libppmd.c
index 3f86f5b6..89504c46 100644
--- a/lib/libppmd.c
+++ b/lib/libppmd.c
@@ -834,6 +834,31 @@ ppmd_polyspline(pixel **      const pixels,
 
 
 void
+ppmd_spline4p(pixel **       const pixels, 
+              unsigned int   const cols, 
+              unsigned int   const rows, 
+              pixval         const maxval, 
+              ppmd_point     const endPt0,
+              ppmd_point     const endPt1,
+              ppmd_point     const ctlPt0,
+              ppmd_point     const ctlPt1,
+              ppmd_drawprocp       drawproc,
+              const void *   const clientdata) {
+/*----------------------------------------------------------------------------
+   Draw a cubic spline from 'endPt0' to 'endPt1', using 'ctlPt0' and
+   'ctlPt1' as control points in the classic way: a line through
+   'endPt0' and 'ctlPt0' is tangent to the curve at 'entPt0' and the
+   length of that line controls "enthusiasm," whatever that is.
+   Same for 'endPt1' and 'ctlPt1'.
+-----------------------------------------------------------------------------*/
+
+    pm_error("ppmd_spline4p() has not been written yet!");
+
+}
+
+
+
+void
 ppmd_circlep(pixel **       const pixels, 
              unsigned int   const cols, 
              unsigned int   const rows, 
diff --git a/lib/ppmdraw.h b/lib/ppmdraw.h
index 080e4c62..d7a02e79 100644
--- a/lib/ppmdraw.h
+++ b/lib/ppmdraw.h
@@ -219,6 +219,18 @@ ppmd_polyspline(pixel **     const pixels,
                 const void * const clientdata);
 
 void
+ppmd_spline4p(pixel **       const pixels, 
+              unsigned int   const cols, 
+              unsigned int   const rows, 
+              pixval         const maxval, 
+              ppmd_point     const endPt0,
+              ppmd_point     const endPt1,
+              ppmd_point     const ctlPt0,
+              ppmd_point     const ctlPt1,
+              ppmd_drawprocp       drawproc,
+              const void *   const clientdata);
+
+void
 ppmd_circlep(pixel **       const pixels, 
              unsigned int   const cols, 
              unsigned int   const rows,