File indexing completed on 2024-03-24 05:57:08
0001 /** 0002 * SPDX-FileCopyrightText: 2022 by Alexander Stippich <a.stippich@gmx.net> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #ifndef OCR_ENGINE_H 0008 #define OCR_ENGINE_H 0009 0010 #include "SkanpageUtils.h" 0011 0012 #include <QObject> 0013 #include <QPainter> 0014 0015 #include <memory> 0016 0017 class OCREnginePrivate; 0018 class QPdfWriter; 0019 class OCRLanguageModel; 0020 0021 class OCREngine : public QObject 0022 { 0023 public: 0024 explicit OCREngine(QObject *parent = nullptr); 0025 ~OCREngine(); 0026 0027 void InitForOCR(); 0028 0029 bool available() const; 0030 0031 OCRLanguageModel *languages() const; 0032 0033 void OCRPage(QPdfWriter &writer, QPainter &painter, const SkanpageUtils::PageProperties &page); 0034 0035 void setColor(QColor color); 0036 0037 private: 0038 std::unique_ptr<OCREnginePrivate> d; 0039 }; 0040 0041 #endif // #define OCR_ENGINE_H