Ardour  8.7-15-gadf511264b
curve.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2014 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2014 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __CANVAS_CURVE_H__
21 #define __CANVAS_CURVE_H__
22 
23 #include "canvas/visibility.h"
24 
26 #include "canvas/poly_item.h"
27 #include "canvas/fill.h"
28 
29 namespace ArdourCanvas {
30 
31 class XFadeCurve;
32 
34 {
35  public:
37  Curve (Item*);
38 
39  enum CurveFill {
43  };
44 
45  void compute_bounding_box () const;
46  void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
47  void set (Points const &);
48 
49  void set_points_per_segment (uint32_t n);
50 
51  bool covers (Duple const &) const;
52  void set_fill_mode (CurveFill cf) { curve_fill = cf; }
53 
54  private:
56  Points::size_type n_samples;
59 
60  void interpolate ();
61 };
62 
63 }
64 
65 #endif
#define LIBCANVAS_API
void render(Rect const &area, Cairo::RefPtr< Cairo::Context >) const
Points samples
Definition: curve.h:55
CurveFill curve_fill
Definition: curve.h:58
void set_fill_mode(CurveFill cf)
Definition: curve.h:52
void compute_bounding_box() const
uint32_t points_per_segment
Definition: curve.h:57
Points::size_type n_samples
Definition: curve.h:56
void set_points_per_segment(uint32_t n)
bool covers(Duple const &) const
void set(Points const &)
std::vector< Duple > Points