X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fspline.h;h=5c4d4eb5ee56344d8d039a3651440530b90cab62;hb=d9872c4e9c1c252d74d380d114eeb769c043e013;hp=f9549cc64ed61af701bdc9f0f402a1dc6f6cc456;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/pdf2swf/spline.h b/pdf2swf/spline.h index f9549cc..5c4d4eb 100644 --- a/pdf2swf/spline.h +++ b/pdf2swf/spline.h @@ -3,9 +3,21 @@ Part of the swftools package. - Copyright (c) 2001 Matthias Kramm + Copyright (c) 2001,2002,2003 Matthias Kramm + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. - This file is distributed under the GPL, see file COPYING for details */ + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __spline_h__ #define __spline_h__ @@ -30,7 +42,24 @@ struct cspline struct plotxy end; }; -int approximate(struct plotxy p0, struct plotxy p1, - struct plotxy p2, struct plotxy p3, struct qspline*q); +typedef enum {APPROXIMATE_INFLECTION=0, APPROXIMATE_RECURSIVE_BINARY=1} approximate_method; + +int approximate(struct plotxy p0, struct plotxy p1, struct plotxy p2, struct plotxy p3, struct qspline*q); + +struct plotxy splinepos(struct plotxy p0, struct plotxy p1, struct plotxy p2, struct plotxy p3, double d); +double plotxy_dist(struct plotxy a, struct plotxy b); + +plotxy cspline_getpoint(cspline*s, double t); +plotxy cspline_getderivative(cspline*s, double t); +plotxy cspline_getderivative2(cspline*s, double t); +plotxy cspline_getderivative3(cspline*s, double t); +void cspline_getequalspacedpoints(cspline*s, float**p, int*num, double dist); +int cspline_approximate(struct cspline*s, struct qspline*q, double quality, approximate_method method); + +plotxy qspline_getpoint(qspline*s, double t); +plotxy qspline_getderivative(qspline*s, double t); +plotxy qspline_getderivative2(qspline*s, double t); +double qspline_getlength(qspline*s); +void qsplines_getequalspacedpoints(qspline**s, int num, float**p, int*pnum, double t); #endif// __spline_h__