Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/tool/kis_stabilized_events_sampler.h
Show All 15 Lines | |||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #ifndef __KIS_STABILIZED_EVENTS_SAMPLER_H | 19 | #ifndef __KIS_STABILIZED_EVENTS_SAMPLER_H | ||
20 | #define __KIS_STABILIZED_EVENTS_SAMPLER_H | 20 | #define __KIS_STABILIZED_EVENTS_SAMPLER_H | ||
21 | 21 | | |||
22 | #include <QScopedPointer> | 22 | #include <QScopedPointer> | ||
23 | 23 | | |||
24 | #include <functional> | | |||
25 | #include <boost/iterator/iterator_facade.hpp> | 24 | #include <boost/iterator/iterator_facade.hpp> | ||
26 | 25 | | |||
27 | #include "kritaui_export.h" | 26 | #include "kritaui_export.h" | ||
28 | 27 | | |||
29 | class KisPaintInformation; | 28 | class KisPaintInformation; | ||
30 | #include <kis_paint_information.h> | 29 | #include <kis_paint_information.h> | ||
31 | 30 | | |||
32 | 31 | | |||
33 | class KRITAUI_EXPORT KisStabilizedEventsSampler | 32 | class KRITAUI_EXPORT KisStabilizedEventsSampler | ||
34 | { | 33 | { | ||
35 | public: | 34 | public: | ||
36 | KisStabilizedEventsSampler(int sampleTime = 1); | 35 | KisStabilizedEventsSampler(int sampleTime = 1); | ||
37 | ~KisStabilizedEventsSampler(); | 36 | ~KisStabilizedEventsSampler(); | ||
38 | 37 | | |||
39 | void setLineFunction(std::function<void(const KisPaintInformation &)> func); | | |||
40 | | ||||
41 | void clear(); | 38 | void clear(); | ||
42 | void addEvent(const KisPaintInformation &pi); | 39 | void addEvent(const KisPaintInformation &pi); | ||
43 | void addFinishingEvent(int numSamples); | 40 | void addFinishingEvent(int numSamples); | ||
44 | void processAllEvents(); | | |||
45 | 41 | | |||
46 | public: | 42 | public: | ||
47 | class iterator : | 43 | class iterator : | ||
48 | public boost::iterator_facade <iterator, | 44 | public boost::iterator_facade <iterator, | ||
49 | KisPaintInformation const, | 45 | KisPaintInformation const, | ||
50 | boost::forward_traversal_tag > | 46 | boost::forward_traversal_tag > | ||
51 | { | 47 | { | ||
52 | public: | 48 | public: | ||
Show All 39 Lines |