diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-21 14:31:31 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-23 11:05:33 +0200 |
commit | 42c687b8adb54d3c446483ad085b06d2caf0f1c8 (patch) | |
tree | 115ed3e86f73a7fd718da1dfc25778b3af28f8b0 /tracker-aruco/pt_video_widget.h | |
parent | 72f7a1b07d393e6cfdbac1ecb168a703919fd03e (diff) |
tracker/{aruco,pt}: only check window visibility once every two seconds
The check is becoming more expensive with more positions checked.
Diffstat (limited to 'tracker-aruco/pt_video_widget.h')
-rw-r--r-- | tracker-aruco/pt_video_widget.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tracker-aruco/pt_video_widget.h b/tracker-aruco/pt_video_widget.h index c2957876..82de3eab 100644 --- a/tracker-aruco/pt_video_widget.h +++ b/tracker-aruco/pt_video_widget.h @@ -8,10 +8,11 @@ #pragma once -#include <QObject> -#include <QWidget> +#include "opentrack-compat/timer.hpp" #include <opencv2/core/core.hpp> #include <memory> +#include <QObject> +#include <QWidget> #include <QPainter> #include <QPaintEvent> #include <QTimer> @@ -22,17 +23,17 @@ class PTVideoWidget final : public QWidget { Q_OBJECT - public: PTVideoWidget(QWidget *parent); void update_image(const cv::Mat &frame); protected slots: - void paintEvent(QPaintEvent* e) override; + void paintEvent(QPaintEvent*) override; void update_and_repaint(); private: QMutex mtx; QImage texture; QTimer timer; + Timer window_check_timer; cv::Mat _frame, _frame2, _frame3; - bool freshp; + bool freshp, visible; }; |