Krita Source Code Documentation
Loading...
Searching...
No Matches
KisStrokeSpeedMeasurer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Dmitry Kazakov <dimula73@gmail.com>
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
15class QPointF;
16
17
18class KRITAIMAGE_EXPORT KisStrokeSpeedMeasurer
19{
20public:
21 KisStrokeSpeedMeasurer(int timeSmoothWindow);
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
33private:
34 void sampleMaxSpeed();
35
36private:
37 struct Private;
38 const QScopedPointer<Private> m_d;
39};
40
41#endif // KISSTROKESPEEDMEASURER_H
const QScopedPointer< Private > m_d