]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/bezier.hh
release: 0.1.56
[lilypond.git] / lily / include / bezier.hh
1 /*
2   bezier.hh -- declare Bezier and Bezier_bow
3
4   (c) 1998 Jan Nieuwenhuizen <jan@digicash.com>
5 */
6
7 #ifndef BEZIER_HH
8 #define BEZIER_HH
9
10 #include "lily-proto.hh"
11 #include "real.hh"
12
13 /**
14   Simple bezier curve
15  */
16 class Bezier
17 {
18 public:
19   Bezier (int steps_i);
20   virtual ~Bezier ();
21
22   /**
23   Calculate bezier curve into Offset (x,y) array.
24   */
25   void calc (Offset control[4]);
26
27   /**
28   Return y that goes with x by interpolation.
29   */
30   Real y (Real x);
31
32   int steps_i_;
33   Offset* curve_;
34 };
35
36 /**
37   Implement bow specific bezier curve
38  */
39 class Bezier_bow : public Bezier
40 {
41 public:
42   Bezier_bow (Paper_def* paper_l);
43
44   /**
45    Calculate bezier curve for bow from bow parameters.
46    */
47   void calc (Real dx, Real dy, Real h, Real d);
48   Paper_def* paper_l_;
49 };
50
51
52 #endif // BEZIER_HH