diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-09-15 12:39:32 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-09-15 12:39:32 +0200 |
commit | bef7aff31e5ea073f0f160ca6a2f1e56b7dd881a (patch) | |
tree | 2f6122f682427322f925736e87a0bd68b658972c /FTNoIR_Tracker_PT/video_widget.h | |
parent | 3734ab61a6f0d4d8aad32a17a2eb5fc49245626e (diff) |
Initial PT 1.1 import
Codebase broken at this stage
Diffstat (limited to 'FTNoIR_Tracker_PT/video_widget.h')
-rw-r--r-- | FTNoIR_Tracker_PT/video_widget.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/FTNoIR_Tracker_PT/video_widget.h b/FTNoIR_Tracker_PT/video_widget.h new file mode 100644 index 00000000..dd5fb642 --- /dev/null +++ b/FTNoIR_Tracker_PT/video_widget.h @@ -0,0 +1,58 @@ +/* Copyright (c) 2012 Patrick Ruoff
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ */
+
+#ifndef VIDEOWIDGET_H
+#define VIDEOWIDGET_H
+
+#include "frame_observer.h"
+
+#include <QGLWidget>
+#include <QTime>
+#include <QDialog>
+#include <opencv2/opencv.hpp>
+#include <boost/shared_ptr.hpp>
+
+// ----------------------------------------------------------------------------
+// OpenGL based widget to display an OpenCV image with some points on top
+class VideoWidget : public QGLWidget, public FrameObserver
+{
+ Q_OBJECT
+
+public:
+ VideoWidget(QWidget *parent, FrameProvider* provider) : QGLWidget(parent), FrameObserver(provider) {}
+
+ virtual void initializeGL();
+ virtual void resizeGL(int w, int h);
+ virtual void paintGL();
+
+ void update_frame_and_points();
+
+private:
+ void resize_frame();
+
+ cv::Mat frame;
+ QImage qframe;
+ QImage resized_qframe;
+
+ boost::shared_ptr< std::vector<cv::Vec2f> > points;
+};
+
+// ----------------------------------------------------------------------------
+// A VideoWidget embedded in a dialog frame
+class VideoWidgetDialog : public QDialog
+{
+public:
+ VideoWidgetDialog(QWidget *parent, FrameProvider* provider);
+ virtual ~VideoWidgetDialog() {}
+
+ VideoWidget* get_video_widget() { return video_widget; }
+
+private:
+ VideoWidget* video_widget;
+};
+
+#endif // VIDEOWIDGET_H
|