forked from francisengelmann/FabScan100
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfswebcam.h
52 lines (39 loc) · 1.23 KB
/
fswebcam.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* This class controls the webcam and provides functionality
* such as listing all available cams or grabbing images.
*/
#ifndef FSWEBCAM_H
#define FSWEBCAM_H
#include <QCamera>
#include <QCameraImageCapture>
#include "staticHeaders.h"
struct FSWebCamInfo
{
QString portName; //path to the webcam e.g. /dev/video0
QString friendlyName; //name of webcam that is displayed
int sizeX;
int sizeY;
};
class FSWebCam : public QObject
{
Q_OBJECT
public:
FSWebCamInfo info; //the string that identifies the camera, as selected in the menu
QCamera* camera; //new qt5 camera representative
QCameraImageCapture *imageCapture;
QImageEncoderSettings imageSettings;
cv::Mat frame;
bool frameTaken;
FSWebCam();
~FSWebCam();
//static QList<FSWebCamInfo> enumerate();
cv::Mat getFrame(); //grab frame from camera and return as cv::Mat
FSPoint getPosition(void); //geometric position of hardware webcam inside scanner
void setCamera(const QByteArray &cameraDevice);
private slots:
void processCapturedImage(int requestId, const QImage& img);
void imageSaved(int id, const QString &fileName);
private:
bool isCapturingImage;
};
#endif // FSWEBCAM_H