tesseract  4.0.0-1-g2a2b
capi.h
Go to the documentation of this file.
1 // File: capi.h
3 // Description: C-API TessBaseAPI
4 //
5 // (C) Copyright 2012, Google Inc.
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
17 
18 #ifndef API_CAPI_H_
19 #define API_CAPI_H_
20 
21 #if defined(TESSERACT_API_BASEAPI_H_) && !defined(TESS_CAPI_INCLUDE_BASEAPI)
22 # define TESS_CAPI_INCLUDE_BASEAPI
23 #endif
24 
25 #ifdef TESS_CAPI_INCLUDE_BASEAPI
26 # include "baseapi.h"
27 # include "ocrclass.h"
28 # include "pageiterator.h"
29 # include "resultiterator.h"
30 # include "renderer.h"
31 #else
32 # include "platform.h"
33 # include <stdbool.h>
34 # include <stdio.h>
35 #endif
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 #ifndef TESS_CALL
42 # if defined(WIN32)
43 # define TESS_CALL __cdecl
44 # else
45 # define TESS_CALL
46 # endif
47 #endif
48 
49 #ifndef BOOL
50 # define BOOL int
51 # define TRUE 1
52 # define FALSE 0
53 #endif
54 
55 #ifdef TESS_CAPI_INCLUDE_BASEAPI
69 typedef tesseract::ImageThresholder TessImageThresholder;
71 typedef tesseract::DictFunc TessDictFunc;
72 typedef tesseract::ProbabilityInContextFunc TessProbabilityInContextFunc;
73 // typedef tesseract::ParamsModelClassifyFunc TessParamsModelClassifyFunc;
74 typedef tesseract::FillLatticeFunc TessFillLatticeFunc;
75 typedef tesseract::Dawg TessDawg;
76 typedef tesseract::TruthCallback TessTruthCallback;
82 #else
89 typedef struct TessBaseAPI TessBaseAPI;
106 typedef struct ETEXT_DESC ETEXT_DESC;
107 #endif
108 
109 typedef bool (*TessCancelFunc)(void* cancel_this, int words);
110 typedef bool (*TessProgressFunc)(ETEXT_DESC* ths, int left, int right, int top,
111  int bottom);
112 
113 struct Pix;
114 struct Boxa;
115 struct Pixa;
116 
117 /* General free functions */
118 
119 TESS_API const char*
121 TESS_API void TESS_CALL TessDeleteText(char* text);
122 TESS_API void TESS_CALL TessDeleteTextArray(char** arr);
123 TESS_API void TESS_CALL TessDeleteIntArray(int* arr);
124 
125 /* Renderer API */
128 TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate2(const char* outputbase, BOOL font_info);
129 TESS_API TessResultRenderer* TESS_CALL TessPDFRendererCreate(const char* outputbase, const char* datadir,
130  BOOL textonly);
133 
141 
145 
146 /* Base API */
147 
151 
152 TESS_API size_t TESS_CALL TessBaseAPIGetOpenCLDevice(TessBaseAPI* handle, void **device);
153 
154 TESS_API void TESS_CALL TessBaseAPISetInputName(TessBaseAPI* handle, const char* name);
156 
157 TESS_API void TESS_CALL TessBaseAPISetInputImage(TessBaseAPI* handle, struct Pix* pix);
159 
162 
163 TESS_API void TESS_CALL TessBaseAPISetOutputName(TessBaseAPI* handle, const char* name);
164 
165 TESS_API BOOL TESS_CALL TessBaseAPISetVariable(TessBaseAPI* handle, const char* name, const char* value);
166 TESS_API BOOL TESS_CALL TessBaseAPISetDebugVariable(TessBaseAPI* handle, const char* name, const char* value);
167 
168 TESS_API BOOL TESS_CALL TessBaseAPIGetIntVariable(const TessBaseAPI* handle, const char* name, int* value);
169 TESS_API BOOL TESS_CALL TessBaseAPIGetBoolVariable(const TessBaseAPI* handle, const char* name, BOOL* value);
170 TESS_API BOOL TESS_CALL TessBaseAPIGetDoubleVariable(const TessBaseAPI* handle, const char* name, double* value);
171 TESS_API const char*
172  TESS_CALL TessBaseAPIGetStringVariable(const TessBaseAPI* handle, const char* name);
173 
174 TESS_API void TESS_CALL TessBaseAPIPrintVariables(const TessBaseAPI* handle, FILE* fp);
175 TESS_API BOOL TESS_CALL TessBaseAPIPrintVariablesToFile(const TessBaseAPI* handle, const char* filename);
176 
177 #ifdef TESS_CAPI_INCLUDE_BASEAPI
178 
180 
181 TESS_API int TESS_CALL TessBaseAPIInit(TessBaseAPI* handle, const char* datapath, const char* language,
182  TessOcrEngineMode mode, char** configs, int configs_size,
183  const STRING* vars_vec, size_t vars_vec_size,
184  const STRING* vars_values, size_t vars_values_size, BOOL set_only_init_params);
185 
186 #endif // def TESS_CAPI_INCLUDE_BASEAPI
187 
188 TESS_API int TESS_CALL TessBaseAPIInit1(TessBaseAPI* handle, const char* datapath, const char* language, TessOcrEngineMode oem,
189  char** configs, int configs_size);
190 TESS_API int TESS_CALL TessBaseAPIInit2(TessBaseAPI* handle, const char* datapath, const char* language, TessOcrEngineMode oem);
191 TESS_API int TESS_CALL TessBaseAPIInit3(TessBaseAPI* handle, const char* datapath, const char* language);
192 
193 TESS_API int TESS_CALL TessBaseAPIInit4(TessBaseAPI* handle, const char* datapath, const char* language, TessOcrEngineMode mode,
194  char** configs, int configs_size,
195  char** vars_vec, char** vars_values, size_t vars_vec_size,
196  BOOL set_only_non_debug_params);
197 
198 TESS_API const char*
200 TESS_API char**
202 TESS_API char**
204 
205 TESS_API int TESS_CALL TessBaseAPIInitLangMod(TessBaseAPI* handle, const char* datapath, const char* language);
207 
208 TESS_API void TESS_CALL TessBaseAPIReadConfigFile(TessBaseAPI* handle, const char* filename);
209 TESS_API void TESS_CALL TessBaseAPIReadDebugConfigFile(TessBaseAPI* handle, const char* filename);
210 
214 
215 TESS_API char* TESS_CALL TessBaseAPIRect(TessBaseAPI* handle, const unsigned char* imagedata,
216  int bytes_per_pixel, int bytes_per_line,
217  int left, int top, int width, int height);
218 
220 
221 TESS_API void TESS_CALL TessBaseAPISetImage(TessBaseAPI* handle, const unsigned char* imagedata, int width, int height,
222  int bytes_per_pixel, int bytes_per_line);
223 TESS_API void TESS_CALL TessBaseAPISetImage2(TessBaseAPI* handle, struct Pix* pix);
224 
226 
227 TESS_API void TESS_CALL TessBaseAPISetRectangle(TessBaseAPI* handle, int left, int top, int width, int height);
228 
229 #ifdef TESS_CAPI_INCLUDE_BASEAPI
230 TESS_API void TESS_CALL TessBaseAPISetThresholder(TessBaseAPI* handle, TessImageThresholder* thresholder);
231 #endif
232 
233 TESS_API struct Pix*
235 TESS_API struct Boxa*
236  TESS_CALL TessBaseAPIGetRegions(TessBaseAPI* handle, struct Pixa** pixa);
237 TESS_API struct Boxa*
238  TESS_CALL TessBaseAPIGetTextlines(TessBaseAPI* handle, struct Pixa** pixa, int** blockids);
239 TESS_API struct Boxa*
240  TESS_CALL TessBaseAPIGetTextlines1(TessBaseAPI* handle, const BOOL raw_image, const int raw_padding,
241  struct Pixa** pixa, int** blockids, int** paraids);
242 TESS_API struct Boxa*
243  TESS_CALL TessBaseAPIGetStrips(TessBaseAPI* handle, struct Pixa** pixa, int** blockids);
244 TESS_API struct Boxa*
245  TESS_CALL TessBaseAPIGetWords(TessBaseAPI* handle, struct Pixa** pixa);
246 TESS_API struct Boxa*
247  TESS_CALL TessBaseAPIGetConnectedComponents(TessBaseAPI* handle, struct Pixa** cc);
248 TESS_API struct Boxa*
249  TESS_CALL TessBaseAPIGetComponentImages(TessBaseAPI* handle, const TessPageIteratorLevel level, const BOOL text_only,
250  struct Pixa** pixa, int** blockids);
251 TESS_API struct Boxa*
252  TESS_CALL TessBaseAPIGetComponentImages1(TessBaseAPI* handle, const TessPageIteratorLevel level, const BOOL text_only,
253  const BOOL raw_image, const int raw_padding,
254  struct Pixa** pixa, int** blockids, int** paraids);
255 
257 
260 
262 
263 #ifndef DISABLED_LEGACY_ENGINE
265 #endif
266 
267 TESS_API BOOL TESS_CALL TessBaseAPIProcessPages(TessBaseAPI* handle, const char* filename, const char* retry_config,
268  int timeout_millisec, TessResultRenderer* renderer);
269 TESS_API BOOL TESS_CALL TessBaseAPIProcessPage(TessBaseAPI* handle, struct Pix* pix, int page_index, const char* filename,
270  const char* retry_config, int timeout_millisec, TessResultRenderer* renderer);
271 
276 
278 TESS_API char* TESS_CALL TessBaseAPIGetHOCRText(TessBaseAPI* handle, int page_number);
279 
280 TESS_API char* TESS_CALL TessBaseAPIGetBoxText(TessBaseAPI* handle, int page_number);
281 
284 
286 
287 #ifndef DISABLED_LEGACY_ENGINE
288 TESS_API BOOL TESS_CALL TessBaseAPIAdaptToWordStr(TessBaseAPI* handle, TessPageSegMode mode, const char* wordstr);
289 #endif // ndef DISABLED_LEGACY_ENGINE
290 
293 
294 TESS_API int TESS_CALL TessBaseAPIIsValidWord(TessBaseAPI* handle, const char* word);
295 TESS_API BOOL TESS_CALL TessBaseAPIGetTextDirection(TessBaseAPI* handle, int* out_offset, float* out_slope);
296 
297 
298 #ifdef TESS_CAPI_INCLUDE_BASEAPI
299 
300 TESS_API void TESS_CALL TessBaseAPISetDictFunc(TessBaseAPI* handle, TessDictFunc f);
301 
303 
304 TESS_API void TESS_CALL TessBaseAPISetProbabilityInContextFunc(TessBaseAPI* handle, TessProbabilityInContextFunc f);
305 
306 // Call TessDeleteText(*best_script_name) to free memory allocated by this function
308  int* orient_deg, float* orient_conf, const char **script_name, float* script_conf);
309 
310 #endif // def TESS_CAPI_INCLUDE_BASEAPI
311 
312 TESS_API const char*
313  TESS_CALL TessBaseAPIGetUnichar(TessBaseAPI* handle, int unichar_id);
314 
316 
317 #ifdef TESS_CAPI_INCLUDE_BASEAPI
318 
319 TESS_API const TessDawg*
320  TESS_CALL TessBaseAPIGetDawg(const TessBaseAPI* handle, int i);
321 
323 
325  TESS_CALL TessBaseAPIOem(const TessBaseAPI* handle);
326 
327 TESS_API void TESS_CALL TessBaseAPIInitTruthCallback(TessBaseAPI* handle, TessTruthCallback* cb);
328 
329 TESS_API void TESS_CALL TessBaseGetBlockTextOrientations(TessBaseAPI* handle, int** block_orientation, bool** vertical_writing);
330 
331 #endif
332 
333 /* Page iterator */
334 
336 
339 
341 
343 
345 
347  TessPageIteratorLevel element);
348 
350  int* left, int* top, int* right, int* bottom);
351 
354 
355 TESS_API struct Pix*
357 
358 TESS_API struct Pix*
360  struct Pix* original_image, int* left, int* top);
361 
363  int* x1, int* y1, int* x2, int* y2);
364 
366  TessWritingDirection* writing_direction, TessTextlineOrder* textline_order,
367  float* deskew_angle);
368 
370  BOOL *is_list_item, BOOL *is_crown, int *first_line_indent);
371 
372 /* Result iterator */
373 
383 
387 TESS_API const char*
389 TESS_API const char*
390  TESS_CALL TessResultIteratorWordFontAttributes(const TessResultIterator* handle, BOOL* is_bold, BOOL* is_italic,
391  BOOL* is_underlined, BOOL* is_monospace, BOOL* is_serif,
392  BOOL* is_smallcaps, int* pointsize, int* font_id);
393 
399 
404 
405 /* Progress monitor */
406 
410 TESS_API void TESS_CALL TessMonitorSetCancelThis(ETEXT_DESC* monitor, void* cancelThis);
414 TESS_API void TESS_CALL TessMonitorSetDeadlineMSecs(ETEXT_DESC* monitor, int deadline);
415 
416 
417 #ifndef DISABLED_LEGACY_ENGINE
418 
419 #ifdef TESS_CAPI_INCLUDE_BASEAPI
420 TESS_API void TESS_CALL TessBaseAPISetFillLatticeFunc(TessBaseAPI* handle, TessFillLatticeFunc f);
421 
423  int* num_features, int* FeatureOutlineIndex);
424 
425 TESS_API ROW* TESS_CALL TessFindRowForBox(BLOCK_LIST* blocks, int left, int top, int right, int bottom);
426 
427 TESS_API void TESS_CALL TessBaseAPIRunAdaptiveClassifier(TessBaseAPI* handle, TBLOB* blob, int num_max_matches,
428  int* unichar_ids, float* ratings, int* num_matches_returned);
429 
430 TESS_API ROW* TESS_CALL TessMakeTessOCRRow(float baseline, float xheight, float descender, float ascender);
431 
433  TESS_CALL TessMakeTBLOB(Pix* pix);
434 
435 TESS_API void TESS_CALL TessNormalizeTBLOB(TBLOB* tblob, ROW* row, BOOL numeric_mode);
436 
437 TESS_API BLOCK_LIST*
439 
440 TESS_API void TESS_CALL TessDeleteBlockList(BLOCK_LIST* block_list);
441 
442 #endif // def TESS_CAPI_INCLUDE_BASEAPI
443 
444 #endif // ndef DISABLED_LEGACY_ENGINE
445 
446 
447 #ifdef __cplusplus
448 }
449 #endif
450 
451 #endif // API_CAPI_H_
#define TESS_CALL
Definition: capi.h:45
struct TessChoiceIterator TessChoiceIterator
Definition: capi.h:93
TESS_API char *TESS_CALL TessBaseAPIGetUTF8Text(TessBaseAPI *handle)
Definition: capi.cpp:473
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetComponentImages1(TessBaseAPI *handle, const TessPageIteratorLevel level, const BOOL text_only, const BOOL raw_image, const int raw_padding, struct Pixa **pixa, int **blockids, int **paraids)
Definition: capi.cpp:416
bool(* TessCancelFunc)(void *cancel_this, int words)
Definition: capi.h:109
TESS_API TessResultRenderer *TESS_CALL TessPDFRendererCreate(const char *outputbase, const char *datadir, BOOL textonly)
Definition: capi.cpp:69
TessWritingDirection
Definition: capi.h:104
TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest(TessBaseAPI *handle, ETEXT_DESC *monitor)
Definition: capi.cpp:439
TESS_API void TESS_CALL TessResultIteratorDelete(TessResultIterator *handle)
Definition: capi.cpp:711
TESS_API BOOL TESS_CALL TessBaseAPISetVariable(TessBaseAPI *handle, const char *name, const char *value)
Definition: capi.cpp:180
TESS_API void TESS_CALL TessBaseAPISetThresholder(TessBaseAPI *handle, TessImageThresholder *thresholder)
Definition: capi.cpp:369
Definition: capi.h:101
TESS_API BOOL TESS_CALL TessBaseAPIDetectOrientationScript(TessBaseAPI *handle, int *orient_deg, float *orient_conf, const char **script_name, float *script_conf)
Definition: capi.cpp:547
TESS_API TessPageIterator *TESS_CALL TessResultIteratorGetPageIterator(TessResultIterator *handle)
Definition: capi.cpp:721
TESS_API BOOL TESS_CALL TessBaseAPISetDebugVariable(TessBaseAPI *handle, const char *name, const char *value)
Definition: capi.cpp:185
TessParagraphJustification
Definition: capi.h:103
struct TessUnlvRenderer TessUnlvRenderer
Definition: capi.h:87
TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin(TessBaseAPI *handle, double margin)
Definition: capi.cpp:616
TessPageSegMode
Definition: capi.h:95
TESS_API TessResultRenderer *TESS_CALL TessTextRendererCreate(const char *outputbase)
Definition: capi.cpp:54
TESS_API const char *TESS_CALL TessBaseAPIGetInitLanguagesAsString(const TessBaseAPI *handle)
Definition: capi.cpp:275
TESS_API TessPageSegMode TESS_CALL TessBaseAPIGetPageSegMode(const TessBaseAPI *handle)
Definition: capi.cpp:329
TESS_API void TESS_CALL TessBaseAPISetSourceResolution(TessBaseAPI *handle, int ppi)
Definition: capi.cpp:359
#define TESS_API
Definition: platform.h:74
struct TessPDFRenderer TessPDFRenderer
Definition: capi.h:86
TESS_API void TESS_CALL TessBaseAPISetOutputName(TessBaseAPI *handle, const char *name)
Definition: capi.cpp:175
TESS_API void TESS_CALL TessBaseAPIClearPersistentCache(TessBaseAPI *handle)
Definition: capi.cpp:535
TESS_API int TESS_CALL TessMonitorGetProgress(ETEXT_DESC *monitor)
Definition: capi.cpp:853
TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor(const TessBaseAPI *handle)
Definition: capi.cpp:423
TESS_API BOOL TESS_CALL TessPageIteratorBoundingBox(const TessPageIterator *handle, TessPageIteratorLevel level, int *left, int *top, int *right, int *bottom)
Definition: capi.cpp:664
ParagraphJustification
Definition: publictypes.h:251
TESS_API int TESS_CALL TessBaseAPIRecognize(TessBaseAPI *handle, ETEXT_DESC *monitor)
Definition: capi.cpp:433
TESS_API void TESS_CALL TessBaseAPISetDictFunc(TessBaseAPI *handle, TessDictFunc f)
Definition: capi.cpp:530
TESS_API BOOL TESS_CALL TessResultIteratorWordIsNumeric(const TessResultIterator *handle)
Definition: capi.cpp:783
void * cancel_this
monitor-aware progress callback
Definition: ocrclass.h:132
TESS_API TessPolyBlockType TESS_CALL TessPageIteratorBlockType(const TessPageIterator *handle)
Definition: capi.cpp:670
TESS_API void TESS_CALL TessMonitorSetDeadlineMSecs(ETEXT_DESC *monitor, int deadline)
Definition: capi.cpp:858
TESS_API void TESS_CALL TessPageIteratorOrientation(TessPageIterator *handle, TessOrientation *orientation, TessWritingDirection *writing_direction, TessTextlineOrder *textline_order, float *deskew_angle)
Definition: capi.cpp:692
struct TessBaseAPI TessBaseAPI
Definition: capi.h:89
TESS_API void TESS_CALL TessPageIteratorDelete(TessPageIterator *handle)
Definition: capi.cpp:633
TESS_API void TESS_CALL TessPageIteratorBegin(TessPageIterator *handle)
Definition: capi.cpp:643
TESS_API BOOL TESS_CALL TessBaseAPIGetVariableAsString(TessBaseAPI *handle, const char *name, STRING *val)
Definition: capi.cpp:236
TESS_API void TESS_CALL TessDeleteText(char *text)
Definition: capi.cpp:30
TESS_API void TESS_CALL TessBaseAPISetImage2(TessBaseAPI *handle, struct Pix *pix)
Definition: capi.cpp:354
TESS_API char **TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector(const TessBaseAPI *handle)
Definition: capi.cpp:291
TESS_API BOOL TESS_CALL TessResultIteratorNext(TessResultIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:736
struct TessTextRenderer TessTextRenderer
Definition: capi.h:84
TESS_API char *TESS_CALL TessBaseAPIGetBoxText(TessBaseAPI *handle, int page_number)
Definition: capi.cpp:483
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetComponentImages(TessBaseAPI *handle, const TessPageIteratorLevel level, const BOOL text_only, struct Pixa **pixa, int **blockids)
Definition: capi.cpp:410
TessPolyBlockType
Definition: capi.h:99
PolyBlockType
Definition: publictypes.h:53
TESS_API void TESS_CALL TessBaseAPISetImage(TessBaseAPI *handle, const unsigned char *imagedata, int width, int height, int bytes_per_pixel, int bytes_per_line)
Definition: capi.cpp:348
TESS_API char *TESS_CALL TessResultIteratorGetUTF8Text(const TessResultIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:741
TESS_API void TESS_CALL TessBaseAPIRunAdaptiveClassifier(TessBaseAPI *handle, TBLOB *blob, int num_max_matches, int *unichar_ids, float *ratings, int *num_matches_returned)
Definition: capi.cpp:566
TESS_API const TessDawg *TESS_CALL TessBaseAPIGetDawg(const TessBaseAPI *handle, int i)
Definition: capi.cpp:579
TESS_API const char *TESS_CALL TessResultIteratorWordRecognitionLanguage(const TessResultIterator *handle)
Definition: capi.cpp:751
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetConnectedComponents(TessBaseAPI *handle, struct Pixa **cc)
Definition: capi.cpp:405
TESS_API const char *TESS_CALL TessChoiceIteratorGetUTF8Text(const TessChoiceIterator *handle)
Definition: capi.cpp:813
TessPageIteratorLevel
Definition: capi.h:98
TESS_API char **TESS_CALL TessBaseAPIGetLoadedLanguagesAsVector(const TessBaseAPI *handle)
Definition: capi.cpp:280
bool(* TessProgressFunc)(ETEXT_DESC *ths, int left, int right, int top, int bottom)
Definition: capi.h:110
TESS_API BOOL TESS_CALL TessPageIteratorBaseline(const TessPageIterator *handle, TessPageIteratorLevel level, int *x1, int *y1, int *x2, int *y2)
Definition: capi.cpp:686
TESS_API void TESS_CALL TessDeleteTextArray(char **arr)
Definition: capi.cpp:35
TESS_API struct Pix *TESS_CALL TessBaseAPIGetInputImage(TessBaseAPI *handle)
Definition: capi.cpp:160
TESS_API void TESS_CALL TessNormalizeTBLOB(TBLOB *tblob, ROW *row, BOOL numeric_mode)
Definition: capi.cpp:600
TESS_API BOOL TESS_CALL TessPageIteratorIsAtFinalElement(const TessPageIterator *handle, TessPageIteratorLevel level, TessPageIteratorLevel element)
Definition: capi.cpp:658
#define BOOL
Definition: capi.h:50
Definition: capi.h:100
TESS_API const char *TESS_CALL TessBaseAPIGetInputName(TessBaseAPI *handle)
Definition: capi.cpp:150
TESS_API BOOL TESS_CALL TessBaseAPIAdaptToWordStr(TessBaseAPI *handle, TessPageSegMode mode, const char *wordstr)
Definition: capi.cpp:504
TESS_API void TESS_CALL TessBaseAPISetRectangle(TessBaseAPI *handle, int left, int top, int width, int height)
Definition: capi.cpp:364
TESS_API const char *TESS_CALL TessBaseAPIGetUnichar(TessBaseAPI *handle, int unichar_id)
Definition: capi.cpp:574
TESS_API TessResultRenderer *TESS_CALL TessUnlvRendererCreate(const char *outputbase)
Definition: capi.cpp:75
TESS_API const char *TESS_CALL TessBaseAPIGetDatapath(TessBaseAPI *handle)
Definition: capi.cpp:170
TESS_API BOOL TESS_CALL TessBaseAPIPrintVariablesToFile(const TessBaseAPI *handle, const char *filename)
Definition: capi.cpp:224
TESS_API BOOL TESS_CALL TessResultRendererAddImage(TessResultRenderer *renderer, TessBaseAPI *api)
Definition: capi.cpp:105
int(Dict::* DictFunc)(void *void_dawg_args, const UNICHARSET &unicharset, UNICHAR_ID unichar_id, bool word_end) const
Definition: baseapi.h:76
TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage(TessBaseAPI *handle)
Definition: capi.cpp:309
TESS_API int TESS_CALL TessBaseAPIGetSourceYResolution(TessBaseAPI *handle)
Definition: capi.cpp:165
TESS_API TessOcrEngineMode TESS_CALL TessBaseAPIOem(const TessBaseAPI *handle)
Definition: capi.cpp:606
TESS_API BOOL TESS_CALL TessBaseAPIGetBoolVariable(const TessBaseAPI *handle, const char *name, BOOL *value)
Definition: capi.cpp:195
TESS_API struct Pix *TESS_CALL TessPageIteratorGetBinaryImage(const TessPageIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:675
TESS_API int TESS_CALL TessBaseAPIInit4(TessBaseAPI *handle, const char *datapath, const char *language, TessOcrEngineMode mode, char **configs, int configs_size, char **vars_vec, char **vars_values, size_t vars_vec_size, BOOL set_only_non_debug_params)
Definition: capi.cpp:241
TESS_API ETEXT_DESC *TESS_CALL TessMonitorCreate()
Definition: capi.cpp:823
TESS_API int TESS_CALL TessBaseAPIInit3(TessBaseAPI *handle, const char *datapath, const char *language)
Definition: capi.cpp:270
TESS_API int TESS_CALL TessBaseAPIInitLangMod(TessBaseAPI *handle, const char *datapath, const char *language)
Definition: capi.cpp:303
Definition: capi.h:95
TessOrientation
Definition: capi.h:102
TESS_API void TESS_CALL TessBaseAPIReadConfigFile(TessBaseAPI *handle, const char *filename)
Definition: capi.cpp:314
TESS_API BOOL TESS_CALL TessResultRendererBeginDocument(TessResultRenderer *renderer, const char *title)
Definition: capi.cpp:100
TESS_API TBLOB *TESS_CALL TessMakeTBLOB(struct Pix *pix)
Definition: capi.cpp:595
TESS_API void TESS_CALL TessBaseAPIClear(TessBaseAPI *handle)
Definition: capi.cpp:510
TessOcrEngineMode
Definition: capi.h:94
TESS_API char *TESS_CALL TessBaseAPIGetHOCRText(TessBaseAPI *handle, int page_number)
Definition: capi.cpp:478
TESS_API BOOL TESS_CALL TessChoiceIteratorNext(TessChoiceIterator *handle)
Definition: capi.cpp:808
TESS_API TessResultRenderer *TESS_CALL TessBoxTextRendererCreate(const char *outputbase)
Definition: capi.cpp:80
TESS_API BOOL TESS_CALL TessPageIteratorIsAtBeginningOf(const TessPageIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:653
Definition: capi.h:101
struct TessHOcrRenderer TessHOcrRenderer
Definition: capi.h:85
TESS_API void TESS_CALL TessBaseAPISetProbabilityInContextFunc(TessBaseAPI *handle, TessProbabilityInContextFunc f)
Definition: capi.cpp:540
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript(const TessResultIterator *handle)
Definition: capi.cpp:788
TESS_API void TESS_CALL TessDeleteBlockList(BLOCK_LIST *block_list)
Definition: capi.cpp:48
TESS_API float TESS_CALL TessChoiceIteratorConfidence(const TessChoiceIterator *handle)
Definition: capi.cpp:818
TESS_API void TESS_CALL TessBaseAPIPrintVariables(const TessBaseAPI *handle, FILE *fp)
Definition: capi.cpp:219
TESS_API TessResultRenderer *TESS_CALL TessResultRendererNext(TessResultRenderer *renderer)
Definition: capi.cpp:95
TESS_API void TESS_CALL TessMonitorSetCancelFunc(ETEXT_DESC *monitor, TessCancelFunc cancelFunc)
Definition: capi.cpp:833
TESS_API TessMutableIterator *TESS_CALL TessBaseAPIGetMutableIterator(TessBaseAPI *handle)
Definition: capi.cpp:468
TESS_API ROW *TESS_CALL TessFindRowForBox(BLOCK_LIST *blocks, int left, int top, int right, int bottom)
Definition: capi.cpp:561
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetTextlines1(TessBaseAPI *handle, const BOOL raw_image, const int raw_padding, struct Pixa **pixa, int **blockids, int **paraids)
Definition: capi.cpp:389
TESS_API void TESS_CALL TessDeleteResultRenderer(TessResultRenderer *renderer)
Definition: capi.cpp:85
TESS_API TessChoiceIterator *TESS_CALL TessResultIteratorGetChoiceIterator(const TessResultIterator *handle)
Definition: capi.cpp:731
TESS_API BOOL TESS_CALL TessBaseAPIGetIntVariable(const TessBaseAPI *handle, const char *name, int *value)
Definition: capi.cpp:190
Definition: ocrrow.h:36
TESS_API void TESS_CALL TessBaseGetBlockTextOrientations(TessBaseAPI *handle, int **block_orientation, bool **vertical_writing)
Definition: capi.cpp:621
TESS_API void TESS_CALL TessBaseAPIInitTruthCallback(TessBaseAPI *handle, TessTruthCallback *cb)
Definition: capi.cpp:611
TESS_API char *TESS_CALL TessBaseAPIGetUNLVText(TessBaseAPI *handle)
Definition: capi.cpp:488
TESS_API void TESS_CALL TessBaseAPISetPageSegMode(TessBaseAPI *handle, TessPageSegMode mode)
Definition: capi.cpp:324
TESS_API int TESS_CALL TessBaseAPIInit2(TessBaseAPI *handle, const char *datapath, const char *language, TessOcrEngineMode oem)
Definition: capi.cpp:265
TESS_API void TESS_CALL TessBaseAPIDelete(TessBaseAPI *handle)
Definition: capi.cpp:135
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript(const TessResultIterator *handle)
Definition: capi.cpp:793
TESS_API TessBaseAPI *TESS_CALL TessBaseAPICreate()
Definition: capi.cpp:130
TESS_API void TESS_CALL TessResultRendererInsert(TessResultRenderer *renderer, TessResultRenderer *next)
Definition: capi.cpp:90
TESS_API BOOL TESS_CALL TessResultIteratorWordIsFromDictionary(const TessResultIterator *handle)
Definition: capi.cpp:778
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetStrips(TessBaseAPI *handle, struct Pixa **pixa, int **blockids)
Definition: capi.cpp:395
TessTextlineOrder
Definition: capi.h:105
TESS_API void TESS_CALL TessMonitorSetProgressFunc(ETEXT_DESC *monitor, TessProgressFunc progressFunc)
Definition: capi.cpp:848
Definition: strngs.h:45
TESS_API TessResultRenderer *TESS_CALL TessHOcrRendererCreate2(const char *outputbase, BOOL font_info)
Definition: capi.cpp:64
struct TessResultIterator TessResultIterator
Definition: capi.h:91
TESS_API void TESS_CALL TessBaseAPIGetFeaturesForBlob(TessBaseAPI *handle, TBLOB *blob, INT_FEATURE_STRUCT *int_features, int *num_features, int *FeatureOutlineIndex)
Definition: capi.cpp:555
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetWords(TessBaseAPI *handle, struct Pixa **pixa)
Definition: capi.cpp:400
TESS_API void TESS_CALL TessBaseAPIClearAdaptiveClassifier(TessBaseAPI *handle)
Definition: capi.cpp:342
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap(const TessResultIterator *handle)
Definition: capi.cpp:798
Definition: capi.h:97
TESS_API TessResultIterator *TESS_CALL TessResultIteratorCopy(const TessResultIterator *handle)
Definition: capi.cpp:716
TESS_API ROW *TESS_CALL TessMakeTessOCRRow(float baseline, float xheight, float descender, float ascender)
Definition: capi.cpp:590
TESS_API void TESS_CALL TessBaseAPIEnd(TessBaseAPI *handle)
Definition: capi.cpp:515
TESS_API void TESS_CALL TessMonitorSetCancelThis(ETEXT_DESC *monitor, void *cancelThis)
Definition: capi.cpp:838
TESS_API int *TESS_CALL TessBaseAPIAllWordConfidences(TessBaseAPI *handle)
Definition: capi.cpp:498
TESS_API int TESS_CALL TessBaseAPIIsValidWord(TessBaseAPI *handle, const char *word)
Definition: capi.cpp:520
TESS_API void TESS_CALL TessChoiceIteratorDelete(TessChoiceIterator *handle)
Definition: capi.cpp:803
TESS_API const char *TESS_CALL TessResultRendererTitle(TessResultRenderer *renderer)
Definition: capi.cpp:120
struct TessResultRenderer TessResultRenderer
Definition: capi.h:83
TESS_API int TESS_CALL TessResultRendererImageNum(TessResultRenderer *renderer)
Definition: capi.cpp:125
struct TessMutableIterator TessMutableIterator
Definition: capi.h:92
TESS_API BOOL TESS_CALL TessResultRendererEndDocument(TessResultRenderer *renderer)
Definition: capi.cpp:110
TESS_API void *TESS_CALL TessMonitorGetCancelThis(ETEXT_DESC *monitor)
Definition: capi.cpp:843
double(Dict::* ProbabilityInContextFunc)(const char *lang, const char *context, int context_bytes, const char *character, int character_bytes)
Definition: baseapi.h:79
TESS_API BOOL TESS_CALL TessBaseAPIProcessPages(TessBaseAPI *handle, const char *filename, const char *retry_config, int timeout_millisec, TessResultRenderer *renderer)
Definition: capi.cpp:445
TESS_API const char *TESS_CALL TessVersion()
Definition: capi.cpp:25
TESS_API int TESS_CALL TessBaseAPIMeanTextConf(TessBaseAPI *handle)
Definition: capi.cpp:493
TESS_API TessResultRenderer *TESS_CALL TessHOcrRendererCreate(const char *outputbase)
Definition: capi.cpp:59
TESS_API struct Pix *TESS_CALL TessPageIteratorGetImage(const TessPageIterator *handle, TessPageIteratorLevel level, int padding, struct Pix *original_image, int *left, int *top)
Definition: capi.cpp:680
TESS_API TessPageIterator *TESS_CALL TessPageIteratorCopy(const TessPageIterator *handle)
Definition: capi.cpp:638
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetRegions(TessBaseAPI *handle, struct Pixa **pixa)
Definition: capi.cpp:379
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetTextlines(TessBaseAPI *handle, struct Pixa **pixa, int **blockids)
Definition: capi.cpp:384
TESS_API const TessPageIterator *TESS_CALL TessResultIteratorGetPageIteratorConst(const TessResultIterator *handle)
Definition: capi.cpp:726
TESS_API struct Pix *TESS_CALL TessBaseAPIGetThresholdedImage(TessBaseAPI *handle)
Definition: capi.cpp:374
TESS_API void TESS_CALL TessBaseAPISetInputName(TessBaseAPI *handle, const char *name)
Definition: capi.cpp:145
TESS_API BOOL TESS_CALL TessBaseAPIProcessPage(TessBaseAPI *handle, struct Pix *pix, int page_index, const char *filename, const char *retry_config, int timeout_millisec, TessResultRenderer *renderer)
Definition: capi.cpp:454
Definition: blobs.h:268
TESS_API void TESS_CALL TessPageIteratorParagraphInfo(TessPageIterator *handle, TessParagraphJustification *justification, BOOL *is_list_item, BOOL *is_crown, int *first_line_indent)
Definition: capi.cpp:699
TESS_API BOOL TESS_CALL TessPageIteratorNext(TessPageIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:648
Definition: capi.h:98
TESS_API void TESS_CALL TessBaseAPIReadDebugConfigFile(TessBaseAPI *handle, const char *filename)
Definition: capi.cpp:319
TESS_API TessPageIterator *TESS_CALL TessBaseAPIAnalyseLayout(TessBaseAPI *handle)
Definition: capi.cpp:428
Definition: capi.h:98
TESS_API int TESS_CALL TessBaseAPINumDawgs(const TessBaseAPI *handle)
Definition: capi.cpp:584
TESS_API BOOL TESS_CALL TessBaseAPIGetTextDirection(TessBaseAPI *handle, int *out_offset, float *out_slope)
Definition: capi.cpp:525
TESS_API const char *TESS_CALL TessResultRendererExtention(TessResultRenderer *renderer)
Definition: capi.cpp:115
TESS_API TessResultIterator *TESS_CALL TessBaseAPIGetIterator(TessBaseAPI *handle)
Definition: capi.cpp:463
Definition: capi.h:98
TESS_API BLOCK_LIST *TESS_CALL TessBaseAPIFindLinesCreateBlockList(TessBaseAPI *handle)
Definition: capi.cpp:627
TESS_API float TESS_CALL TessResultIteratorConfidence(const TessResultIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:746
struct TessBoxTextRenderer TessBoxTextRenderer
Definition: capi.h:88
TESS_API void TESS_CALL TessMonitorDelete(ETEXT_DESC *monitor)
Definition: capi.cpp:828
TESS_API const char *TESS_CALL TessBaseAPIGetStringVariable(const TessBaseAPI *handle, const char *name)
Definition: capi.cpp:214
TESS_API BOOL TESS_CALL TessBaseAPIGetDoubleVariable(const TessBaseAPI *handle, const char *name, double *value)
Definition: capi.cpp:209
void(Wordrec::* FillLatticeFunc)(const MATRIX &ratings, const WERD_CHOICE_LIST &best_choices, const UNICHARSET &unicharset, BlamerBundle *blamer_bundle)
Definition: baseapi.h:86
struct TessPageIterator TessPageIterator
Definition: capi.h:90
TESS_API void TESS_CALL TessDeleteIntArray(int *arr)
Definition: capi.cpp:42
TESS_API void TESS_CALL TessBaseAPISetInputImage(TessBaseAPI *handle, struct Pix *pix)
Definition: capi.cpp:155
TESS_API size_t TESS_CALL TessBaseAPIGetOpenCLDevice(TessBaseAPI *handle, void **device)
Definition: capi.cpp:140
TESS_API int TESS_CALL TessBaseAPIInit1(TessBaseAPI *handle, const char *datapath, const char *language, TessOcrEngineMode oem, char **configs, int configs_size)
Definition: capi.cpp:259
TESS_API const char *TESS_CALL TessResultIteratorWordFontAttributes(const TessResultIterator *handle, BOOL *is_bold, BOOL *is_italic, BOOL *is_underlined, BOOL *is_monospace, BOOL *is_serif, BOOL *is_smallcaps, int *pointsize, int *font_id)
Definition: capi.cpp:756
TESS_API char *TESS_CALL TessBaseAPIRect(TessBaseAPI *handle, const unsigned char *imagedata, int bytes_per_pixel, int bytes_per_line, int left, int top, int width, int height)
Definition: capi.cpp:334