fix for t1lib-5.0.0
[swftools.git] / pdf2swf / spline.h
1 /* spline.h
2    Header file for spline.cc
3
4    Part of the swftools package.
5
6    Copyright (c) 2001 Matthias Kramm <kramm@quiss.org> 
7
8    This file is distributed under the GPL, see file COPYING for details */
9
10 #ifndef __spline_h__
11 #define __spline_h__
12
13 struct plotxy
14 {
15     double x,y;
16 };
17
18 struct qspline
19 {
20     struct plotxy start;
21     struct plotxy control;
22     struct plotxy end;
23 };
24
25 struct cspline
26 {
27     struct plotxy start;
28     struct plotxy control1;
29     struct plotxy control2;
30     struct plotxy end;
31 };
32
33 typedef enum {APPROXIMATE_INFLECTION=0, APPROXIMATE_RECURSIVE_BINARY=1} approximate_method;
34
35 int approximate(struct plotxy p0, struct plotxy p1, struct plotxy p2, struct plotxy p3, struct qspline*q);
36
37 struct plotxy splinepos(struct plotxy p0, struct plotxy p1, struct plotxy p2, struct plotxy p3, double d);
38 double plotxy_dist(struct plotxy a, struct plotxy b);
39
40 plotxy cspline_getpoint(cspline*s, double t);
41 plotxy cspline_getderivative(cspline*s, double t);
42 plotxy cspline_getderivative2(cspline*s, double t);
43 plotxy cspline_getderivative3(cspline*s, double t);
44 void cspline_getequalspacedpoints(cspline*s, float**p, int*num, double dist);
45 int cspline_approximate(struct cspline*s, struct qspline*q, double quality, approximate_method method);
46
47 plotxy qspline_getpoint(qspline*s, double t);
48 plotxy qspline_getderivative(qspline*s, double t);
49 plotxy qspline_getderivative2(qspline*s, double t);
50 double qspline_getlength(qspline*s);
51 void qsplines_getequalspacedpoints(qspline**s, int num, float**p, int*pnum, double t);
52
53 #endif// __spline_h__