Debian Codegraph @

src/ApvlvOCR.h

raw
1 /*
2 * This file is part of the apvlv package
3 *
4 * Copyright (C) 2008 Alf.
5 *
6 * Contact: Alf <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2.0 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 *
22 */
23 /* @CPPFILE ApvlvOCR.h
24 *
25 * Author: Alf <[email protected]>
26 */
27
28 #ifndef _APVLV_OCR_H_
29 #define _APVLV_OCR_H_
30
31 #include <QPixmap>
32 #include <QRect>
33 #include <memory>
34 #include <tesseract/capi.h>
35 #include <vector>
36
37 namespace apvlv
38 {
39
40 using TextAreaVector = std::vector<QRect>;
41
42 class OCR final
43 {
44 public:
45 OCR ();
46 ~OCR ();
47
48 std::unique_ptr<TextAreaVector> getTextArea (const QPixmap &pixmap);
49 std::unique_ptr<char> getTextFromPixmap (const QPixmap &pixmap,
50 QRect area = QRect ());
51
52 private:
53 TessBaseAPI mTessBaseAPI;
54 };
55
56 }
57
58 #endif