diff options
Diffstat (limited to 'libs/canvas/canvas/curve.h')
-rw-r--r-- | libs/canvas/canvas/curve.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libs/canvas/canvas/curve.h b/libs/canvas/canvas/curve.h new file mode 100644 index 0000000000..733808dc14 --- /dev/null +++ b/libs/canvas/canvas/curve.h @@ -0,0 +1,37 @@ +#ifndef __CANVAS_CURVE_H__ +#define __CANVAS_CURVE_H__ + +#include "canvas/poly_item.h" + +namespace ArdourCanvas { + +class Curve : public PolyItem +{ +public: + Curve (Group *); + + void compute_bounding_box () const; + + void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const; + XMLNode* get_state () const; + void set_state (XMLNode const *); + + void set (Points const &); + + protected: + void render_path (Rect const &, Cairo::RefPtr<Cairo::Context>) const; + void render_curve (Rect const &, Cairo::RefPtr<Cairo::Context>) const; + + private: + Points first_control_points; + Points second_control_points; + + + static void compute_control_points (Points const &, + Points&, Points&); + static double* solve (std::vector<double> const&); +}; + +} + +#endif |