new algorithm
[swftools.git] / pdf2swf / spline.h
index f9549cc..609a7bd 100644 (file)
@@ -30,7 +30,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__