diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-22 02:40:02 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-22 02:40:02 +0200 |
commit | 8503f538d18f8df0f18ee4973e96f3889a11419a (patch) | |
tree | cc7c65a8911ed7f897070d9c9898506c9a414a74 /ftnoir_tracker_ht/ht_video_widget.h | |
parent | d7d733131d62777481c9a72fee9005dd58cf0c74 (diff) |
optimize HT widget refresh
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
Diffstat (limited to 'ftnoir_tracker_ht/ht_video_widget.h')
-rw-r--r-- | ftnoir_tracker_ht/ht_video_widget.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ftnoir_tracker_ht/ht_video_widget.h b/ftnoir_tracker_ht/ht_video_widget.h index b1182d8b..78000afa 100644 --- a/ftnoir_tracker_ht/ht_video_widget.h +++ b/ftnoir_tracker_ht/ht_video_widget.h @@ -15,15 +15,18 @@ #include <QLabel> #include <QPainter> #include <QPaintEvent> +#include <QTimer> // ---------------------------------------------------------------------------- class HTVideoWidget : public QWidget { - Q_OBJECT + Q_OBJECT public: - HTVideoWidget(QWidget *parent) : QWidget(parent), mtx() { - } + HTVideoWidget(QWidget *parent) : QWidget(parent), width(0), height(0), fb{0} { + connect(&timer, SIGNAL(timeout()), this, SLOT(update_and_repaint())); + timer.start(60); + } void update_image(unsigned char* frame, int width, int height); protected slots: void paintEvent( QPaintEvent* e ) { @@ -31,9 +34,14 @@ protected slots: QPainter painter(this); painter.drawPixmap(e->rect(), pixmap, e->rect()); } + void update_and_repaint(); + private: QMutex mtx; QPixmap pixmap; + QTimer timer; + char fb[2048*2048*3]; + int width,height; }; #endif // VIDEOWIDGET_H |