tesseract  3.05.02
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 #ifdef TESS_CAPI_INCLUDE_BASEAPI
22 # include "baseapi.h"
23 # include "pageiterator.h"
24 # include "resultiterator.h"
25 # include "renderer.h"
26 #else
27 # include "platform.h"
28 # include <stdio.h>
29 #endif
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #ifndef TESS_CALL
36 # if defined(WIN32)
37 # define TESS_CALL __cdecl
38 # else
39 # define TESS_CALL
40 # endif
41 #endif
42 
43 #ifndef BOOL
44 # define BOOL int
45 # define TRUE 1
46 # define FALSE 0
47 #endif
48 
49 #ifdef TESS_CAPI_INCLUDE_BASEAPI
63 typedef tesseract::ImageThresholder TessImageThresholder;
65 typedef tesseract::DictFunc TessDictFunc;
66 typedef tesseract::ProbabilityInContextFunc TessProbabilityInContextFunc;
67 // typedef tesseract::ParamsModelClassifyFunc TessParamsModelClassifyFunc;
68 typedef tesseract::FillLatticeFunc TessFillLatticeFunc;
69 typedef tesseract::Dawg TessDawg;
70 typedef tesseract::TruthCallback TessTruthCallback;
71 #ifndef NO_CUBE_BUILD
72 typedef tesseract::CubeRecoContext TessCubeRecoContext;
73 #endif // NO_CUBE_BUILD
79 #else
86 typedef struct TessBaseAPI TessBaseAPI;
103 typedef struct ETEXT_DESC ETEXT_DESC;
104 #endif
105 
106 struct Pix;
107 struct Boxa;
108 struct Pixa;
109 
110 /* General free functions */
111 
112 TESS_API const char*
114 TESS_API void TESS_CALL TessDeleteText(char* text);
115 TESS_API void TESS_CALL TessDeleteTextArray(char** arr);
116 TESS_API void TESS_CALL TessDeleteIntArray(int* arr);
117 #ifdef TESS_CAPI_INCLUDE_BASEAPI
118 TESS_API void TESS_CALL TessDeleteBlockList(BLOCK_LIST* block_list);
119 #endif
120 
121 /* Renderer API */
124 TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate2(const char* outputbase, BOOL font_info);
125 TESS_API TessResultRenderer* TESS_CALL TessPDFRendererCreate(const char* outputbase, const char* datadir);
126 TESS_API TessResultRenderer* TESS_CALL TessPDFRendererCreateTextonly(const char* outputbase, const char* datadir,
127  BOOL textonly);
130 
138 
142 
143 /* Base API */
144 
148 
149 TESS_API size_t TESS_CALL TessBaseAPIGetOpenCLDevice(TessBaseAPI* handle, void **device);
150 
151 TESS_API void TESS_CALL TessBaseAPISetInputName( TessBaseAPI* handle, const char* name);
153 
154 TESS_API void TESS_CALL TessBaseAPISetInputImage(TessBaseAPI* handle, struct Pix* pix);
156 
159 
160 TESS_API void TESS_CALL TessBaseAPISetOutputName(TessBaseAPI* handle, const char* name);
161 
162 TESS_API BOOL TESS_CALL TessBaseAPISetVariable(TessBaseAPI* handle, const char* name, const char* value);
163 TESS_API BOOL TESS_CALL TessBaseAPISetDebugVariable(TessBaseAPI* handle, const char* name, const char* value);
164 
165 TESS_API BOOL TESS_CALL TessBaseAPIGetIntVariable( const TessBaseAPI* handle, const char* name, int* value);
166 TESS_API BOOL TESS_CALL TessBaseAPIGetBoolVariable( const TessBaseAPI* handle, const char* name, BOOL* value);
167 TESS_API BOOL TESS_CALL TessBaseAPIGetDoubleVariable(const TessBaseAPI* handle, const char* name, double* value);
168 TESS_API const char*
169  TESS_CALL TessBaseAPIGetStringVariable(const TessBaseAPI* handle, const char* name);
170 
171 TESS_API void TESS_CALL TessBaseAPIPrintVariables( const TessBaseAPI* handle, FILE* fp);
173 #ifdef TESS_CAPI_INCLUDE_BASEAPI
175 #endif
176 
177 #ifdef TESS_CAPI_INCLUDE_BASEAPI
178 TESS_API int TESS_CALL TessBaseAPIInit(TessBaseAPI* handle, const char* datapath, const char* language,
179  TessOcrEngineMode mode, char** configs, int configs_size,
180  const STRING* vars_vec, size_t vars_vec_size,
181  const STRING* vars_values, size_t vars_values_size, BOOL set_only_init_params);
182 #endif
183 TESS_API int TESS_CALL TessBaseAPIInit1(TessBaseAPI* handle, const char* datapath, const char* language, TessOcrEngineMode oem,
184  char** configs, int configs_size);
185 TESS_API int TESS_CALL TessBaseAPIInit2(TessBaseAPI* handle, const char* datapath, const char* language, TessOcrEngineMode oem);
186 TESS_API int TESS_CALL TessBaseAPIInit3(TessBaseAPI* handle, const char* datapath, const char* language);
187 
188 TESS_API int TESS_CALL TessBaseAPIInit4(TessBaseAPI* handle, const char* datapath, const char* language, TessOcrEngineMode mode,
189  char** configs, int configs_size,
190  char** vars_vec, char** vars_values, size_t vars_vec_size,
191  BOOL set_only_non_debug_params);
192 
193 TESS_API const char*
195 TESS_API char**
197 TESS_API char**
199 
200 TESS_API int TESS_CALL TessBaseAPIInitLangMod(TessBaseAPI* handle, const char* datapath, const char* language);
202 
205 
209 
210 TESS_API char* TESS_CALL TessBaseAPIRect(TessBaseAPI* handle, const unsigned char* imagedata,
211  int bytes_per_pixel, int bytes_per_line,
212  int left, int top, int width, int height);
213 
215 
216 TESS_API void TESS_CALL TessBaseAPISetImage(TessBaseAPI* handle, const unsigned char* imagedata, int width, int height,
217  int bytes_per_pixel, int bytes_per_line);
218 TESS_API void TESS_CALL TessBaseAPISetImage2(TessBaseAPI* handle, struct Pix* pix);
219 
221 
222 TESS_API void TESS_CALL TessBaseAPISetRectangle(TessBaseAPI* handle, int left, int top, int width, int height);
223 
224 #ifdef TESS_CAPI_INCLUDE_BASEAPI
225 TESS_API void TESS_CALL TessBaseAPISetThresholder(TessBaseAPI* handle, TessImageThresholder* thresholder);
226 #endif
227 
228 TESS_API struct Pix*
230 TESS_API struct Boxa*
231  TESS_CALL TessBaseAPIGetRegions( TessBaseAPI* handle, struct Pixa** pixa);
232 TESS_API struct Boxa*
233  TESS_CALL TessBaseAPIGetTextlines( TessBaseAPI* handle, struct Pixa** pixa, int** blockids);
234 TESS_API struct Boxa*
235  TESS_CALL TessBaseAPIGetTextlines1( TessBaseAPI* handle, const BOOL raw_image, const int raw_padding,
236  struct Pixa** pixa, int** blockids, int** paraids);
237 TESS_API struct Boxa*
238  TESS_CALL TessBaseAPIGetStrips( TessBaseAPI* handle, struct Pixa** pixa, int** blockids);
239 TESS_API struct Boxa*
240  TESS_CALL TessBaseAPIGetWords( TessBaseAPI* handle, struct Pixa** pixa);
241 TESS_API struct Boxa*
242  TESS_CALL TessBaseAPIGetConnectedComponents(TessBaseAPI* handle, struct Pixa** cc);
243 TESS_API struct Boxa*
244  TESS_CALL TessBaseAPIGetComponentImages( TessBaseAPI* handle, const TessPageIteratorLevel level, const BOOL text_only,
245  struct Pixa** pixa, int** blockids);
246 TESS_API struct Boxa*
247  TESS_CALL TessBaseAPIGetComponentImages1( TessBaseAPI* handle, const TessPageIteratorLevel level, const BOOL text_only,
248  const BOOL raw_image, const int raw_padding,
249  struct Pixa** pixa, int** blockids, int** paraids);
250 
252 
253 TESS_API void TESS_CALL TessBaseAPIDumpPGM(TessBaseAPI* handle, const char* filename);
254 
257 
260 TESS_API BOOL TESS_CALL TessBaseAPIProcessPages(TessBaseAPI* handle, const char* filename, const char* retry_config,
261  int timeout_millisec, TessResultRenderer* renderer);
262 TESS_API BOOL TESS_CALL TessBaseAPIProcessPage(TessBaseAPI* handle, struct Pix* pix, int page_index, const char* filename,
263  const char* retry_config, int timeout_millisec, TessResultRenderer* renderer);
264 
269 
271 TESS_API char* TESS_CALL TessBaseAPIGetHOCRText(TessBaseAPI* handle, int page_number);
272 TESS_API char* TESS_CALL TessBaseAPIGetBoxText(TessBaseAPI* handle, int page_number);
277 
280 
281 TESS_API int TESS_CALL TessBaseAPIIsValidWord(TessBaseAPI* handle, const char* word);
282 TESS_API BOOL TESS_CALL TessBaseAPIGetTextDirection(TessBaseAPI* handle, int* out_offset, float* out_slope);
283 
284 #ifdef TESS_CAPI_INCLUDE_BASEAPI
285 TESS_API void TESS_CALL TessBaseAPISetDictFunc(TessBaseAPI* handle, TessDictFunc f);
287 TESS_API void TESS_CALL TessBaseAPISetProbabilityInContextFunc(TessBaseAPI* handle, TessProbabilityInContextFunc f);
288 
289 TESS_API void TESS_CALL TessBaseAPISetFillLatticeFunc(TessBaseAPI* handle, TessFillLatticeFunc f);
290 
291 // Deprecated, no longer working
293 
294 // Call TessDeleteText(*best_script_name) to free memory allocated by this function
296  int* orient_deg, float* orient_conf, const char **script_name, float* script_conf);
297 
299  int* num_features, int* FeatureOutlineIndex);
300 
301 TESS_API ROW* TESS_CALL TessFindRowForBox(BLOCK_LIST* blocks, int left, int top, int right, int bottom);
302 TESS_API void TESS_CALL TessBaseAPIRunAdaptiveClassifier(TessBaseAPI* handle, TBLOB* blob, int num_max_matches,
303  int* unichar_ids, float* ratings, int* num_matches_returned);
304 #endif
305 
306 TESS_API const char*
307  TESS_CALL TessBaseAPIGetUnichar(TessBaseAPI* handle, int unichar_id);
308 
309 #ifdef TESS_CAPI_INCLUDE_BASEAPI
310 TESS_API const TessDawg*
311  TESS_CALL TessBaseAPIGetDawg(const TessBaseAPI* handle, int i);
313 #endif
314 
315 #ifdef TESS_CAPI_INCLUDE_BASEAPI
316 TESS_API ROW* TESS_CALL TessMakeTessOCRRow(float baseline, float xheight, float descender, float ascender);
318  TESS_CALL TessMakeTBLOB(Pix* pix);
319 TESS_API void TESS_CALL TessNormalizeTBLOB(TBLOB* tblob, ROW* row, BOOL numeric_mode);
320 
322  TESS_CALL TessBaseAPIOem(const TessBaseAPI* handle);
323 TESS_API void TESS_CALL TessBaseAPIInitTruthCallback(TessBaseAPI* handle, TessTruthCallback* cb);
324 
325 #ifndef NO_CUBE_BUILD
326 TESS_API TessCubeRecoContext*
328 #endif // NO_CUBE_BUILD
329 #endif
330 
332 #ifdef TESS_CAPI_INCLUDE_BASEAPI
333 TESS_API void TESS_CALL TessBaseGetBlockTextOrientations(TessBaseAPI* handle, int** block_orientation, BOOL** vertical_writing);
334 
335 TESS_API BLOCK_LIST*
337 #endif
338 
339 /* Page iterator */
340 
344 
349  TessPageIteratorLevel element);
350 
352  int* left, int* top, int* right, int* bottom);
355 
356 TESS_API struct Pix*
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 #ifdef __cplusplus
406 }
407 #endif
408 
409 #endif // API_CAPI_H_
#define TESS_CALL
Definition: capi.h:39
struct TessChoiceIterator TessChoiceIterator
Definition: capi.h:90
TESS_API char *TESS_CALL TessBaseAPIGetUTF8Text(TessBaseAPI *handle)
Definition: capi.cpp:475
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:415
TessWritingDirection
Definition: capi.h:101
TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest(TessBaseAPI *handle, ETEXT_DESC *monitor)
Definition: capi.cpp:442
TESS_API void TESS_CALL TessResultIteratorDelete(TessResultIterator *handle)
Definition: capi.cpp:716
ParagraphJustification
Definition: publictypes.h:239
TESS_API BOOL TESS_CALL TessBaseAPISetVariable(TessBaseAPI *handle, const char *name, const char *value)
Definition: capi.cpp:183
TESS_API void TESS_CALL TessBaseAPISetThresholder(TessBaseAPI *handle, TessImageThresholder *thresholder)
Definition: capi.cpp:368
Definition: capi.h:98
TESS_API BOOL TESS_CALL TessBaseAPIDetectOrientationScript(TessBaseAPI *handle, int *orient_deg, float *orient_conf, const char **script_name, float *script_conf)
Definition: capi.cpp:550
TESS_API TessPageIterator *TESS_CALL TessResultIteratorGetPageIterator(TessResultIterator *handle)
Definition: capi.cpp:726
TESS_API BOOL TESS_CALL TessBaseAPISetDebugVariable(TessBaseAPI *handle, const char *name, const char *value)
Definition: capi.cpp:188
TessParagraphJustification
Definition: capi.h:100
struct TessUnlvRenderer TessUnlvRenderer
Definition: capi.h:84
TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin(TessBaseAPI *handle, double margin)
Definition: capi.cpp:623
TessPageSegMode
Definition: capi.h:92
TESS_API TessResultRenderer *TESS_CALL TessTextRendererCreate(const char *outputbase)
Definition: capi.cpp:52
TESS_API const char *TESS_CALL TessBaseAPIGetInitLanguagesAsString(const TessBaseAPI *handle)
Definition: capi.cpp:278
TESS_API TessPageSegMode TESS_CALL TessBaseAPIGetPageSegMode(const TessBaseAPI *handle)
Definition: capi.cpp:330
TESS_API void TESS_CALL TessBaseAPISetSourceResolution(TessBaseAPI *handle, int ppi)
Definition: capi.cpp:358
struct TessPDFRenderer TessPDFRenderer
Definition: capi.h:83
TESS_API void TESS_CALL TessBaseAPISetOutputName(TessBaseAPI *handle, const char *name)
Definition: capi.cpp:178
TESS_API void TESS_CALL TessBaseAPIClearPersistentCache(TessBaseAPI *handle)
Definition: capi.cpp:535
TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor(const TessBaseAPI *handle)
Definition: capi.cpp:422
TESS_API BOOL TESS_CALL TessPageIteratorBoundingBox(const TessPageIterator *handle, TessPageIteratorLevel level, int *left, int *top, int *right, int *bottom)
Definition: capi.cpp:669
TESS_API int TESS_CALL TessBaseAPIRecognize(TessBaseAPI *handle, ETEXT_DESC *monitor)
Definition: capi.cpp:437
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:788
TESS_API TessPolyBlockType TESS_CALL TessPageIteratorBlockType(const TessPageIterator *handle)
Definition: capi.cpp:675
TESS_API void TESS_CALL TessPageIteratorOrientation(TessPageIterator *handle, TessOrientation *orientation, TessWritingDirection *writing_direction, TessTextlineOrder *textline_order, float *deskew_angle)
Definition: capi.cpp:697
struct TessBaseAPI TessBaseAPI
Definition: capi.h:86
TESS_API void TESS_CALL TessPageIteratorDelete(TessPageIterator *handle)
Definition: capi.cpp:638
TESS_API void TESS_CALL TessPageIteratorBegin(TessPageIterator *handle)
Definition: capi.cpp:648
TESS_API BOOL TESS_CALL TessBaseAPIGetVariableAsString(TessBaseAPI *handle, const char *name, STRING *val)
Definition: capi.cpp:239
#define TESS_API
Definition: platform.h:81
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:353
TESS_API char **TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector(const TessBaseAPI *handle)
Definition: capi.cpp:294
TESS_API BOOL TESS_CALL TessResultIteratorNext(TessResultIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:741
struct TessTextRenderer TessTextRenderer
Definition: capi.h:81
TESS_API char *TESS_CALL TessBaseAPIGetBoxText(TessBaseAPI *handle, int page_number)
Definition: capi.cpp:485
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetComponentImages(TessBaseAPI *handle, const TessPageIteratorLevel level, const BOOL text_only, struct Pixa **pixa, int **blockids)
Definition: capi.cpp:409
TESS_API void TESS_CALL TessBaseAPIDumpPGM(TessBaseAPI *handle, const char *filename)
Definition: capi.cpp:427
TessPolyBlockType
Definition: capi.h:96
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:347
TESS_API char *TESS_CALL TessResultIteratorGetUTF8Text(const TessResultIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:746
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:570
TESS_API const TessDawg *TESS_CALL TessBaseAPIGetDawg(const TessBaseAPI *handle, int i)
Definition: capi.cpp:581
TESS_API const char *TESS_CALL TessResultIteratorWordRecognitionLanguage(const TessResultIterator *handle)
Definition: capi.cpp:756
TESS_API TessResultRenderer *TESS_CALL TessPDFRendererCreate(const char *outputbase, const char *datadir)
Definition: capi.cpp:67
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetConnectedComponents(TessBaseAPI *handle, struct Pixa **cc)
Definition: capi.cpp:404
TESS_API BOOL TESS_CALL TessBaseAPIDetectOS(TessBaseAPI *handle, OSResults *results)
Definition: capi.cpp:545
TESS_API const char *TESS_CALL TessChoiceIteratorGetUTF8Text(const TessChoiceIterator *handle)
Definition: capi.cpp:818
TessPageIteratorLevel
Definition: capi.h:95
TESS_API char **TESS_CALL TessBaseAPIGetLoadedLanguagesAsVector(const TessBaseAPI *handle)
Definition: capi.cpp:283
TESS_API BOOL TESS_CALL TessPageIteratorBaseline(const TessPageIterator *handle, TessPageIteratorLevel level, int *x1, int *y1, int *x2, int *y2)
Definition: capi.cpp:691
TESS_API void TESS_CALL TessDeleteTextArray(char **arr)
Definition: capi.cpp:35
TESS_API struct Pix *TESS_CALL TessBaseAPIGetInputImage(TessBaseAPI *handle)
Definition: capi.cpp:163
TESS_API void TESS_CALL TessNormalizeTBLOB(TBLOB *tblob, ROW *row, BOOL numeric_mode)
Definition: capi.cpp:601
TESS_API BOOL TESS_CALL TessPageIteratorIsAtFinalElement(const TessPageIterator *handle, TessPageIteratorLevel level, TessPageIteratorLevel element)
Definition: capi.cpp:663
#define BOOL
Definition: capi.h:44
Definition: capi.h:97
TESS_API const char *TESS_CALL TessBaseAPIGetInputName(TessBaseAPI *handle)
Definition: capi.cpp:153
TESS_API BOOL TESS_CALL TessBaseAPIAdaptToWordStr(TessBaseAPI *handle, TessPageSegMode mode, const char *wordstr)
Definition: capi.cpp:505
TESS_API void TESS_CALL TessBaseAPISetRectangle(TessBaseAPI *handle, int left, int top, int width, int height)
Definition: capi.cpp:363
TESS_API const char *TESS_CALL TessBaseAPIGetUnichar(TessBaseAPI *handle, int unichar_id)
Definition: capi.cpp:576
TESS_API TessResultRenderer *TESS_CALL TessUnlvRendererCreate(const char *outputbase)
Definition: capi.cpp:78
TESS_API const char *TESS_CALL TessBaseAPIGetDatapath(TessBaseAPI *handle)
Definition: capi.cpp:173
TESS_API BOOL TESS_CALL TessBaseAPIPrintVariablesToFile(const TessBaseAPI *handle, const char *filename)
Definition: capi.cpp:227
TESS_API BOOL TESS_CALL TessResultRendererAddImage(TessResultRenderer *renderer, TessBaseAPI *api)
Definition: capi.cpp:108
TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage(TessBaseAPI *handle)
Definition: capi.cpp:310
TESS_API int TESS_CALL TessBaseAPIGetSourceYResolution(TessBaseAPI *handle)
Definition: capi.cpp:168
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:198
TESS_API struct Pix *TESS_CALL TessPageIteratorGetBinaryImage(const TessPageIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:680
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:244
TESS_API int TESS_CALL TessBaseAPIInit3(TessBaseAPI *handle, const char *datapath, const char *language)
Definition: capi.cpp:273
TESS_API int TESS_CALL TessBaseAPIInitLangMod(TessBaseAPI *handle, const char *datapath, const char *language)
Definition: capi.cpp:305
Definition: capi.h:92
TessOrientation
Definition: capi.h:99
TESS_API void TESS_CALL TessBaseAPIReadConfigFile(TessBaseAPI *handle, const char *filename)
Definition: capi.cpp:315
TESS_API BOOL TESS_CALL TessResultRendererBeginDocument(TessResultRenderer *renderer, const char *title)
Definition: capi.cpp:103
TESS_API TBLOB *TESS_CALL TessMakeTBLOB(struct Pix *pix)
Definition: capi.cpp:596
TESS_API void TESS_CALL TessBaseAPIClear(TessBaseAPI *handle)
Definition: capi.cpp:510
TessOcrEngineMode
Definition: capi.h:91
TESS_API char *TESS_CALL TessBaseAPIGetHOCRText(TessBaseAPI *handle, int page_number)
Definition: capi.cpp:480
TESS_API BOOL TESS_CALL TessChoiceIteratorNext(TessChoiceIterator *handle)
Definition: capi.cpp:813
TESS_API TessResultRenderer *TESS_CALL TessBoxTextRendererCreate(const char *outputbase)
Definition: capi.cpp:83
TESS_API BOOL TESS_CALL TessPageIteratorIsAtBeginningOf(const TessPageIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:658
int(Dict::* DictFunc)(void *void_dawg_args, UNICHAR_ID unichar_id, bool word_end) const
Definition: baseapi.h:83
Definition: capi.h:98
struct TessHOcrRenderer TessHOcrRenderer
Definition: capi.h:82
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:793
double(Dict::* ProbabilityInContextFunc)(const char *lang, const char *context, int context_bytes, const char *character, int character_bytes)
Definition: baseapi.h:85
TESS_API void TESS_CALL TessDeleteBlockList(BLOCK_LIST *block_list)
Definition: capi.cpp:47
TESS_API float TESS_CALL TessChoiceIteratorConfidence(const TessChoiceIterator *handle)
Definition: capi.cpp:823
TESS_API void TESS_CALL TessBaseAPIPrintVariables(const TessBaseAPI *handle, FILE *fp)
Definition: capi.cpp:222
CMD_EVENTS mode
Definition: pgedit.cpp:116
TESS_API TessResultRenderer *TESS_CALL TessResultRendererNext(TessResultRenderer *renderer)
Definition: capi.cpp:98
TESS_API TessMutableIterator *TESS_CALL TessBaseAPIGetMutableIterator(TessBaseAPI *handle)
Definition: capi.cpp:470
TESS_API ROW *TESS_CALL TessFindRowForBox(BLOCK_LIST *blocks, int left, int top, int right, int bottom)
Definition: capi.cpp:565
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:388
TESS_API void TESS_CALL TessDeleteResultRenderer(TessResultRenderer *renderer)
Definition: capi.cpp:88
TESS_API TessChoiceIterator *TESS_CALL TessResultIteratorGetChoiceIterator(const TessResultIterator *handle)
Definition: capi.cpp:736
TESS_API BOOL TESS_CALL TessBaseAPIGetIntVariable(const TessBaseAPI *handle, const char *name, int *value)
Definition: capi.cpp:193
TESS_API void TESS_CALL TessBaseGetBlockTextOrientations(TessBaseAPI *handle, int **block_orientation, bool **vertical_writing)
Definition: capi.cpp:628
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:490
TESS_API void TESS_CALL TessBaseAPISetPageSegMode(TessBaseAPI *handle, TessPageSegMode mode)
Definition: capi.cpp:325
TESS_API int TESS_CALL TessBaseAPIInit2(TessBaseAPI *handle, const char *datapath, const char *language, TessOcrEngineMode oem)
Definition: capi.cpp:268
void(Wordrec::* FillLatticeFunc)(const MATRIX &ratings, const WERD_CHOICE_LIST &best_choices, const UNICHARSET &unicharset, BlamerBundle *blamer_bundle)
Definition: baseapi.h:92
TESS_API void TESS_CALL TessBaseAPIDelete(TessBaseAPI *handle)
Definition: capi.cpp:138
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript(const TessResultIterator *handle)
Definition: capi.cpp:798
TESS_API TessBaseAPI *TESS_CALL TessBaseAPICreate()
Definition: capi.cpp:133
Definition: ocrrow.h:32
TESS_API void TESS_CALL TessResultRendererInsert(TessResultRenderer *renderer, TessResultRenderer *next)
Definition: capi.cpp:93
Definition: strngs.h:44
TESS_API BOOL TESS_CALL TessResultIteratorWordIsFromDictionary(const TessResultIterator *handle)
Definition: capi.cpp:783
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetStrips(TessBaseAPI *handle, struct Pixa **pixa, int **blockids)
Definition: capi.cpp:394
TessTextlineOrder
Definition: capi.h:102
Definition: blobs.h:261
TESS_API TessResultRenderer *TESS_CALL TessHOcrRendererCreate2(const char *outputbase, BOOL font_info)
Definition: capi.cpp:62
struct TessResultIterator TessResultIterator
Definition: capi.h:88
TESS_API void TESS_CALL TessBaseAPIGetFeaturesForBlob(TessBaseAPI *handle, TBLOB *blob, INT_FEATURE_STRUCT *int_features, int *num_features, int *FeatureOutlineIndex)
Definition: capi.cpp:559
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetWords(TessBaseAPI *handle, struct Pixa **pixa)
Definition: capi.cpp:399
TESS_API void TESS_CALL TessBaseAPIClearAdaptiveClassifier(TessBaseAPI *handle)
Definition: capi.cpp:342
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap(const TessResultIterator *handle)
Definition: capi.cpp:803
Definition: capi.h:94
TESS_API TessResultIterator *TESS_CALL TessResultIteratorCopy(const TessResultIterator *handle)
Definition: capi.cpp:721
TESS_API ROW *TESS_CALL TessMakeTessOCRRow(float baseline, float xheight, float descender, float ascender)
Definition: capi.cpp:591
TESS_API void TESS_CALL TessBaseAPIEnd(TessBaseAPI *handle)
Definition: capi.cpp:515
TESS_API int *TESS_CALL TessBaseAPIAllWordConfidences(TessBaseAPI *handle)
Definition: capi.cpp:500
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:808
TESS_API const char *TESS_CALL TessResultRendererTitle(TessResultRenderer *renderer)
Definition: capi.cpp:123
struct TessResultRenderer TessResultRenderer
Definition: capi.h:80
TESS_API int TESS_CALL TessResultRendererImageNum(TessResultRenderer *renderer)
Definition: capi.cpp:128
struct TessMutableIterator TessMutableIterator
Definition: capi.h:89
TESS_API BOOL TESS_CALL TessResultRendererEndDocument(TessResultRenderer *renderer)
Definition: capi.cpp:113
TESS_API TessResultRenderer *TESS_CALL TessPDFRendererCreateTextonly(const char *outputbase, const char *datadir, BOOL textonly)
Definition: capi.cpp:72
TESS_API BOOL TESS_CALL TessBaseAPIProcessPages(TessBaseAPI *handle, const char *filename, const char *retry_config, int timeout_millisec, TessResultRenderer *renderer)
Definition: capi.cpp:447
TESS_API const char *TESS_CALL TessVersion()
Definition: capi.cpp:25
TESS_API int TESS_CALL TessBaseAPIMeanTextConf(TessBaseAPI *handle)
Definition: capi.cpp:495
TESS_API TessResultRenderer *TESS_CALL TessHOcrRendererCreate(const char *outputbase)
Definition: capi.cpp:57
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:685
TESS_API TessPageIterator *TESS_CALL TessPageIteratorCopy(const TessPageIterator *handle)
Definition: capi.cpp:643
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetRegions(TessBaseAPI *handle, struct Pixa **pixa)
Definition: capi.cpp:378
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetTextlines(TessBaseAPI *handle, struct Pixa **pixa, int **blockids)
Definition: capi.cpp:383
TESS_API const TessPageIterator *TESS_CALL TessResultIteratorGetPageIteratorConst(const TessResultIterator *handle)
Definition: capi.cpp:731
TESS_API struct Pix *TESS_CALL TessBaseAPIGetThresholdedImage(TessBaseAPI *handle)
Definition: capi.cpp:373
TESS_API void TESS_CALL TessBaseAPISetInputName(TessBaseAPI *handle, const char *name)
Definition: capi.cpp:148
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:456
TESS_API void TESS_CALL TessPageIteratorParagraphInfo(TessPageIterator *handle, TessParagraphJustification *justification, BOOL *is_list_item, BOOL *is_crown, int *first_line_indent)
Definition: capi.cpp:704
TESS_API BOOL TESS_CALL TessPageIteratorNext(TessPageIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:653
PolyBlockType
Definition: publictypes.h:41
Definition: capi.h:95
TESS_API void TESS_CALL TessBaseAPIReadDebugConfigFile(TessBaseAPI *handle, const char *filename)
Definition: capi.cpp:320
TESS_API TessPageIterator *TESS_CALL TessBaseAPIAnalyseLayout(TessBaseAPI *handle)
Definition: capi.cpp:432
Definition: capi.h:95
TESS_API int TESS_CALL TessBaseAPINumDawgs(const TessBaseAPI *handle)
Definition: capi.cpp:586
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:118
TESS_API TessResultIterator *TESS_CALL TessBaseAPIGetIterator(TessBaseAPI *handle)
Definition: capi.cpp:465
Definition: capi.h:95
TESS_API BLOCK_LIST *TESS_CALL TessBaseAPIFindLinesCreateBlockList(TessBaseAPI *handle)
Definition: capi.cpp:633
TESS_API float TESS_CALL TessResultIteratorConfidence(const TessResultIterator *handle, TessPageIteratorLevel level)
Definition: capi.cpp:751
struct TessBoxTextRenderer TessBoxTextRenderer
Definition: capi.h:85
TESS_API const char *TESS_CALL TessBaseAPIGetStringVariable(const TessBaseAPI *handle, const char *name)
Definition: capi.cpp:217
TESS_API BOOL TESS_CALL TessBaseAPIGetDoubleVariable(const TessBaseAPI *handle, const char *name, double *value)
Definition: capi.cpp:212
struct TessPageIterator TessPageIterator
Definition: capi.h:87
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:158
TESS_API size_t TESS_CALL TessBaseAPIGetOpenCLDevice(TessBaseAPI *handle, void **device)
Definition: capi.cpp:143
TESS_API int TESS_CALL TessBaseAPIInit1(TessBaseAPI *handle, const char *datapath, const char *language, TessOcrEngineMode oem, char **configs, int configs_size)
Definition: capi.cpp:262
TESS_API TessCubeRecoContext *TESS_CALL TessBaseAPIGetCubeRecoContext(const TessBaseAPI *handle)
Definition: capi.cpp:617
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:761
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:335