Debian Codegraph @

libs/image/brushengine/KisStrokeSpeedMeasurer.h

raw symbols SCIP
1 /*
2 * SPDX-FileCopyrightText: 2017 Dmitry Kazakov <[email protected]>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #ifndef KISSTROKESPEEDMEASURER_H
8 #define KISSTROKESPEEDMEASURER_H
9
10 #include "kritaimage_export.h"
11 #include <QScopedPointer>
12
13 #include <QtGlobal>
14
15 class QPointF;
16
17
18 class KRITAIMAGE_EXPORT KisStrokeSpeedMeasurer
19 {
20 public:
21 KisStrokeSpeedMeasurer(int timeSmoothWindow);
22 ~KisStrokeSpeedMeasurer();
23
24 void addSample(const QPointF &pt, int time);
25 void addSamples(const QVector<QPointF> &points, int time);
26
27 qreal averageSpeed() const;
28 qreal currentSpeed() const;
29 qreal maxSpeed() const;
30
31 void reset();
32
33 private:
34 void sampleMaxSpeed();
35
36 private:
37 struct Private;
38 const QScopedPointer<Private> m_d;
39 };
40
41 #endif // KISSTROKESPEEDMEASURER_H