-r prints the correct framerate now
[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,2002,2003 Matthias Kramm <kramm@quiss.org> 
7  
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
21
22 #ifndef __spline_h__
23 #define __spline_h__
24
25 struct plotxy
26 {
27     double x,y;
28 };
29
30 struct qspline
31 {
32     struct plotxy start;
33     struct plotxy control;
34     struct plotxy end;
35 };
36
37 struct cspline
38 {
39     struct plotxy start;
40     struct plotxy control1;
41     struct plotxy control2;
42     struct plotxy end;
43 };
44
45 typedef enum {APPROXIMATE_INFLECTION=0, APPROXIMATE_RECURSIVE_BINARY=1} approximate_method;
46
47 int approximate(struct plotxy p0, struct plotxy p1, struct plotxy p2, struct plotxy p3, struct qspline*q);
48
49 struct plotxy splinepos(struct plotxy p0, struct plotxy p1, struct plotxy p2, struct plotxy p3, double d);
50 double plotxy_dist(struct plotxy a, struct plotxy b);
51
52 plotxy cspline_getpoint(cspline*s, double t);
53 plotxy cspline_getderivative(cspline*s, double t);
54 plotxy cspline_getderivative2(cspline*s, double t);
55 plotxy cspline_getderivative3(cspline*s, double t);
56 void cspline_getequalspacedpoints(cspline*s, float**p, int*num, double dist);
57 int cspline_approximate(struct cspline*s, struct qspline*q, double quality, approximate_method method);
58
59 plotxy qspline_getpoint(qspline*s, double t);
60 plotxy qspline_getderivative(qspline*s, double t);
61 plotxy qspline_getderivative2(qspline*s, double t);
62 double qspline_getlength(qspline*s);
63 void qsplines_getequalspacedpoints(qspline**s, int num, float**p, int*pnum, double t);
64
65 #endif// __spline_h__