#ifndef CINPROGRESSFACE_H
#define CINPROGRESSFACE_H

#include <QObject>
#include "CHttpBll.h"
#include <opencv2/opencv.hpp>
#include <thread>
#include <mutex>

class CInprogressFace : public QObject
{
    Q_OBJECT

signals:
    void compareFailed(QString sErrorMsg);
public:
    CInprogressFace();
    ~CInprogressFace();

    void startFaceVerify(bool bVerify);
    void addImage(cv::Mat matImage);

    void uploadFile(cv::Mat faceMat, int nFaceCount, float fScore, int nRealness);
private slots:
    void onProcessUpload(CProcessUpload processUpload); //文件上传
    void onSaveFaceCaptureResult(CBaseResponsePackage res);//保存人脸抓拍比对验证结果
private:
    std::thread m_thread;
    bool m_bIsRun;

    void threadProc();

    std::mutex m_mImgList;
    std::list<cv::Mat> m_vImgList;

    bool m_bStart;
};

extern std::shared_ptr<CInprogressFace> g_inProcessFace;

#endif // CINPROGRESSFACE_H
