1 | #ifndef DEF_CAMERA_VIEWER_COMPONENT_HPP
|
---|
2 | #define DEF_CAMERA_VIEWER_COMPONENT_HPP
|
---|
3 |
|
---|
4 |
|
---|
5 | // Includes, qt.
|
---|
6 | #include <QTimer>
|
---|
7 | #include <QObject>
|
---|
8 |
|
---|
9 | // Includes, pacpus.
|
---|
10 | #include <Pacpus/kernel/ComponentBase.h>
|
---|
11 | #include <Pacpus/kernel/DbiteFile.h>
|
---|
12 | #include <Pacpus/kernel/pacpus.h>
|
---|
13 |
|
---|
14 | // Includes, opencv.
|
---|
15 | #if (OPENCV_MAJOR == 3)
|
---|
16 | # include <opencv2/opencv.hpp>
|
---|
17 | # include <opencv2/highgui.hpp>
|
---|
18 | #else
|
---|
19 | # include <opencv/cv.h>
|
---|
20 | # include <opencv/highgui.h>
|
---|
21 | #endif
|
---|
22 |
|
---|
23 |
|
---|
24 | #ifdef WIN32
|
---|
25 | # ifdef CAMERA_VIEWER_COMPONENT_EXPORTS
|
---|
26 | # define CAMERA_VIEWER_COMPONENT_API __declspec(dllexport)
|
---|
27 | # else
|
---|
28 | # define CAMERA_VIEWER_COMPONENT_API __declspec(dllimport)
|
---|
29 | # endif
|
---|
30 | #else
|
---|
31 | # define CAMERA_VIEWER_COMPONENT_API
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | namespace pacpus
|
---|
35 | {
|
---|
36 | class CAMERA_VIEWER_COMPONENT_API CameraViewerComponent
|
---|
37 | : public QObject
|
---|
38 | , public ComponentBase
|
---|
39 | {
|
---|
40 | Q_OBJECT
|
---|
41 | public:
|
---|
42 |
|
---|
43 | //device(){}
|
---|
44 | /// Ctor of CameraViewerComponent.
|
---|
45 | //CameraViewerComponent(const QString& windowName, lib3dv::image::type::types imageType);
|
---|
46 |
|
---|
47 | CameraViewerComponent(QString const& name);
|
---|
48 |
|
---|
49 | /// Dtor of CameraViewerComponent
|
---|
50 | ~CameraViewerComponent();
|
---|
51 |
|
---|
52 | /// Stop the processing thread.
|
---|
53 | virtual void stopActivity();
|
---|
54 |
|
---|
55 | /// Start the processing thread.
|
---|
56 | virtual void startActivity();
|
---|
57 |
|
---|
58 | /// Configure the component.
|
---|
59 | virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
|
---|
60 | void process(cv::Mat const& frame);
|
---|
61 |
|
---|
62 | // Working thread, grabbing frame from a webcam.
|
---|
63 | DbiteFile mDBTFile;
|
---|
64 |
|
---|
65 | public:
|
---|
66 | virtual void addInputs();
|
---|
67 |
|
---|
68 | private:
|
---|
69 | std::string mOutputFileName;
|
---|
70 | Q_SIGNAL void doDisplay(cv::Mat const& frame);
|
---|
71 | Q_SLOT void DisplayFrame(cv::Mat const& frame);
|
---|
72 | };
|
---|
73 | }
|
---|
74 |
|
---|
75 | #endif
|
---|