From d5dc5396c5f2700810a591a8359c5415923b308a Mon Sep 17 00:00:00 2001 From: giraffedata Date: Fri, 26 Jun 2009 01:58:55 +0000 Subject: Put back 4-point spline stub, used by Svgtopam git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@936 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/svgtopam.c | 21 +++++++++++++++------ lib/libppmd.c | 25 +++++++++++++++++++++++++ lib/ppmdraw.h | 12 ++++++++++++ 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 @@ -833,6 +833,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, diff --git a/lib/ppmdraw.h b/lib/ppmdraw.h index 080e4c62..d7a02e79 100644 --- a/lib/ppmdraw.h +++ b/lib/ppmdraw.h @@ -218,6 +218,18 @@ ppmd_polyspline(pixel ** const pixels, ppmd_drawproc drawProc, 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, -- cgit 1.4.1