summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_aruco/ar_video_widget.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-10-22 02:33:11 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-10-22 02:33:30 +0200
commitd7d733131d62777481c9a72fee9005dd58cf0c74 (patch)
tree4bb353829d02eb1da09cc35c857bf4cf063d446c /ftnoir_tracker_aruco/ar_video_widget.h
parent5bf0964212f2210e9a454e1bcf24b1f96b479922 (diff)
Optimize widget redraw
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
Diffstat (limited to 'ftnoir_tracker_aruco/ar_video_widget.h')
-rw-r--r--ftnoir_tracker_aruco/ar_video_widget.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/ftnoir_tracker_aruco/ar_video_widget.h b/ftnoir_tracker_aruco/ar_video_widget.h
index dd0c16ac..3a1574cd 100644
--- a/ftnoir_tracker_aruco/ar_video_widget.h
+++ b/ftnoir_tracker_aruco/ar_video_widget.h
@@ -15,6 +15,7 @@
#include <QLabel>
#include <QPainter>
#include <QPaintEvent>
+#include <QTimer>
// ----------------------------------------------------------------------------
class ArucoVideoWidget : public QWidget
@@ -22,7 +23,9 @@ class ArucoVideoWidget : public QWidget
Q_OBJECT
public:
- ArucoVideoWidget(QWidget *parent) : QWidget(parent), mtx() {
+ ArucoVideoWidget(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:
@@ -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