tesseract  4.0.0-1-g2a2b
capi.cpp File Reference
#include "capi.h"
#include "genericvector.h"
#include "strngs.h"

Go to the source code of this file.

Macros

#define TESS_CAPI_INCLUDE_BASEAPI
 

Functions

TESS_API const char *TESS_CALL TessVersion ()
 
TESS_API void TESS_CALL TessDeleteText (char *text)
 
TESS_API void TESS_CALL TessDeleteTextArray (char **arr)
 
TESS_API void TESS_CALL TessDeleteIntArray (int *arr)
 
TESS_API void TESS_CALL TessDeleteBlockList (BLOCK_LIST *block_list)
 
TESS_API TessResultRenderer *TESS_CALL TessTextRendererCreate (const char *outputbase)
 
TESS_API TessResultRenderer *TESS_CALL TessHOcrRendererCreate (const char *outputbase)
 
TESS_API TessResultRenderer *TESS_CALL TessHOcrRendererCreate2 (const char *outputbase, BOOL font_info)
 
TESS_API TessResultRenderer *TESS_CALL TessPDFRendererCreate (const char *outputbase, const char *datadir, BOOL textonly)
 
TESS_API TessResultRenderer *TESS_CALL TessUnlvRendererCreate (const char *outputbase)
 
TESS_API TessResultRenderer *TESS_CALL TessBoxTextRendererCreate (const char *outputbase)
 
TESS_API void TESS_CALL TessDeleteResultRenderer (TessResultRenderer *renderer)
 
TESS_API void TESS_CALL TessResultRendererInsert (TessResultRenderer *renderer, TessResultRenderer *next)
 
TESS_API TessResultRenderer *TESS_CALL TessResultRendererNext (TessResultRenderer *renderer)
 
TESS_API BOOL TESS_CALL TessResultRendererBeginDocument (TessResultRenderer *renderer, const char *title)
 
TESS_API BOOL TESS_CALL TessResultRendererAddImage (TessResultRenderer *renderer, TessBaseAPI *api)
 
TESS_API BOOL TESS_CALL TessResultRendererEndDocument (TessResultRenderer *renderer)
 
TESS_API const char *TESS_CALL TessResultRendererExtention (TessResultRenderer *renderer)
 
TESS_API const char *TESS_CALL TessResultRendererTitle (TessResultRenderer *renderer)
 
TESS_API int TESS_CALL TessResultRendererImageNum (TessResultRenderer *renderer)
 
TESS_API TessBaseAPI *TESS_CALL TessBaseAPICreate ()
 
TESS_API void TESS_CALL TessBaseAPIDelete (TessBaseAPI *handle)
 
TESS_API size_t TESS_CALL TessBaseAPIGetOpenCLDevice (TessBaseAPI *handle, void **device)
 
TESS_API void TESS_CALL TessBaseAPISetInputName (TessBaseAPI *handle, const char *name)
 
TESS_API const char *TESS_CALL TessBaseAPIGetInputName (TessBaseAPI *handle)
 
TESS_API void TESS_CALL TessBaseAPISetInputImage (TessBaseAPI *handle, Pix *pix)
 
TESS_API Pix *TESS_CALL TessBaseAPIGetInputImage (TessBaseAPI *handle)
 
TESS_API int TESS_CALL TessBaseAPIGetSourceYResolution (TessBaseAPI *handle)
 
TESS_API const char *TESS_CALL TessBaseAPIGetDatapath (TessBaseAPI *handle)
 
TESS_API void TESS_CALL TessBaseAPISetOutputName (TessBaseAPI *handle, const char *name)
 
TESS_API BOOL TESS_CALL TessBaseAPISetVariable (TessBaseAPI *handle, const char *name, const char *value)
 
TESS_API BOOL TESS_CALL TessBaseAPISetDebugVariable (TessBaseAPI *handle, const char *name, const char *value)
 
TESS_API BOOL TESS_CALL TessBaseAPIGetIntVariable (const TessBaseAPI *handle, const char *name, int *value)
 
TESS_API BOOL TESS_CALL TessBaseAPIGetBoolVariable (const TessBaseAPI *handle, const char *name, BOOL *value)
 
TESS_API BOOL TESS_CALL TessBaseAPIGetDoubleVariable (const TessBaseAPI *handle, const char *name, double *value)
 
TESS_API const char *TESS_CALL TessBaseAPIGetStringVariable (const TessBaseAPI *handle, const char *name)
 
TESS_API void TESS_CALL TessBaseAPIPrintVariables (const TessBaseAPI *handle, FILE *fp)
 
TESS_API BOOL TESS_CALL TessBaseAPIPrintVariablesToFile (const TessBaseAPI *handle, const char *filename)
 
TESS_API BOOL TESS_CALL TessBaseAPIGetVariableAsString (TessBaseAPI *handle, const char *name, STRING *val)
 
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)
 
TESS_API int TESS_CALL TessBaseAPIInit1 (TessBaseAPI *handle, const char *datapath, const char *language, TessOcrEngineMode oem, char **configs, int configs_size)
 
TESS_API int TESS_CALL TessBaseAPIInit2 (TessBaseAPI *handle, const char *datapath, const char *language, TessOcrEngineMode oem)
 
TESS_API int TESS_CALL TessBaseAPIInit3 (TessBaseAPI *handle, const char *datapath, const char *language)
 
TESS_API const char *TESS_CALL TessBaseAPIGetInitLanguagesAsString (const TessBaseAPI *handle)
 
TESS_API char **TESS_CALL TessBaseAPIGetLoadedLanguagesAsVector (const TessBaseAPI *handle)
 
TESS_API char **TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector (const TessBaseAPI *handle)
 
TESS_API int TESS_CALL TessBaseAPIInitLangMod (TessBaseAPI *handle, const char *datapath, const char *language)
 
TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage (TessBaseAPI *handle)
 
TESS_API void TESS_CALL TessBaseAPIReadConfigFile (TessBaseAPI *handle, const char *filename)
 
TESS_API void TESS_CALL TessBaseAPIReadDebugConfigFile (TessBaseAPI *handle, const char *filename)
 
TESS_API void TESS_CALL TessBaseAPISetPageSegMode (TessBaseAPI *handle, TessPageSegMode mode)
 
TESS_API TessPageSegMode TESS_CALL TessBaseAPIGetPageSegMode (const TessBaseAPI *handle)
 
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)
 
TESS_API void TESS_CALL TessBaseAPIClearAdaptiveClassifier (TessBaseAPI *handle)
 
TESS_API void TESS_CALL TessBaseAPISetImage (TessBaseAPI *handle, const unsigned char *imagedata, int width, int height, int bytes_per_pixel, int bytes_per_line)
 
TESS_API void TESS_CALL TessBaseAPISetImage2 (TessBaseAPI *handle, struct Pix *pix)
 
TESS_API void TESS_CALL TessBaseAPISetSourceResolution (TessBaseAPI *handle, int ppi)
 
TESS_API void TESS_CALL TessBaseAPISetRectangle (TessBaseAPI *handle, int left, int top, int width, int height)
 
TESS_API void TESS_CALL TessBaseAPISetThresholder (TessBaseAPI *handle, TessImageThresholder *thresholder)
 
TESS_API struct Pix *TESS_CALL TessBaseAPIGetThresholdedImage (TessBaseAPI *handle)
 
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetRegions (TessBaseAPI *handle, struct Pixa **pixa)
 
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetTextlines (TessBaseAPI *handle, struct Pixa **pixa, int **blockids)
 
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetTextlines1 (TessBaseAPI *handle, const BOOL raw_image, const int raw_padding, struct Pixa **pixa, int **blockids, int **paraids)
 
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetStrips (TessBaseAPI *handle, struct Pixa **pixa, int **blockids)
 
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetWords (TessBaseAPI *handle, struct Pixa **pixa)
 
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetConnectedComponents (TessBaseAPI *handle, struct Pixa **cc)
 
TESS_API struct Boxa *TESS_CALL TessBaseAPIGetComponentImages (TessBaseAPI *handle, TessPageIteratorLevel level, BOOL text_only, struct Pixa **pixa, int **blockids)
 
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)
 
TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor (const TessBaseAPI *handle)
 
TESS_API TessPageIterator *TESS_CALL TessBaseAPIAnalyseLayout (TessBaseAPI *handle)
 
TESS_API int TESS_CALL TessBaseAPIRecognize (TessBaseAPI *handle, ETEXT_DESC *monitor)
 
TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest (TessBaseAPI *handle, ETEXT_DESC *monitor)
 
TESS_API BOOL TESS_CALL TessBaseAPIProcessPages (TessBaseAPI *handle, const char *filename, const char *retry_config, int timeout_millisec, TessResultRenderer *renderer)
 
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)
 
TESS_API TessResultIterator *TESS_CALL TessBaseAPIGetIterator (TessBaseAPI *handle)
 
TESS_API TessMutableIterator *TESS_CALL TessBaseAPIGetMutableIterator (TessBaseAPI *handle)
 
TESS_API char *TESS_CALL TessBaseAPIGetUTF8Text (TessBaseAPI *handle)
 
TESS_API char *TESS_CALL TessBaseAPIGetHOCRText (TessBaseAPI *handle, int page_number)
 
TESS_API char *TESS_CALL TessBaseAPIGetBoxText (TessBaseAPI *handle, int page_number)
 
TESS_API char *TESS_CALL TessBaseAPIGetUNLVText (TessBaseAPI *handle)
 
TESS_API int TESS_CALL TessBaseAPIMeanTextConf (TessBaseAPI *handle)
 
TESS_API int *TESS_CALL TessBaseAPIAllWordConfidences (TessBaseAPI *handle)
 
TESS_API BOOL TESS_CALL TessBaseAPIAdaptToWordStr (TessBaseAPI *handle, TessPageSegMode mode, const char *wordstr)
 
TESS_API void TESS_CALL TessBaseAPIClear (TessBaseAPI *handle)
 
TESS_API void TESS_CALL TessBaseAPIEnd (TessBaseAPI *handle)
 
TESS_API int TESS_CALL TessBaseAPIIsValidWord (TessBaseAPI *handle, const char *word)
 
TESS_API BOOL TESS_CALL TessBaseAPIGetTextDirection (TessBaseAPI *handle, int *out_offset, float *out_slope)
 
TESS_API void TESS_CALL TessBaseAPISetDictFunc (TessBaseAPI *handle, TessDictFunc f)
 
TESS_API void TESS_CALL TessBaseAPIClearPersistentCache (TessBaseAPI *handle)
 
TESS_API void TESS_CALL TessBaseAPISetProbabilityInContextFunc (TessBaseAPI *handle, TessProbabilityInContextFunc f)
 
TESS_API BOOL TESS_CALL TessBaseAPIDetectOrientationScript (TessBaseAPI *handle, int *orient_deg, float *orient_conf, const char **script_name, float *script_conf)
 
TESS_API void TESS_CALL TessBaseAPIGetFeaturesForBlob (TessBaseAPI *handle, TBLOB *blob, INT_FEATURE_STRUCT *int_features, int *num_features, int *FeatureOutlineIndex)
 
TESS_API ROW *TESS_CALL TessFindRowForBox (BLOCK_LIST *blocks, int left, int top, int right, int bottom)
 
TESS_API void TESS_CALL TessBaseAPIRunAdaptiveClassifier (TessBaseAPI *handle, TBLOB *blob, int num_max_matches, int *unichar_ids, float *ratings, int *num_matches_returned)
 
TESS_API const char *TESS_CALL TessBaseAPIGetUnichar (TessBaseAPI *handle, int unichar_id)
 
TESS_API const TessDawg *TESS_CALL TessBaseAPIGetDawg (const TessBaseAPI *handle, int i)
 
TESS_API int TESS_CALL TessBaseAPINumDawgs (const TessBaseAPI *handle)
 
TESS_API ROW *TESS_CALL TessMakeTessOCRRow (float baseline, float xheight, float descender, float ascender)
 
TESS_API TBLOB *TESS_CALL TessMakeTBLOB (struct Pix *pix)
 
TESS_API void TESS_CALL TessNormalizeTBLOB (TBLOB *tblob, ROW *row, BOOL numeric_mode)
 
TESS_API TessOcrEngineMode TESS_CALL TessBaseAPIOem (const TessBaseAPI *handle)
 
TESS_API void TESS_CALL TessBaseAPIInitTruthCallback (TessBaseAPI *handle, TessTruthCallback *cb)
 
TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin (TessBaseAPI *handle, double margin)
 
TESS_API void TESS_CALL TessBaseGetBlockTextOrientations (TessBaseAPI *handle, int **block_orientation, bool **vertical_writing)
 
TESS_API BLOCK_LIST *TESS_CALL TessBaseAPIFindLinesCreateBlockList (TessBaseAPI *handle)
 
TESS_API void TESS_CALL TessPageIteratorDelete (TessPageIterator *handle)
 
TESS_API TessPageIterator *TESS_CALL TessPageIteratorCopy (const TessPageIterator *handle)
 
TESS_API void TESS_CALL TessPageIteratorBegin (TessPageIterator *handle)
 
TESS_API BOOL TESS_CALL TessPageIteratorNext (TessPageIterator *handle, TessPageIteratorLevel level)
 
TESS_API BOOL TESS_CALL TessPageIteratorIsAtBeginningOf (const TessPageIterator *handle, TessPageIteratorLevel level)
 
TESS_API BOOL TESS_CALL TessPageIteratorIsAtFinalElement (const TessPageIterator *handle, TessPageIteratorLevel level, TessPageIteratorLevel element)
 
TESS_API BOOL TESS_CALL TessPageIteratorBoundingBox (const TessPageIterator *handle, TessPageIteratorLevel level, int *left, int *top, int *right, int *bottom)
 
TESS_API TessPolyBlockType TESS_CALL TessPageIteratorBlockType (const TessPageIterator *handle)
 
TESS_API struct Pix *TESS_CALL TessPageIteratorGetBinaryImage (const TessPageIterator *handle, TessPageIteratorLevel level)
 
TESS_API struct Pix *TESS_CALL TessPageIteratorGetImage (const TessPageIterator *handle, TessPageIteratorLevel level, int padding, struct Pix *original_image, int *left, int *top)
 
TESS_API BOOL TESS_CALL TessPageIteratorBaseline (const TessPageIterator *handle, TessPageIteratorLevel level, int *x1, int *y1, int *x2, int *y2)
 
TESS_API void TESS_CALL TessPageIteratorOrientation (TessPageIterator *handle, TessOrientation *orientation, TessWritingDirection *writing_direction, TessTextlineOrder *textline_order, float *deskew_angle)
 
TESS_API void TESS_CALL TessPageIteratorParagraphInfo (TessPageIterator *handle, TessParagraphJustification *justification, BOOL *is_list_item, BOOL *is_crown, int *first_line_indent)
 
TESS_API void TESS_CALL TessResultIteratorDelete (TessResultIterator *handle)
 
TESS_API TessResultIterator *TESS_CALL TessResultIteratorCopy (const TessResultIterator *handle)
 
TESS_API TessPageIterator *TESS_CALL TessResultIteratorGetPageIterator (TessResultIterator *handle)
 
TESS_API const TessPageIterator *TESS_CALL TessResultIteratorGetPageIteratorConst (const TessResultIterator *handle)
 
TESS_API TessChoiceIterator *TESS_CALL TessResultIteratorGetChoiceIterator (const TessResultIterator *handle)
 
TESS_API BOOL TESS_CALL TessResultIteratorNext (TessResultIterator *handle, TessPageIteratorLevel level)
 
TESS_API char *TESS_CALL TessResultIteratorGetUTF8Text (const TessResultIterator *handle, TessPageIteratorLevel level)
 
TESS_API float TESS_CALL TessResultIteratorConfidence (const TessResultIterator *handle, TessPageIteratorLevel level)
 
TESS_API const char *TESS_CALL TessResultIteratorWordRecognitionLanguage (const TessResultIterator *handle)
 
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)
 
TESS_API BOOL TESS_CALL TessResultIteratorWordIsFromDictionary (const TessResultIterator *handle)
 
TESS_API BOOL TESS_CALL TessResultIteratorWordIsNumeric (const TessResultIterator *handle)
 
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript (const TessResultIterator *handle)
 
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript (const TessResultIterator *handle)
 
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap (const TessResultIterator *handle)
 
TESS_API void TESS_CALL TessChoiceIteratorDelete (TessChoiceIterator *handle)
 
TESS_API BOOL TESS_CALL TessChoiceIteratorNext (TessChoiceIterator *handle)
 
TESS_API const char *TESS_CALL TessChoiceIteratorGetUTF8Text (const TessChoiceIterator *handle)
 
TESS_API float TESS_CALL TessChoiceIteratorConfidence (const TessChoiceIterator *handle)
 
TESS_API ETEXT_DESC *TESS_CALL TessMonitorCreate ()
 
TESS_API void TESS_CALL TessMonitorDelete (ETEXT_DESC *monitor)
 
TESS_API void TESS_CALL TessMonitorSetCancelFunc (ETEXT_DESC *monitor, TessCancelFunc cancelFunc)
 
TESS_API void TESS_CALL TessMonitorSetCancelThis (ETEXT_DESC *monitor, void *cancelThis)
 
TESS_API void *TESS_CALL TessMonitorGetCancelThis (ETEXT_DESC *monitor)
 
TESS_API void TESS_CALL TessMonitorSetProgressFunc (ETEXT_DESC *monitor, TessProgressFunc progressFunc)
 
TESS_API int TESS_CALL TessMonitorGetProgress (ETEXT_DESC *monitor)
 
TESS_API void TESS_CALL TessMonitorSetDeadlineMSecs (ETEXT_DESC *monitor, int deadline)
 

Macro Definition Documentation

◆ TESS_CAPI_INCLUDE_BASEAPI

#define TESS_CAPI_INCLUDE_BASEAPI

Definition at line 19 of file capi.cpp.

Function Documentation

◆ TessBaseAPIAdaptToWordStr()

TESS_API BOOL TESS_CALL TessBaseAPIAdaptToWordStr ( TessBaseAPI handle,
TessPageSegMode  mode,
const char *  wordstr 
)

Definition at line 504 of file capi.cpp.

505 {
506  return handle->AdaptToWordStr(mode, wordstr) ? TRUE : FALSE;
507 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIAllWordConfidences()

TESS_API int* TESS_CALL TessBaseAPIAllWordConfidences ( TessBaseAPI handle)

Definition at line 498 of file capi.cpp.

499 {
500  return handle->AllWordConfidences();
501 }

◆ TessBaseAPIAnalyseLayout()

TESS_API TessPageIterator* TESS_CALL TessBaseAPIAnalyseLayout ( TessBaseAPI handle)

Definition at line 428 of file capi.cpp.

429 {
430  return handle->AnalyseLayout();
431 }

◆ TessBaseAPIClear()

TESS_API void TESS_CALL TessBaseAPIClear ( TessBaseAPI handle)

Definition at line 510 of file capi.cpp.

511 {
512  handle->Clear();
513 }

◆ TessBaseAPIClearAdaptiveClassifier()

TESS_API void TESS_CALL TessBaseAPIClearAdaptiveClassifier ( TessBaseAPI handle)

Definition at line 342 of file capi.cpp.

343 {
344  handle->ClearAdaptiveClassifier();
345 }

◆ TessBaseAPIClearPersistentCache()

TESS_API void TESS_CALL TessBaseAPIClearPersistentCache ( TessBaseAPI handle)

Definition at line 535 of file capi.cpp.

536 {
537  handle->ClearPersistentCache();
538 }

◆ TessBaseAPICreate()

TESS_API TessBaseAPI* TESS_CALL TessBaseAPICreate ( )

Definition at line 130 of file capi.cpp.

131 {
132  return new TessBaseAPI;
133 }
struct TessBaseAPI TessBaseAPI
Definition: capi.h:89

◆ TessBaseAPIDelete()

TESS_API void TESS_CALL TessBaseAPIDelete ( TessBaseAPI handle)

Definition at line 135 of file capi.cpp.

136 {
137  delete handle;
138 }

◆ TessBaseAPIDetectOrientationScript()

TESS_API BOOL TESS_CALL TessBaseAPIDetectOrientationScript ( TessBaseAPI handle,
int *  orient_deg,
float *  orient_conf,
const char **  script_name,
float *  script_conf 
)

Definition at line 547 of file capi.cpp.

549 {
550  bool success;
551  success = handle->DetectOrientationScript(orient_deg, orient_conf, script_name, script_conf);
552  return (BOOL)success;
553 }
#define BOOL
Definition: capi.h:50

◆ TessBaseAPIEnd()

TESS_API void TESS_CALL TessBaseAPIEnd ( TessBaseAPI handle)

Definition at line 515 of file capi.cpp.

516 {
517  handle->End();
518 }

◆ TessBaseAPIFindLinesCreateBlockList()

TESS_API BLOCK_LIST* TESS_CALL TessBaseAPIFindLinesCreateBlockList ( TessBaseAPI handle)

Definition at line 627 of file capi.cpp.

628 {
629  return handle->FindLinesCreateBlockList();
630 }

◆ TessBaseAPIGetAvailableLanguagesAsVector()

TESS_API char** TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 291 of file capi.cpp.

292 {
293  GenericVector<STRING> languages;
294  handle->GetAvailableLanguagesAsVector(&languages);
295  char** arr = new char*[languages.size() + 1];
296  for (int index = 0; index < languages.size(); ++index)
297  arr[index] = languages[index].strdup();
298  arr[languages.size()] = nullptr;
299  return arr;
300 }
int size() const
Definition: genericvector.h:71

◆ TessBaseAPIGetBoolVariable()

TESS_API BOOL TESS_CALL TessBaseAPIGetBoolVariable ( const TessBaseAPI handle,
const char *  name,
BOOL value 
)

Definition at line 195 of file capi.cpp.

196 {
197  bool boolValue;
198  if (handle->GetBoolVariable(name, &boolValue))
199  {
200  *value = boolValue ? TRUE : FALSE;
201  return TRUE;
202  }
203  else
204  {
205  return FALSE;
206  }
207 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetBoxText()

TESS_API char* TESS_CALL TessBaseAPIGetBoxText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 483 of file capi.cpp.

484 {
485  return handle->GetBoxText(page_number);
486 }

◆ TessBaseAPIGetComponentImages()

TESS_API struct Boxa* TESS_CALL TessBaseAPIGetComponentImages ( TessBaseAPI handle,
TessPageIteratorLevel  level,
BOOL  text_only,
struct Pixa **  pixa,
int **  blockids 
)

Definition at line 410 of file capi.cpp.

411 {
412  return handle->GetComponentImages(level, text_only != FALSE, pixa, blockids);
413 }
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetComponentImages1()

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 at line 416 of file capi.cpp.

419 {
420  return handle->GetComponentImages(level, text_only != FALSE, raw_image, raw_padding, pixa, blockids, paraids);
421 }
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetConnectedComponents()

TESS_API struct Boxa* TESS_CALL TessBaseAPIGetConnectedComponents ( TessBaseAPI handle,
struct Pixa **  cc 
)

Definition at line 405 of file capi.cpp.

406 {
407  return handle->GetConnectedComponents(cc);
408 }

◆ TessBaseAPIGetDatapath()

TESS_API const char* TESS_CALL TessBaseAPIGetDatapath ( TessBaseAPI handle)

Definition at line 170 of file capi.cpp.

171 {
172  return handle->GetDatapath();
173 }

◆ TessBaseAPIGetDawg()

TESS_API const TessDawg* TESS_CALL TessBaseAPIGetDawg ( const TessBaseAPI handle,
int  i 
)

Definition at line 579 of file capi.cpp.

580 {
581  return handle->GetDawg(i);
582 }

◆ TessBaseAPIGetDoubleVariable()

TESS_API BOOL TESS_CALL TessBaseAPIGetDoubleVariable ( const TessBaseAPI handle,
const char *  name,
double *  value 
)

Definition at line 209 of file capi.cpp.

210 {
211  return handle->GetDoubleVariable(name, value) ? TRUE : FALSE;
212 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetFeaturesForBlob()

TESS_API void TESS_CALL TessBaseAPIGetFeaturesForBlob ( TessBaseAPI handle,
TBLOB blob,
INT_FEATURE_STRUCT int_features,
int *  num_features,
int *  FeatureOutlineIndex 
)

Definition at line 555 of file capi.cpp.

557 {
558  handle->GetFeaturesForBlob(blob, int_features, num_features, FeatureOutlineIndex);
559 }

◆ TessBaseAPIGetHOCRText()

TESS_API char* TESS_CALL TessBaseAPIGetHOCRText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 478 of file capi.cpp.

479 {
480  return handle->GetHOCRText(nullptr, page_number);
481 }

◆ TessBaseAPIGetInitLanguagesAsString()

TESS_API const char* TESS_CALL TessBaseAPIGetInitLanguagesAsString ( const TessBaseAPI handle)

Definition at line 275 of file capi.cpp.

276 {
277  return handle->GetInitLanguagesAsString();
278 }

◆ TessBaseAPIGetInputImage()

TESS_API Pix* TESS_CALL TessBaseAPIGetInputImage ( TessBaseAPI handle)

Definition at line 160 of file capi.cpp.

161 {
162  return handle->GetInputImage();
163 }

◆ TessBaseAPIGetInputName()

TESS_API const char* TESS_CALL TessBaseAPIGetInputName ( TessBaseAPI handle)

Definition at line 150 of file capi.cpp.

151 {
152  return handle->GetInputName();
153 }

◆ TessBaseAPIGetIntVariable()

TESS_API BOOL TESS_CALL TessBaseAPIGetIntVariable ( const TessBaseAPI handle,
const char *  name,
int *  value 
)

Definition at line 190 of file capi.cpp.

191 {
192  return handle->GetIntVariable(name, value) ? TRUE : FALSE;
193 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetIterator()

TESS_API TessResultIterator* TESS_CALL TessBaseAPIGetIterator ( TessBaseAPI handle)

Definition at line 463 of file capi.cpp.

464 {
465  return handle->GetIterator();
466 }

◆ TessBaseAPIGetLoadedLanguagesAsVector()

TESS_API char** TESS_CALL TessBaseAPIGetLoadedLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 280 of file capi.cpp.

281 {
282  GenericVector<STRING> languages;
283  handle->GetLoadedLanguagesAsVector(&languages);
284  char** arr = new char*[languages.size() + 1];
285  for (int index = 0; index < languages.size(); ++index)
286  arr[index] = languages[index].strdup();
287  arr[languages.size()] = nullptr;
288  return arr;
289 }
int size() const
Definition: genericvector.h:71

◆ TessBaseAPIGetMutableIterator()

TESS_API TessMutableIterator* TESS_CALL TessBaseAPIGetMutableIterator ( TessBaseAPI handle)

Definition at line 468 of file capi.cpp.

469 {
470  return handle->GetMutableIterator();
471 }

◆ TessBaseAPIGetOpenCLDevice()

TESS_API size_t TESS_CALL TessBaseAPIGetOpenCLDevice ( TessBaseAPI handle,
void **  device 
)

Definition at line 140 of file capi.cpp.

141 {
142  return handle->getOpenCLDevice(device);
143 }

◆ TessBaseAPIGetPageSegMode()

TESS_API TessPageSegMode TESS_CALL TessBaseAPIGetPageSegMode ( const TessBaseAPI handle)

Definition at line 329 of file capi.cpp.

330 {
331  return handle->GetPageSegMode();
332 }

◆ TessBaseAPIGetRegions()

TESS_API struct Boxa* TESS_CALL TessBaseAPIGetRegions ( TessBaseAPI handle,
struct Pixa **  pixa 
)

Definition at line 379 of file capi.cpp.

380 {
381  return handle->GetRegions(pixa);
382 }

◆ TessBaseAPIGetSourceYResolution()

TESS_API int TESS_CALL TessBaseAPIGetSourceYResolution ( TessBaseAPI handle)

Definition at line 165 of file capi.cpp.

166 {
167  return handle->GetSourceYResolution();
168 }

◆ TessBaseAPIGetStringVariable()

TESS_API const char* TESS_CALL TessBaseAPIGetStringVariable ( const TessBaseAPI handle,
const char *  name 
)

Definition at line 214 of file capi.cpp.

215 {
216  return handle->GetStringVariable(name);
217 }

◆ TessBaseAPIGetStrips()

TESS_API struct Boxa* TESS_CALL TessBaseAPIGetStrips ( TessBaseAPI handle,
struct Pixa **  pixa,
int **  blockids 
)

Definition at line 395 of file capi.cpp.

396 {
397  return handle->GetStrips(pixa, blockids);
398 }

◆ TessBaseAPIGetTextDirection()

TESS_API BOOL TESS_CALL TessBaseAPIGetTextDirection ( TessBaseAPI handle,
int *  out_offset,
float *  out_slope 
)

Definition at line 525 of file capi.cpp.

526 {
527  return handle->GetTextDirection(out_offset, out_slope) ? TRUE : FALSE;
528 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetTextlines()

TESS_API struct Boxa* TESS_CALL TessBaseAPIGetTextlines ( TessBaseAPI handle,
struct Pixa **  pixa,
int **  blockids 
)

Definition at line 384 of file capi.cpp.

385 {
386  return handle->GetTextlines(pixa, blockids);
387 }

◆ TessBaseAPIGetTextlines1()

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 at line 389 of file capi.cpp.

391 {
392  return handle->GetTextlines(raw_image, raw_padding, pixa, blockids, paraids);
393 }

◆ TessBaseAPIGetThresholdedImage()

TESS_API struct Pix* TESS_CALL TessBaseAPIGetThresholdedImage ( TessBaseAPI handle)

Definition at line 374 of file capi.cpp.

375 {
376  return handle->GetThresholdedImage();
377 }

◆ TessBaseAPIGetThresholdedImageScaleFactor()

TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor ( const TessBaseAPI handle)

Definition at line 423 of file capi.cpp.

424 {
425  return handle->GetThresholdedImageScaleFactor();
426 }

◆ TessBaseAPIGetUnichar()

TESS_API const char* TESS_CALL TessBaseAPIGetUnichar ( TessBaseAPI handle,
int  unichar_id 
)

Definition at line 574 of file capi.cpp.

575 {
576  return handle->GetUnichar(unichar_id);
577 }

◆ TessBaseAPIGetUNLVText()

TESS_API char* TESS_CALL TessBaseAPIGetUNLVText ( TessBaseAPI handle)

Definition at line 488 of file capi.cpp.

489 {
490  return handle->GetUNLVText();
491 }

◆ TessBaseAPIGetUTF8Text()

TESS_API char* TESS_CALL TessBaseAPIGetUTF8Text ( TessBaseAPI handle)

Definition at line 473 of file capi.cpp.

474 {
475  return handle->GetUTF8Text();
476 }

◆ TessBaseAPIGetVariableAsString()

TESS_API BOOL TESS_CALL TessBaseAPIGetVariableAsString ( TessBaseAPI handle,
const char *  name,
STRING val 
)

Definition at line 236 of file capi.cpp.

237 {
238  return handle->GetVariableAsString(name, val) ? TRUE : FALSE;
239 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetWords()

TESS_API struct Boxa* TESS_CALL TessBaseAPIGetWords ( TessBaseAPI handle,
struct Pixa **  pixa 
)

Definition at line 400 of file capi.cpp.

401 {
402  return handle->GetWords(pixa);
403 }

◆ TessBaseAPIInit1()

TESS_API int TESS_CALL TessBaseAPIInit1 ( TessBaseAPI handle,
const char *  datapath,
const char *  language,
TessOcrEngineMode  oem,
char **  configs,
int  configs_size 
)

Definition at line 259 of file capi.cpp.

261 {
262  return handle->Init(datapath, language, oem, configs, configs_size, nullptr, nullptr, false);
263 }

◆ TessBaseAPIInit2()

TESS_API int TESS_CALL TessBaseAPIInit2 ( TessBaseAPI handle,
const char *  datapath,
const char *  language,
TessOcrEngineMode  oem 
)

Definition at line 265 of file capi.cpp.

266 {
267  return handle->Init(datapath, language, oem);
268 }

◆ TessBaseAPIInit3()

TESS_API int TESS_CALL TessBaseAPIInit3 ( TessBaseAPI handle,
const char *  datapath,
const char *  language 
)

Definition at line 270 of file capi.cpp.

271 {
272  return handle->Init(datapath, language);
273 }

◆ TessBaseAPIInit4()

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 at line 241 of file capi.cpp.

245 {
246  GenericVector<STRING> varNames;
247  GenericVector<STRING> varValues;
248  if (vars_vec != nullptr && vars_values != nullptr) {
249  for (size_t i = 0; i < vars_vec_size; i++) {
250  varNames.push_back(STRING(vars_vec[i]));
251  varValues.push_back(STRING(vars_values[i]));
252  }
253  }
254 
255  return handle->Init(datapath, language, mode, configs, configs_size, &varNames, &varValues, set_only_non_debug_params);
256 }
int push_back(T object)
Definition: strngs.h:45

◆ TessBaseAPIInitForAnalysePage()

TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage ( TessBaseAPI handle)

Definition at line 309 of file capi.cpp.

310 {
311  handle->InitForAnalysePage();
312 }

◆ TessBaseAPIInitLangMod()

TESS_API int TESS_CALL TessBaseAPIInitLangMod ( TessBaseAPI handle,
const char *  datapath,
const char *  language 
)

Definition at line 303 of file capi.cpp.

304 {
305  return handle->InitLangMod(datapath, language);
306 }

◆ TessBaseAPIInitTruthCallback()

TESS_API void TESS_CALL TessBaseAPIInitTruthCallback ( TessBaseAPI handle,
TessTruthCallback *  cb 
)

Definition at line 611 of file capi.cpp.

612 {
613  handle->InitTruthCallback(cb);
614 }

◆ TessBaseAPIIsValidWord()

TESS_API int TESS_CALL TessBaseAPIIsValidWord ( TessBaseAPI handle,
const char *  word 
)

Definition at line 520 of file capi.cpp.

521 {
522  return handle->IsValidWord(word);
523 }

◆ TessBaseAPIMeanTextConf()

TESS_API int TESS_CALL TessBaseAPIMeanTextConf ( TessBaseAPI handle)

Definition at line 493 of file capi.cpp.

494 {
495  return handle->MeanTextConf();
496 }

◆ TessBaseAPINumDawgs()

TESS_API int TESS_CALL TessBaseAPINumDawgs ( const TessBaseAPI handle)

Definition at line 584 of file capi.cpp.

585 {
586  return handle->NumDawgs();
587 }

◆ TessBaseAPIOem()

TESS_API TessOcrEngineMode TESS_CALL TessBaseAPIOem ( const TessBaseAPI handle)

Definition at line 606 of file capi.cpp.

607 {
608  return handle->oem();
609 }

◆ TessBaseAPIPrintVariables()

TESS_API void TESS_CALL TessBaseAPIPrintVariables ( const TessBaseAPI handle,
FILE *  fp 
)

Definition at line 219 of file capi.cpp.

220 {
221  handle->PrintVariables(fp);
222 }

◆ TessBaseAPIPrintVariablesToFile()

TESS_API BOOL TESS_CALL TessBaseAPIPrintVariablesToFile ( const TessBaseAPI handle,
const char *  filename 
)

Definition at line 224 of file capi.cpp.

225 {
226  FILE* fp = fopen(filename, "w");
227  if (fp != nullptr)
228  {
229  handle->PrintVariables(fp);
230  fclose(fp);
231  return TRUE;
232  }
233  return FALSE;
234 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIProcessPage()

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 at line 454 of file capi.cpp.

456 {
457  if (handle->ProcessPage(pix, page_index, filename, retry_config, timeout_millisec, renderer))
458  return TRUE;
459  else
460  return FALSE;
461 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIProcessPages()

TESS_API BOOL TESS_CALL TessBaseAPIProcessPages ( TessBaseAPI handle,
const char *  filename,
const char *  retry_config,
int  timeout_millisec,
TessResultRenderer renderer 
)

Definition at line 445 of file capi.cpp.

447 {
448  if (handle->ProcessPages(filename, retry_config, timeout_millisec, renderer))
449  return TRUE;
450  else
451  return FALSE;
452 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIReadConfigFile()

TESS_API void TESS_CALL TessBaseAPIReadConfigFile ( TessBaseAPI handle,
const char *  filename 
)

Definition at line 314 of file capi.cpp.

315 {
316  handle->ReadConfigFile(filename);
317 }

◆ TessBaseAPIReadDebugConfigFile()

TESS_API void TESS_CALL TessBaseAPIReadDebugConfigFile ( TessBaseAPI handle,
const char *  filename 
)

Definition at line 319 of file capi.cpp.

320 {
321  handle->ReadDebugConfigFile(filename);
322 }

◆ TessBaseAPIRecognize()

TESS_API int TESS_CALL TessBaseAPIRecognize ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 433 of file capi.cpp.

434 {
435  return handle->Recognize(monitor);
436 }

◆ TessBaseAPIRecognizeForChopTest()

TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 439 of file capi.cpp.

440 {
441  return handle->RecognizeForChopTest(monitor);
442 }

◆ TessBaseAPIRect()

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 at line 334 of file capi.cpp.

337 {
338  return handle->TesseractRect(imagedata, bytes_per_pixel, bytes_per_line, left, top, width, height);
339 }

◆ TessBaseAPIRunAdaptiveClassifier()

TESS_API void TESS_CALL TessBaseAPIRunAdaptiveClassifier ( TessBaseAPI handle,
TBLOB blob,
int  num_max_matches,
int *  unichar_ids,
float *  ratings,
int *  num_matches_returned 
)

Definition at line 566 of file capi.cpp.

568 {
569  handle->RunAdaptiveClassifier(blob, num_max_matches, unichar_ids, ratings, num_matches_returned);
570 }

◆ TessBaseAPISetDebugVariable()

TESS_API BOOL TESS_CALL TessBaseAPISetDebugVariable ( TessBaseAPI handle,
const char *  name,
const char *  value 
)

Definition at line 185 of file capi.cpp.

186 {
187  return handle->SetVariable(name, value) ? TRUE : FALSE;
188 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPISetDictFunc()

TESS_API void TESS_CALL TessBaseAPISetDictFunc ( TessBaseAPI handle,
TessDictFunc  f 
)

Definition at line 530 of file capi.cpp.

531 {
532  handle->SetDictFunc(f);
533 }

◆ TessBaseAPISetImage()

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 at line 348 of file capi.cpp.

350 {
351  handle->SetImage(imagedata, width, height, bytes_per_pixel, bytes_per_line);
352 }

◆ TessBaseAPISetImage2()

TESS_API void TESS_CALL TessBaseAPISetImage2 ( TessBaseAPI handle,
struct Pix *  pix 
)

Definition at line 354 of file capi.cpp.

355 {
356  return handle->SetImage(pix);
357 }

◆ TessBaseAPISetInputImage()

TESS_API void TESS_CALL TessBaseAPISetInputImage ( TessBaseAPI handle,
Pix *  pix 
)

Definition at line 155 of file capi.cpp.

156 {
157  handle->SetInputImage(pix);
158 }

◆ TessBaseAPISetInputName()

TESS_API void TESS_CALL TessBaseAPISetInputName ( TessBaseAPI handle,
const char *  name 
)

Definition at line 145 of file capi.cpp.

146 {
147  handle->SetInputName(name);
148 }

◆ TessBaseAPISetMinOrientationMargin()

TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin ( TessBaseAPI handle,
double  margin 
)

Definition at line 616 of file capi.cpp.

617 {
618  handle->set_min_orientation_margin(margin);
619 }

◆ TessBaseAPISetOutputName()

TESS_API void TESS_CALL TessBaseAPISetOutputName ( TessBaseAPI handle,
const char *  name 
)

Definition at line 175 of file capi.cpp.

176 {
177  handle->SetOutputName(name);
178 }

◆ TessBaseAPISetPageSegMode()

TESS_API void TESS_CALL TessBaseAPISetPageSegMode ( TessBaseAPI handle,
TessPageSegMode  mode 
)

Definition at line 324 of file capi.cpp.

325 {
326  handle->SetPageSegMode(mode);
327 }

◆ TessBaseAPISetProbabilityInContextFunc()

TESS_API void TESS_CALL TessBaseAPISetProbabilityInContextFunc ( TessBaseAPI handle,
TessProbabilityInContextFunc  f 
)

Definition at line 540 of file capi.cpp.

541 {
542  handle->SetProbabilityInContextFunc(f);
543 }

◆ TessBaseAPISetRectangle()

TESS_API void TESS_CALL TessBaseAPISetRectangle ( TessBaseAPI handle,
int  left,
int  top,
int  width,
int  height 
)

Definition at line 364 of file capi.cpp.

365 {
366  handle->SetRectangle(left, top, width, height);
367 }

◆ TessBaseAPISetSourceResolution()

TESS_API void TESS_CALL TessBaseAPISetSourceResolution ( TessBaseAPI handle,
int  ppi 
)

Definition at line 359 of file capi.cpp.

360 {
361  handle->SetSourceResolution(ppi);
362 }

◆ TessBaseAPISetThresholder()

TESS_API void TESS_CALL TessBaseAPISetThresholder ( TessBaseAPI handle,
TessImageThresholder *  thresholder 
)

Definition at line 369 of file capi.cpp.

370 {
371  handle->SetThresholder(thresholder);
372 }

◆ TessBaseAPISetVariable()

TESS_API BOOL TESS_CALL TessBaseAPISetVariable ( TessBaseAPI handle,
const char *  name,
const char *  value 
)

Definition at line 180 of file capi.cpp.

181 {
182  return handle->SetVariable(name, value) ? TRUE : FALSE;
183 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseGetBlockTextOrientations()

TESS_API void TESS_CALL TessBaseGetBlockTextOrientations ( TessBaseAPI handle,
int **  block_orientation,
bool **  vertical_writing 
)

Definition at line 621 of file capi.cpp.

622 {
623  handle->GetBlockTextOrientations(block_orientation, vertical_writing);
624 }

◆ TessBoxTextRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessBoxTextRendererCreate ( const char *  outputbase)

Definition at line 80 of file capi.cpp.

81 {
82  return new TessBoxTextRenderer(outputbase);
83 }
struct TessBoxTextRenderer TessBoxTextRenderer
Definition: capi.h:88

◆ TessChoiceIteratorConfidence()

TESS_API float TESS_CALL TessChoiceIteratorConfidence ( const TessChoiceIterator handle)

Definition at line 818 of file capi.cpp.

819 {
820  return handle->Confidence();
821 }

◆ TessChoiceIteratorDelete()

TESS_API void TESS_CALL TessChoiceIteratorDelete ( TessChoiceIterator handle)

Definition at line 803 of file capi.cpp.

804 {
805  delete handle;
806 }

◆ TessChoiceIteratorGetUTF8Text()

TESS_API const char* TESS_CALL TessChoiceIteratorGetUTF8Text ( const TessChoiceIterator handle)

Definition at line 813 of file capi.cpp.

814 {
815  return handle->GetUTF8Text();
816 }

◆ TessChoiceIteratorNext()

TESS_API BOOL TESS_CALL TessChoiceIteratorNext ( TessChoiceIterator handle)

Definition at line 808 of file capi.cpp.

809 {
810  return handle->Next();
811 }

◆ TessDeleteBlockList()

TESS_API void TESS_CALL TessDeleteBlockList ( BLOCK_LIST *  block_list)

Definition at line 48 of file capi.cpp.

49 {
50  TessBaseAPI::DeleteBlockList(block_list);
51 }

◆ TessDeleteIntArray()

TESS_API void TESS_CALL TessDeleteIntArray ( int *  arr)

Definition at line 42 of file capi.cpp.

43 {
44  delete [] arr;
45 }

◆ TessDeleteResultRenderer()

TESS_API void TESS_CALL TessDeleteResultRenderer ( TessResultRenderer renderer)

Definition at line 85 of file capi.cpp.

86 {
87  delete renderer;
88 }

◆ TessDeleteText()

TESS_API void TESS_CALL TessDeleteText ( char *  text)

Definition at line 30 of file capi.cpp.

31 {
32  delete [] text;
33 }

◆ TessDeleteTextArray()

TESS_API void TESS_CALL TessDeleteTextArray ( char **  arr)

Definition at line 35 of file capi.cpp.

36 {
37  for (char** pos = arr; *pos != nullptr; ++pos)
38  delete [] *pos;
39  delete [] arr;
40 }

◆ TessFindRowForBox()

TESS_API ROW* TESS_CALL TessFindRowForBox ( BLOCK_LIST *  blocks,
int  left,
int  top,
int  right,
int  bottom 
)

Definition at line 561 of file capi.cpp.

562 {
563  return TessBaseAPI::FindRowForBox(blocks, left, top, right, bottom);
564 }

◆ TessHOcrRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate ( const char *  outputbase)

Definition at line 59 of file capi.cpp.

60 {
61  return new TessHOcrRenderer(outputbase);
62 }
struct TessHOcrRenderer TessHOcrRenderer
Definition: capi.h:85

◆ TessHOcrRendererCreate2()

TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate2 ( const char *  outputbase,
BOOL  font_info 
)

Definition at line 64 of file capi.cpp.

65 {
66  return new TessHOcrRenderer(outputbase, font_info);
67 }
struct TessHOcrRenderer TessHOcrRenderer
Definition: capi.h:85

◆ TessMakeTBLOB()

TESS_API TBLOB* TESS_CALL TessMakeTBLOB ( struct Pix *  pix)

Definition at line 595 of file capi.cpp.

596 {
597  return TessBaseAPI::MakeTBLOB(pix);
598 }

◆ TessMakeTessOCRRow()

TESS_API ROW* TESS_CALL TessMakeTessOCRRow ( float  baseline,
float  xheight,
float  descender,
float  ascender 
)

Definition at line 590 of file capi.cpp.

591 {
592  return TessBaseAPI::MakeTessOCRRow(baseline, xheight, descender, ascender);
593 }

◆ TessMonitorCreate()

TESS_API ETEXT_DESC* TESS_CALL TessMonitorCreate ( )

Definition at line 823 of file capi.cpp.

824 {
825  return new ETEXT_DESC();
826 }
struct ETEXT_DESC ETEXT_DESC
Definition: capi.h:106

◆ TessMonitorDelete()

TESS_API void TESS_CALL TessMonitorDelete ( ETEXT_DESC monitor)

Definition at line 828 of file capi.cpp.

829 {
830  delete monitor;
831 }

◆ TessMonitorGetCancelThis()

TESS_API void* TESS_CALL TessMonitorGetCancelThis ( ETEXT_DESC monitor)

Definition at line 843 of file capi.cpp.

844 {
845  return monitor->cancel_this;
846 }
void * cancel_this
monitor-aware progress callback
Definition: ocrclass.h:132

◆ TessMonitorGetProgress()

TESS_API int TESS_CALL TessMonitorGetProgress ( ETEXT_DESC monitor)

Definition at line 853 of file capi.cpp.

854 {
855  return monitor->progress;
856 }
int16_t progress
chars in this buffer(0)
Definition: ocrclass.h:122

◆ TessMonitorSetCancelFunc()

TESS_API void TESS_CALL TessMonitorSetCancelFunc ( ETEXT_DESC monitor,
TessCancelFunc  cancelFunc 
)

Definition at line 833 of file capi.cpp.

834 {
835  monitor->cancel = cancelFunc;
836 }
CANCEL_FUNC cancel
for errcode use
Definition: ocrclass.h:129

◆ TessMonitorSetCancelThis()

TESS_API void TESS_CALL TessMonitorSetCancelThis ( ETEXT_DESC monitor,
void *  cancelThis 
)

Definition at line 838 of file capi.cpp.

839 {
840  monitor->cancel_this = cancelThis;
841 }
void * cancel_this
monitor-aware progress callback
Definition: ocrclass.h:132

◆ TessMonitorSetDeadlineMSecs()

TESS_API void TESS_CALL TessMonitorSetDeadlineMSecs ( ETEXT_DESC monitor,
int  deadline 
)

Definition at line 858 of file capi.cpp.

859 {
860  monitor->set_deadline_msecs(deadline);
861 }
void set_deadline_msecs(int32_t deadline_msecs)
Definition: ocrclass.h:152

◆ TessMonitorSetProgressFunc()

TESS_API void TESS_CALL TessMonitorSetProgressFunc ( ETEXT_DESC monitor,
TessProgressFunc  progressFunc 
)

Definition at line 848 of file capi.cpp.

849 {
850  monitor->progress_callback2 = progressFunc;
851 }
PROGRESS_FUNC2 progress_callback2
called whenever progress increases
Definition: ocrclass.h:131

◆ TessNormalizeTBLOB()

TESS_API void TESS_CALL TessNormalizeTBLOB ( TBLOB tblob,
ROW row,
BOOL  numeric_mode 
)

Definition at line 600 of file capi.cpp.

601 {
602  TessBaseAPI::NormalizeTBLOB(tblob, row, numeric_mode != FALSE);
603 }
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorBaseline()

TESS_API BOOL TESS_CALL TessPageIteratorBaseline ( const TessPageIterator handle,
TessPageIteratorLevel  level,
int *  x1,
int *  y1,
int *  x2,
int *  y2 
)

Definition at line 686 of file capi.cpp.

688 {
689  return handle->Baseline(level, x1, y1, x2, y2) ? TRUE : FALSE;
690 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorBegin()

TESS_API void TESS_CALL TessPageIteratorBegin ( TessPageIterator handle)

Definition at line 643 of file capi.cpp.

644 {
645  handle->Begin();
646 }

◆ TessPageIteratorBlockType()

TESS_API TessPolyBlockType TESS_CALL TessPageIteratorBlockType ( const TessPageIterator handle)

Definition at line 670 of file capi.cpp.

671 {
672  return handle->BlockType();
673 }

◆ TessPageIteratorBoundingBox()

TESS_API BOOL TESS_CALL TessPageIteratorBoundingBox ( const TessPageIterator handle,
TessPageIteratorLevel  level,
int *  left,
int *  top,
int *  right,
int *  bottom 
)

Definition at line 664 of file capi.cpp.

666 {
667  return handle->BoundingBox(level, left, top, right, bottom) ? TRUE : FALSE;
668 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorCopy()

TESS_API TessPageIterator* TESS_CALL TessPageIteratorCopy ( const TessPageIterator handle)

Definition at line 638 of file capi.cpp.

639 {
640  return new TessPageIterator(*handle);
641 }
struct TessPageIterator TessPageIterator
Definition: capi.h:90

◆ TessPageIteratorDelete()

TESS_API void TESS_CALL TessPageIteratorDelete ( TessPageIterator handle)

Definition at line 633 of file capi.cpp.

634 {
635  delete handle;
636 }

◆ TessPageIteratorGetBinaryImage()

TESS_API struct Pix* TESS_CALL TessPageIteratorGetBinaryImage ( const TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 675 of file capi.cpp.

676 {
677  return handle->GetBinaryImage(level);
678 }

◆ TessPageIteratorGetImage()

TESS_API struct Pix* TESS_CALL TessPageIteratorGetImage ( const TessPageIterator handle,
TessPageIteratorLevel  level,
int  padding,
struct Pix *  original_image,
int *  left,
int *  top 
)

Definition at line 680 of file capi.cpp.

682 {
683  return handle->GetImage(level, padding, original_image, left, top);
684 }

◆ TessPageIteratorIsAtBeginningOf()

TESS_API BOOL TESS_CALL TessPageIteratorIsAtBeginningOf ( const TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 653 of file capi.cpp.

654 {
655  return handle->IsAtBeginningOf(level) ? TRUE : FALSE;
656 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorIsAtFinalElement()

TESS_API BOOL TESS_CALL TessPageIteratorIsAtFinalElement ( const TessPageIterator handle,
TessPageIteratorLevel  level,
TessPageIteratorLevel  element 
)

Definition at line 658 of file capi.cpp.

660 {
661  return handle->IsAtFinalElement(level, element) ? TRUE : FALSE;
662 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorNext()

TESS_API BOOL TESS_CALL TessPageIteratorNext ( TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 648 of file capi.cpp.

649 {
650  return handle->Next(level) ? TRUE : FALSE;
651 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorOrientation()

TESS_API void TESS_CALL TessPageIteratorOrientation ( TessPageIterator handle,
TessOrientation orientation,
TessWritingDirection writing_direction,
TessTextlineOrder textline_order,
float *  deskew_angle 
)

Definition at line 692 of file capi.cpp.

695 {
696  handle->Orientation(orientation, writing_direction, textline_order, deskew_angle);
697 }

◆ TessPageIteratorParagraphInfo()

TESS_API void TESS_CALL TessPageIteratorParagraphInfo ( TessPageIterator handle,
TessParagraphJustification justification,
BOOL is_list_item,
BOOL is_crown,
int *  first_line_indent 
)

Definition at line 699 of file capi.cpp.

701 {
702  bool bool_is_list_item, bool_is_crown;
703  handle->ParagraphInfo(justification, &bool_is_list_item, &bool_is_crown, first_line_indent);
704  if (is_list_item)
705  *is_list_item = bool_is_list_item ? TRUE : FALSE;
706  if (is_crown)
707  *is_crown = bool_is_crown ? TRUE : FALSE;
708 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPDFRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessPDFRendererCreate ( const char *  outputbase,
const char *  datadir,
BOOL  textonly 
)

Definition at line 69 of file capi.cpp.

71 {
72  return new TessPDFRenderer(outputbase, datadir, textonly);
73 }
struct TessPDFRenderer TessPDFRenderer
Definition: capi.h:86

◆ TessResultIteratorConfidence()

TESS_API float TESS_CALL TessResultIteratorConfidence ( const TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 746 of file capi.cpp.

747 {
748  return handle->Confidence(level);
749 }

◆ TessResultIteratorCopy()

TESS_API TessResultIterator* TESS_CALL TessResultIteratorCopy ( const TessResultIterator handle)

Definition at line 716 of file capi.cpp.

717 {
718  return new TessResultIterator(*handle);
719 }
struct TessResultIterator TessResultIterator
Definition: capi.h:91

◆ TessResultIteratorDelete()

TESS_API void TESS_CALL TessResultIteratorDelete ( TessResultIterator handle)

Definition at line 711 of file capi.cpp.

712 {
713  delete handle;
714 }

◆ TessResultIteratorGetChoiceIterator()

TESS_API TessChoiceIterator* TESS_CALL TessResultIteratorGetChoiceIterator ( const TessResultIterator handle)

Definition at line 731 of file capi.cpp.

732 {
733  return new TessChoiceIterator(*handle);
734 }
struct TessChoiceIterator TessChoiceIterator
Definition: capi.h:93

◆ TessResultIteratorGetPageIterator()

TESS_API TessPageIterator* TESS_CALL TessResultIteratorGetPageIterator ( TessResultIterator handle)

Definition at line 721 of file capi.cpp.

722 {
723  return handle;
724 }

◆ TessResultIteratorGetPageIteratorConst()

TESS_API const TessPageIterator* TESS_CALL TessResultIteratorGetPageIteratorConst ( const TessResultIterator handle)

Definition at line 726 of file capi.cpp.

727 {
728  return handle;
729 }

◆ TessResultIteratorGetUTF8Text()

TESS_API char* TESS_CALL TessResultIteratorGetUTF8Text ( const TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 741 of file capi.cpp.

742 {
743  return handle->GetUTF8Text(level);
744 }

◆ TessResultIteratorNext()

TESS_API BOOL TESS_CALL TessResultIteratorNext ( TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 736 of file capi.cpp.

737 {
738  return handle->Next(level);
739 }

◆ TessResultIteratorSymbolIsDropcap()

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap ( const TessResultIterator handle)

Definition at line 798 of file capi.cpp.

799 {
800  return handle->SymbolIsDropcap() ? TRUE : FALSE;
801 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorSymbolIsSubscript()

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript ( const TessResultIterator handle)

Definition at line 793 of file capi.cpp.

794 {
795  return handle->SymbolIsSubscript() ? TRUE : FALSE;
796 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorSymbolIsSuperscript()

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript ( const TessResultIterator handle)

Definition at line 788 of file capi.cpp.

789 {
790  return handle->SymbolIsSuperscript() ? TRUE : FALSE;
791 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorWordFontAttributes()

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 at line 756 of file capi.cpp.

759 {
760  bool bool_is_bold, bool_is_italic, bool_is_underlined, bool_is_monospace, bool_is_serif, bool_is_smallcaps;
761  const char* ret = handle->WordFontAttributes(&bool_is_bold, &bool_is_italic, &bool_is_underlined, &bool_is_monospace, &bool_is_serif,
762  &bool_is_smallcaps, pointsize, font_id);
763  if (is_bold)
764  *is_bold = bool_is_bold ? TRUE : FALSE;
765  if (is_italic)
766  *is_italic = bool_is_italic ? TRUE : FALSE;
767  if (is_underlined)
768  *is_underlined = bool_is_underlined ? TRUE : FALSE;
769  if (is_monospace)
770  *is_monospace = bool_is_monospace ? TRUE : FALSE;
771  if (is_serif)
772  *is_serif = bool_is_serif ? TRUE : FALSE;
773  if (is_smallcaps)
774  *is_smallcaps = bool_is_smallcaps ? TRUE : FALSE;
775  return ret;
776 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorWordIsFromDictionary()

TESS_API BOOL TESS_CALL TessResultIteratorWordIsFromDictionary ( const TessResultIterator handle)

Definition at line 778 of file capi.cpp.

779 {
780  return handle->WordIsFromDictionary() ? TRUE : FALSE;
781 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorWordIsNumeric()

TESS_API BOOL TESS_CALL TessResultIteratorWordIsNumeric ( const TessResultIterator handle)

Definition at line 783 of file capi.cpp.

784 {
785  return handle->WordIsNumeric() ? TRUE : FALSE;
786 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorWordRecognitionLanguage()

TESS_API const char* TESS_CALL TessResultIteratorWordRecognitionLanguage ( const TessResultIterator handle)

Definition at line 751 of file capi.cpp.

752 {
753  return handle->WordRecognitionLanguage();
754 }

◆ TessResultRendererAddImage()

TESS_API BOOL TESS_CALL TessResultRendererAddImage ( TessResultRenderer renderer,
TessBaseAPI api 
)

Definition at line 105 of file capi.cpp.

106 {
107  return renderer->AddImage(api);
108 }

◆ TessResultRendererBeginDocument()

TESS_API BOOL TESS_CALL TessResultRendererBeginDocument ( TessResultRenderer renderer,
const char *  title 
)

Definition at line 100 of file capi.cpp.

101 {
102  return renderer->BeginDocument(title);
103 }

◆ TessResultRendererEndDocument()

TESS_API BOOL TESS_CALL TessResultRendererEndDocument ( TessResultRenderer renderer)

Definition at line 110 of file capi.cpp.

111 {
112  return renderer->EndDocument();
113 }

◆ TessResultRendererExtention()

TESS_API const char* TESS_CALL TessResultRendererExtention ( TessResultRenderer renderer)

Definition at line 115 of file capi.cpp.

116 {
117  return renderer->file_extension();
118 }

◆ TessResultRendererImageNum()

TESS_API int TESS_CALL TessResultRendererImageNum ( TessResultRenderer renderer)

Definition at line 125 of file capi.cpp.

126 {
127  return renderer->imagenum();
128 }

◆ TessResultRendererInsert()

TESS_API void TESS_CALL TessResultRendererInsert ( TessResultRenderer renderer,
TessResultRenderer next 
)

Definition at line 90 of file capi.cpp.

91 {
92  renderer->insert(next);
93 }

◆ TessResultRendererNext()

TESS_API TessResultRenderer* TESS_CALL TessResultRendererNext ( TessResultRenderer renderer)

Definition at line 95 of file capi.cpp.

96 {
97  return renderer->next();
98 }

◆ TessResultRendererTitle()

TESS_API const char* TESS_CALL TessResultRendererTitle ( TessResultRenderer renderer)

Definition at line 120 of file capi.cpp.

121 {
122  return renderer->title();
123 }

◆ TessTextRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessTextRendererCreate ( const char *  outputbase)

Definition at line 54 of file capi.cpp.

55 {
56  return new TessTextRenderer(outputbase);
57 }
struct TessTextRenderer TessTextRenderer
Definition: capi.h:84

◆ TessUnlvRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessUnlvRendererCreate ( const char *  outputbase)

Definition at line 75 of file capi.cpp.

76 {
77  return new TessUnlvRenderer(outputbase);
78 }
struct TessUnlvRenderer TessUnlvRenderer
Definition: capi.h:87

◆ TessVersion()

TESS_API const char* TESS_CALL TessVersion ( )

Definition at line 25 of file capi.cpp.

26 {
27  return TessBaseAPI::Version();
28 }