-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathworkmodule.h
91 lines (72 loc) · 2.12 KB
/
workmodule.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef WORKMODULE_H
#define WORKMODULE_H
#include <QCamera>
#include <memory>
#include <unistd.h>
#include <QDebug>
#include <QImage>
#include <QPixmap>
#include <QThread>
#include <QImageCapture>
#include <QMediaCaptureSession>
QT_BEGIN_NAMESPACE
class QMutex;
QT_END_NAMESPACE
class DriverManger;
class QMediaCaptureSession;
class ErollThread : public QObject
{
Q_OBJECT
public:
ErollThread(QObject *parent=nullptr);
Q_SIGNALS:
void processStatus(QString actionId, qint32 status, float *faceChara = nullptr, int size = 0);
public Q_SLOTS:
void Stop();
void Start(QString m_actionId, int socket);
protected:
void run();
void sendCapture(QImage &img);
private Q_SLOTS:
// void updateCameraState(QCamera::State state);
void readyForCapture(bool ready);
void captureError(int err, QImageCapture::Error, const QString &errorString);
void processCapturedImage(int id, const QImage &preview);
private:
QScopedPointer<QCamera> m_camera;
QScopedPointer<QImageCapture> m_imageCapture;
QScopedPointer<QMediaCaptureSession> m_captureSession;
QString m_actionId;
int m_fileSocket;
bool m_bFirst;
bool m_stopCapture;
bool m_checkDone;
};
class VerifyThread : public QObject
{
Q_OBJECT
public:
VerifyThread(QObject *parent=nullptr);
Q_SIGNALS:
void processStatus(QString actionId, qint32 status, float *faceChara = nullptr, int size = 0);
public Q_SLOTS:
void Stop();
void Start(QString m_actionId, QVector<float*> charas);
protected:
void run();
private Q_SLOTS:
// void updateCameraState(QCamera::State state);
void readyForCapture(bool ready);
void captureError(int err, QImageCapture::Error, const QString &errorString);
void processCapturedImage(int id, const QImage &preview);
private:
QScopedPointer<QCamera> m_camera;
QScopedPointer<QImageCapture> m_imageCapture;
QScopedPointer<QMediaCaptureSession> m_captureSession;
QString m_actionId;
QVector<float*> m_charaDatas;
};
#endif // WORKMODULE_H