#ifndef OCR_H
#define OCR_H

#include <QObject>
#include <QVector>
#include <QString>

enum EngineType { KySDK = 0, Others = 1 };

class OCR : public QObject
{
    Q_OBJECT
public:
    OCR();
    virtual ~OCR() {}
    virtual void getText(QString) = 0;
    //接口暂未启用,先注释掉
    //    virtual void getRect(QString);
Q_SIGNALS:
    void recResult(QString, QVector<QString>);

private:
    OCR *m_ocr = nullptr;
};
class OcrFunction : public QObject
{
    Q_OBJECT
public:
    OcrFunction();
    ~OcrFunction();
    void setEngineType(EngineType type = EngineType::KySDK);
    void getText(QString imgPath);

private:
    OCR *m_ocr = nullptr;
    QThread *m_thread = nullptr;
    EngineType m_type;
Q_SIGNALS:
    void recResult(QString, QVector<QString>);
    void realGetText(QString);
};
#endif // OCR_H
