File indexing completed on 2024-12-22 04:12:57

0001 /*
0002  *  SPDX-FileCopyrightText: 2017 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KISSTROKEEFFICIENCYMEASURER_H
0008 #define KISSTROKEEFFICIENCYMEASURER_H
0009 
0010 #include "kritaui_export.h"
0011 #include <QScopedPointer>
0012 
0013 #include <QtGlobal>
0014 
0015 class QPointF;
0016 
0017 class KRITAUI_EXPORT KisStrokeEfficiencyMeasurer
0018 {
0019 public:
0020     KisStrokeEfficiencyMeasurer();
0021     ~KisStrokeEfficiencyMeasurer();
0022 
0023     void setEnabled(bool value);
0024     bool isEnabled() const;
0025 
0026     void addSample(const QPointF &pt);
0027     void addSamples(const QVector<QPointF> &points);
0028 
0029     qreal averageCursorSpeed() const;
0030     qreal averageRenderingSpeed() const;
0031     qreal averageFps() const;
0032 
0033     void notifyRenderingStarted();
0034     void notifyRenderingFinished();
0035 
0036     void notifyCursorMoveStarted();
0037     void notifyCursorMoveFinished();
0038 
0039     void notifyFrameRenderingStarted();
0040 
0041     void reset();
0042 
0043 private:
0044     struct Private;
0045     const QScopedPointer<Private> m_d;
0046 };
0047 
0048 #endif // KISSTROKEEFFICIENCYMEASURER_H