X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fcanvas%2Fcanvas%2Fcurve.h;h=fad1119b39b6479118d7641b5f5b841fa9b2fbec;hb=d92686afb4105b84b014372b6feb0ccc454a5171;hp=f2ed6a1d0eabb4e75f18d126a3f3774a1b9d5bb6;hpb=e5888d398350b26ba2cdc634cc9791e90b4fc6b6;p=ardour.git diff --git a/libs/canvas/canvas/curve.h b/libs/canvas/canvas/curve.h index f2ed6a1d0e..fad1119b39 100644 --- a/libs/canvas/canvas/curve.h +++ b/libs/canvas/canvas/curve.h @@ -19,35 +19,46 @@ #ifndef __CANVAS_CURVE_H__ #define __CANVAS_CURVE_H__ +#include "canvas/visibility.h" + +#include "canvas/interpolated_curve.h" #include "canvas/poly_item.h" +#include "canvas/fill.h" namespace ArdourCanvas { -class Curve : public PolyItem +class XFadeCurve; + +class LIBCANVAS_API Curve : public PolyItem, public InterpolatedCurve { -public: - Curve (Group *); - - void compute_bounding_box () const; + public: + Curve (Canvas*); + Curve (Item*); - void render (Rect const & area, Cairo::RefPtr) const; + enum CurveFill { + None, + Inside, + Outside, + }; + void compute_bounding_box () const; + void render (Rect const & area, Cairo::RefPtr) const; void set (Points const &); - protected: - void render_path (Rect const &, Cairo::RefPtr) const; - void render_curve (Rect const &, Cairo::RefPtr) const; - + void set_points_per_segment (uint32_t n); + + bool covers (Duple const &) const; + void set_fill_mode (CurveFill cf) { curve_fill = cf; } + private: - Points first_control_points; - Points second_control_points; + Points samples; + Points::size_type n_samples; + uint32_t points_per_segment; + CurveFill curve_fill; - - static void compute_control_points (Points const &, - Points&, Points&); - static double* solve (std::vector const&); + void interpolate (); }; - + } #endif