tesseract  3.05.02
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)
 
TESS_API TessResultRenderer *TESS_CALL TessPDFRendererCreateTextonly (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 void TESS_CALL TessBaseAPIDumpPGM (TessBaseAPI *handle, const char *filename)
 
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 TessBaseAPIDetectOS (TessBaseAPI *handle, OSResults *results)
 
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 TessCubeRecoContext *TESS_CALL TessBaseAPIGetCubeRecoContext (const TessBaseAPI *handle)
 
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)
 

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 505 of file capi.cpp.

506 {
507  return handle->AdaptToWordStr(mode, wordstr) ? TRUE : FALSE;
508 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
CMD_EVENTS mode
Definition: pgedit.cpp:116

◆ TessBaseAPIAllWordConfidences()

TESS_API int* TESS_CALL TessBaseAPIAllWordConfidences ( TessBaseAPI handle)

Definition at line 500 of file capi.cpp.

501 {
502  return handle->AllWordConfidences();
503 }

◆ TessBaseAPIAnalyseLayout()

TESS_API TessPageIterator* TESS_CALL TessBaseAPIAnalyseLayout ( TessBaseAPI handle)

Definition at line 432 of file capi.cpp.

433 {
434  return handle->AnalyseLayout();
435 }

◆ 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 133 of file capi.cpp.

134 {
135  return new TessBaseAPI;
136 }
struct TessBaseAPI TessBaseAPI
Definition: capi.h:86

◆ TessBaseAPIDelete()

TESS_API void TESS_CALL TessBaseAPIDelete ( TessBaseAPI handle)

Definition at line 138 of file capi.cpp.

139 {
140  delete handle;
141 }

◆ 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 550 of file capi.cpp.

552 {
553  bool success;
554  success = handle->DetectOrientationScript(orient_deg, orient_conf, script_name, script_conf);
555  return (BOOL)success;
556 }
#define BOOL
Definition: capi.h:44

◆ TessBaseAPIDetectOS()

TESS_API BOOL TESS_CALL TessBaseAPIDetectOS ( TessBaseAPI handle,
OSResults results 
)

Definition at line 545 of file capi.cpp.

546 {
547  return FALSE; // Unsafe ABI, return FALSE always
548 }
#define FALSE
Definition: capi.h:46

◆ TessBaseAPIDumpPGM()

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

Definition at line 427 of file capi.cpp.

428 {
429  handle->DumpPGM(filename);
430 }

◆ 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 633 of file capi.cpp.

634 {
635  return handle->FindLinesCreateBlockList();
636 }

◆ TessBaseAPIGetAvailableLanguagesAsVector()

TESS_API char** TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 294 of file capi.cpp.

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

◆ TessBaseAPIGetBoolVariable()

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

Definition at line 198 of file capi.cpp.

199 {
200  bool boolValue;
201  if (handle->GetBoolVariable(name, &boolValue))
202  {
203  *value = boolValue ? TRUE : FALSE;
204  return TRUE;
205  }
206  else
207  {
208  return FALSE;
209  }
210 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessBaseAPIGetBoxText()

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

Definition at line 485 of file capi.cpp.

486 {
487  return handle->GetBoxText(page_number);
488 }

◆ TessBaseAPIGetComponentImages()

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

Definition at line 409 of file capi.cpp.

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

◆ 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 415 of file capi.cpp.

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

◆ TessBaseAPIGetConnectedComponents()

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

Definition at line 404 of file capi.cpp.

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

◆ TessBaseAPIGetCubeRecoContext()

TESS_API TessCubeRecoContext* TESS_CALL TessBaseAPIGetCubeRecoContext ( const TessBaseAPI handle)

Definition at line 617 of file capi.cpp.

618 {
619  return handle->GetCubeRecoContext();
620 }

◆ TessBaseAPIGetDatapath()

TESS_API const char* TESS_CALL TessBaseAPIGetDatapath ( TessBaseAPI handle)

Definition at line 173 of file capi.cpp.

174 {
175  return handle->GetDatapath();
176 }

◆ TessBaseAPIGetDawg()

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

Definition at line 581 of file capi.cpp.

582 {
583  return handle->GetDawg(i);
584 }

◆ TessBaseAPIGetDoubleVariable()

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

Definition at line 212 of file capi.cpp.

213 {
214  return handle->GetDoubleVariable(name, value) ? TRUE : FALSE;
215 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessBaseAPIGetFeaturesForBlob()

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

Definition at line 559 of file capi.cpp.

561 {
562  handle->GetFeaturesForBlob(blob, int_features, num_features, FeatureOutlineIndex);
563 }

◆ TessBaseAPIGetHOCRText()

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

Definition at line 480 of file capi.cpp.

481 {
482  return handle->GetHOCRText(NULL, page_number);
483 }

◆ TessBaseAPIGetInitLanguagesAsString()

TESS_API const char* TESS_CALL TessBaseAPIGetInitLanguagesAsString ( const TessBaseAPI handle)

Definition at line 278 of file capi.cpp.

279 {
280  return handle->GetInitLanguagesAsString();
281 }

◆ TessBaseAPIGetInputImage()

TESS_API Pix* TESS_CALL TessBaseAPIGetInputImage ( TessBaseAPI handle)

Definition at line 163 of file capi.cpp.

164 {
165  return handle->GetInputImage();
166 }

◆ TessBaseAPIGetInputName()

TESS_API const char* TESS_CALL TessBaseAPIGetInputName ( TessBaseAPI handle)

Definition at line 153 of file capi.cpp.

154 {
155  return handle->GetInputName();
156 }

◆ TessBaseAPIGetIntVariable()

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

Definition at line 193 of file capi.cpp.

194 {
195  return handle->GetIntVariable(name, value) ? TRUE : FALSE;
196 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessBaseAPIGetIterator()

TESS_API TessResultIterator* TESS_CALL TessBaseAPIGetIterator ( TessBaseAPI handle)

Definition at line 465 of file capi.cpp.

466 {
467  return handle->GetIterator();
468 }

◆ TessBaseAPIGetLoadedLanguagesAsVector()

TESS_API char** TESS_CALL TessBaseAPIGetLoadedLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 283 of file capi.cpp.

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

◆ TessBaseAPIGetMutableIterator()

TESS_API TessMutableIterator* TESS_CALL TessBaseAPIGetMutableIterator ( TessBaseAPI handle)

Definition at line 470 of file capi.cpp.

471 {
472  return handle->GetMutableIterator();
473 }

◆ TessBaseAPIGetOpenCLDevice()

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

Definition at line 143 of file capi.cpp.

144 {
145  return handle->getOpenCLDevice(device);
146 }

◆ TessBaseAPIGetPageSegMode()

TESS_API TessPageSegMode TESS_CALL TessBaseAPIGetPageSegMode ( const TessBaseAPI handle)

Definition at line 330 of file capi.cpp.

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

◆ TessBaseAPIGetRegions()

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

Definition at line 378 of file capi.cpp.

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

◆ TessBaseAPIGetSourceYResolution()

TESS_API int TESS_CALL TessBaseAPIGetSourceYResolution ( TessBaseAPI handle)

Definition at line 168 of file capi.cpp.

169 {
170  return handle->GetSourceYResolution();
171 }

◆ TessBaseAPIGetStringVariable()

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

Definition at line 217 of file capi.cpp.

218 {
219  return handle->GetStringVariable(name);
220 }

◆ TessBaseAPIGetStrips()

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

Definition at line 394 of file capi.cpp.

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

◆ 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:45
#define FALSE
Definition: capi.h:46

◆ TessBaseAPIGetTextlines()

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

Definition at line 383 of file capi.cpp.

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

◆ 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 388 of file capi.cpp.

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

◆ TessBaseAPIGetThresholdedImage()

TESS_API struct Pix* TESS_CALL TessBaseAPIGetThresholdedImage ( TessBaseAPI handle)

Definition at line 373 of file capi.cpp.

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

◆ TessBaseAPIGetThresholdedImageScaleFactor()

TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor ( const TessBaseAPI handle)

Definition at line 422 of file capi.cpp.

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

◆ TessBaseAPIGetUnichar()

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

Definition at line 576 of file capi.cpp.

577 {
578  return handle->GetUnichar(unichar_id);
579 }

◆ TessBaseAPIGetUNLVText()

TESS_API char* TESS_CALL TessBaseAPIGetUNLVText ( TessBaseAPI handle)

Definition at line 490 of file capi.cpp.

491 {
492  return handle->GetUNLVText();
493 }

◆ TessBaseAPIGetUTF8Text()

TESS_API char* TESS_CALL TessBaseAPIGetUTF8Text ( TessBaseAPI handle)

Definition at line 475 of file capi.cpp.

476 {
477  return handle->GetUTF8Text();
478 }

◆ TessBaseAPIGetVariableAsString()

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

Definition at line 239 of file capi.cpp.

240 {
241  return handle->GetVariableAsString(name, val) ? TRUE : FALSE;
242 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessBaseAPIGetWords()

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

Definition at line 399 of file capi.cpp.

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

◆ 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 262 of file capi.cpp.

264 {
265  return handle->Init(datapath, language, oem, configs, configs_size, NULL, NULL, false);
266 }

◆ TessBaseAPIInit2()

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

Definition at line 268 of file capi.cpp.

269 {
270  return handle->Init(datapath, language, oem);
271 }

◆ TessBaseAPIInit3()

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

Definition at line 273 of file capi.cpp.

274 {
275  return handle->Init(datapath, language);
276 }

◆ 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 244 of file capi.cpp.

248 {
249  GenericVector<STRING> varNames;
250  GenericVector<STRING> varValues;
251  if (vars_vec != NULL && vars_values != NULL) {
252  for (size_t i = 0; i < vars_vec_size; i++) {
253  varNames.push_back(STRING(vars_vec[i]));
254  varValues.push_back(STRING(vars_values[i]));
255  }
256  }
257 
258  return handle->Init(datapath, language, mode, configs, configs_size, &varNames, &varValues, set_only_non_debug_params);
259 }
int push_back(T object)
CMD_EVENTS mode
Definition: pgedit.cpp:116
Definition: strngs.h:44

◆ TessBaseAPIInitForAnalysePage()

TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage ( TessBaseAPI handle)

Definition at line 310 of file capi.cpp.

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

◆ TessBaseAPIInitLangMod()

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

Definition at line 305 of file capi.cpp.

306 {
307  return handle->InitLangMod(datapath, language);
308 }

◆ 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 495 of file capi.cpp.

496 {
497  return handle->MeanTextConf();
498 }

◆ TessBaseAPINumDawgs()

TESS_API int TESS_CALL TessBaseAPINumDawgs ( const TessBaseAPI handle)

Definition at line 586 of file capi.cpp.

587 {
588  return handle->NumDawgs();
589 }

◆ 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 222 of file capi.cpp.

223 {
224  handle->PrintVariables(fp);
225 }

◆ TessBaseAPIPrintVariablesToFile()

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

Definition at line 227 of file capi.cpp.

228 {
229  FILE* fp = fopen(filename, "w");
230  if (fp != NULL)
231  {
232  handle->PrintVariables(fp);
233  fclose(fp);
234  return TRUE;
235  }
236  return FALSE;
237 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ 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 456 of file capi.cpp.

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

◆ TessBaseAPIProcessPages()

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

Definition at line 447 of file capi.cpp.

449 {
450  if (handle->ProcessPages(filename, retry_config, timeout_millisec, renderer))
451  return TRUE;
452  else
453  return FALSE;
454 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessBaseAPIReadConfigFile()

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

Definition at line 315 of file capi.cpp.

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

◆ TessBaseAPIReadDebugConfigFile()

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

Definition at line 320 of file capi.cpp.

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

◆ TessBaseAPIRecognize()

TESS_API int TESS_CALL TessBaseAPIRecognize ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 437 of file capi.cpp.

438 {
439  return handle->Recognize(monitor);
440 }

◆ TessBaseAPIRecognizeForChopTest()

TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 442 of file capi.cpp.

443 {
444  return handle->RecognizeForChopTest(monitor);
445 }

◆ 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 335 of file capi.cpp.

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

◆ 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 570 of file capi.cpp.

572 {
573  handle->RunAdaptiveClassifier(blob, num_max_matches, unichar_ids, ratings, num_matches_returned);
574 }

◆ TessBaseAPISetDebugVariable()

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

Definition at line 188 of file capi.cpp.

189 {
190  return handle->SetVariable(name, value) ? TRUE : FALSE;
191 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ 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 347 of file capi.cpp.

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

◆ TessBaseAPISetImage2()

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

Definition at line 353 of file capi.cpp.

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

◆ TessBaseAPISetInputImage()

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

Definition at line 158 of file capi.cpp.

159 {
160  handle->SetInputImage(pix);
161 }

◆ TessBaseAPISetInputName()

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

Definition at line 148 of file capi.cpp.

149 {
150  handle->SetInputName(name);
151 }

◆ TessBaseAPISetMinOrientationMargin()

TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin ( TessBaseAPI handle,
double  margin 
)

Definition at line 623 of file capi.cpp.

624 {
625  handle->set_min_orientation_margin(margin);
626 }

◆ TessBaseAPISetOutputName()

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

Definition at line 178 of file capi.cpp.

179 {
180  handle->SetOutputName(name);
181 }

◆ TessBaseAPISetPageSegMode()

TESS_API void TESS_CALL TessBaseAPISetPageSegMode ( TessBaseAPI handle,
TessPageSegMode  mode 
)

Definition at line 325 of file capi.cpp.

326 {
327  handle->SetPageSegMode(mode);
328 }
CMD_EVENTS mode
Definition: pgedit.cpp:116

◆ 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 363 of file capi.cpp.

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

◆ TessBaseAPISetSourceResolution()

TESS_API void TESS_CALL TessBaseAPISetSourceResolution ( TessBaseAPI handle,
int  ppi 
)

Definition at line 358 of file capi.cpp.

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

◆ TessBaseAPISetThresholder()

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

Definition at line 368 of file capi.cpp.

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

◆ TessBaseAPISetVariable()

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

Definition at line 183 of file capi.cpp.

184 {
185  return handle->SetVariable(name, value) ? TRUE : FALSE;
186 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessBaseGetBlockTextOrientations()

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

Definition at line 628 of file capi.cpp.

629 {
630  handle->GetBlockTextOrientations(block_orientation, vertical_writing);
631 }

◆ TessBoxTextRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessBoxTextRendererCreate ( const char *  outputbase)

Definition at line 83 of file capi.cpp.

84 {
85  return new TessBoxTextRenderer(outputbase);
86 }
struct TessBoxTextRenderer TessBoxTextRenderer
Definition: capi.h:85

◆ TessChoiceIteratorConfidence()

TESS_API float TESS_CALL TessChoiceIteratorConfidence ( const TessChoiceIterator handle)

Definition at line 823 of file capi.cpp.

824 {
825  return handle->Confidence();
826 }

◆ TessChoiceIteratorDelete()

TESS_API void TESS_CALL TessChoiceIteratorDelete ( TessChoiceIterator handle)

Definition at line 808 of file capi.cpp.

809 {
810  delete handle;
811 }

◆ TessChoiceIteratorGetUTF8Text()

TESS_API const char* TESS_CALL TessChoiceIteratorGetUTF8Text ( const TessChoiceIterator handle)

Definition at line 818 of file capi.cpp.

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

◆ TessChoiceIteratorNext()

TESS_API BOOL TESS_CALL TessChoiceIteratorNext ( TessChoiceIterator handle)

Definition at line 813 of file capi.cpp.

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

◆ TessDeleteBlockList()

TESS_API void TESS_CALL TessDeleteBlockList ( BLOCK_LIST *  block_list)

Definition at line 47 of file capi.cpp.

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

◆ 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 88 of file capi.cpp.

89 {
90  delete renderer;
91 }

◆ 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 != NULL; ++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 565 of file capi.cpp.

566 {
567  return TessBaseAPI::FindRowForBox(blocks, left, top, right, bottom);
568 }

◆ TessHOcrRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate ( const char *  outputbase)

Definition at line 57 of file capi.cpp.

58 {
59  return new TessHOcrRenderer(outputbase);
60 }
struct TessHOcrRenderer TessHOcrRenderer
Definition: capi.h:82

◆ TessHOcrRendererCreate2()

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

Definition at line 62 of file capi.cpp.

63 {
64  return new TessHOcrRenderer(outputbase, font_info);
65 }
struct TessHOcrRenderer TessHOcrRenderer
Definition: capi.h:82

◆ TessMakeTBLOB()

TESS_API TBLOB* TESS_CALL TessMakeTBLOB ( struct Pix *  pix)

Definition at line 596 of file capi.cpp.

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

◆ TessMakeTessOCRRow()

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

Definition at line 591 of file capi.cpp.

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

◆ TessNormalizeTBLOB()

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

Definition at line 601 of file capi.cpp.

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

◆ TessPageIteratorBaseline()

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

Definition at line 691 of file capi.cpp.

693 {
694  return handle->Baseline(level, x1, y1, x2, y2) ? TRUE : FALSE;
695 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessPageIteratorBegin()

TESS_API void TESS_CALL TessPageIteratorBegin ( TessPageIterator handle)

Definition at line 648 of file capi.cpp.

649 {
650  handle->Begin();
651 }

◆ TessPageIteratorBlockType()

TESS_API TessPolyBlockType TESS_CALL TessPageIteratorBlockType ( const TessPageIterator handle)

Definition at line 675 of file capi.cpp.

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

◆ TessPageIteratorBoundingBox()

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

Definition at line 669 of file capi.cpp.

671 {
672  return handle->BoundingBox(level, left, top, right, bottom) ? TRUE : FALSE;
673 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessPageIteratorCopy()

TESS_API TessPageIterator* TESS_CALL TessPageIteratorCopy ( const TessPageIterator handle)

Definition at line 643 of file capi.cpp.

644 {
645  return new TessPageIterator(*handle);
646 }
struct TessPageIterator TessPageIterator
Definition: capi.h:87

◆ TessPageIteratorDelete()

TESS_API void TESS_CALL TessPageIteratorDelete ( TessPageIterator handle)

Definition at line 638 of file capi.cpp.

639 {
640  delete handle;
641 }

◆ TessPageIteratorGetBinaryImage()

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

Definition at line 680 of file capi.cpp.

681 {
682  return handle->GetBinaryImage(level);
683 }

◆ 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 685 of file capi.cpp.

687 {
688  return handle->GetImage(level, padding, original_image, left, top);
689 }

◆ TessPageIteratorIsAtBeginningOf()

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

Definition at line 658 of file capi.cpp.

659 {
660  return handle->IsAtBeginningOf(level) ? TRUE : FALSE;
661 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessPageIteratorIsAtFinalElement()

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

Definition at line 663 of file capi.cpp.

665 {
666  return handle->IsAtFinalElement(level, element) ? TRUE : FALSE;
667 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessPageIteratorNext()

TESS_API BOOL TESS_CALL TessPageIteratorNext ( TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 653 of file capi.cpp.

654 {
655  return handle->Next(level) ? TRUE : FALSE;
656 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessPageIteratorOrientation()

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

Definition at line 697 of file capi.cpp.

700 {
701  handle->Orientation(orientation, writing_direction, textline_order, deskew_angle);
702 }

◆ 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 704 of file capi.cpp.

706 {
707  bool bool_is_list_item, bool_is_crown;
708  handle->ParagraphInfo(justification, &bool_is_list_item, &bool_is_crown, first_line_indent);
709  if (is_list_item)
710  *is_list_item = bool_is_list_item ? TRUE : FALSE;
711  if (is_crown)
712  *is_crown = bool_is_crown ? TRUE : FALSE;
713 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessPDFRendererCreate()

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

Definition at line 67 of file capi.cpp.

68 {
69  return new TessPDFRenderer(outputbase, datadir, false);
70 }
struct TessPDFRenderer TessPDFRenderer
Definition: capi.h:83

◆ TessPDFRendererCreateTextonly()

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

Definition at line 72 of file capi.cpp.

74 {
75  return new TessPDFRenderer(outputbase, datadir, textonly);
76 }
struct TessPDFRenderer TessPDFRenderer
Definition: capi.h:83

◆ TessResultIteratorConfidence()

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

Definition at line 751 of file capi.cpp.

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

◆ TessResultIteratorCopy()

TESS_API TessResultIterator* TESS_CALL TessResultIteratorCopy ( const TessResultIterator handle)

Definition at line 721 of file capi.cpp.

722 {
723  return new TessResultIterator(*handle);
724 }
struct TessResultIterator TessResultIterator
Definition: capi.h:88

◆ TessResultIteratorDelete()

TESS_API void TESS_CALL TessResultIteratorDelete ( TessResultIterator handle)

Definition at line 716 of file capi.cpp.

717 {
718  delete handle;
719 }

◆ TessResultIteratorGetChoiceIterator()

TESS_API TessChoiceIterator* TESS_CALL TessResultIteratorGetChoiceIterator ( const TessResultIterator handle)

Definition at line 736 of file capi.cpp.

737 {
738  return new TessChoiceIterator(*handle);
739 }
struct TessChoiceIterator TessChoiceIterator
Definition: capi.h:90

◆ TessResultIteratorGetPageIterator()

TESS_API TessPageIterator* TESS_CALL TessResultIteratorGetPageIterator ( TessResultIterator handle)

Definition at line 726 of file capi.cpp.

727 {
728  return handle;
729 }

◆ TessResultIteratorGetPageIteratorConst()

TESS_API const TessPageIterator* TESS_CALL TessResultIteratorGetPageIteratorConst ( const TessResultIterator handle)

Definition at line 731 of file capi.cpp.

732 {
733  return handle;
734 }

◆ TessResultIteratorGetUTF8Text()

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

Definition at line 746 of file capi.cpp.

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

◆ TessResultIteratorNext()

TESS_API BOOL TESS_CALL TessResultIteratorNext ( TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 741 of file capi.cpp.

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

◆ TessResultIteratorSymbolIsDropcap()

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap ( const TessResultIterator handle)

Definition at line 803 of file capi.cpp.

804 {
805  return handle->SymbolIsDropcap() ? TRUE : FALSE;
806 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessResultIteratorSymbolIsSubscript()

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript ( const TessResultIterator handle)

Definition at line 798 of file capi.cpp.

799 {
800  return handle->SymbolIsSubscript() ? TRUE : FALSE;
801 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessResultIteratorSymbolIsSuperscript()

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript ( const TessResultIterator handle)

Definition at line 793 of file capi.cpp.

794 {
795  return handle->SymbolIsSuperscript() ? TRUE : FALSE;
796 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ 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 761 of file capi.cpp.

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

◆ TessResultIteratorWordIsFromDictionary()

TESS_API BOOL TESS_CALL TessResultIteratorWordIsFromDictionary ( const TessResultIterator handle)

Definition at line 783 of file capi.cpp.

784 {
785  return handle->WordIsFromDictionary() ? TRUE : FALSE;
786 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessResultIteratorWordIsNumeric()

TESS_API BOOL TESS_CALL TessResultIteratorWordIsNumeric ( const TessResultIterator handle)

Definition at line 788 of file capi.cpp.

789 {
790  return handle->WordIsNumeric() ? TRUE : FALSE;
791 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46

◆ TessResultIteratorWordRecognitionLanguage()

TESS_API const char* TESS_CALL TessResultIteratorWordRecognitionLanguage ( const TessResultIterator handle)

Definition at line 756 of file capi.cpp.

757 {
758  return handle->WordRecognitionLanguage();
759 }

◆ TessResultRendererAddImage()

TESS_API BOOL TESS_CALL TessResultRendererAddImage ( TessResultRenderer renderer,
TessBaseAPI api 
)

Definition at line 108 of file capi.cpp.

109 {
110  return renderer->AddImage(api);
111 }

◆ TessResultRendererBeginDocument()

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

Definition at line 103 of file capi.cpp.

104 {
105  return renderer->BeginDocument(title);
106 }

◆ TessResultRendererEndDocument()

TESS_API BOOL TESS_CALL TessResultRendererEndDocument ( TessResultRenderer renderer)

Definition at line 113 of file capi.cpp.

114 {
115  return renderer->EndDocument();
116 }

◆ TessResultRendererExtention()

TESS_API const char* TESS_CALL TessResultRendererExtention ( TessResultRenderer renderer)

Definition at line 118 of file capi.cpp.

119 {
120  return renderer->file_extension();
121 }

◆ TessResultRendererImageNum()

TESS_API int TESS_CALL TessResultRendererImageNum ( TessResultRenderer renderer)

Definition at line 128 of file capi.cpp.

129 {
130  return renderer->imagenum();
131 }

◆ TessResultRendererInsert()

TESS_API void TESS_CALL TessResultRendererInsert ( TessResultRenderer renderer,
TessResultRenderer next 
)

Definition at line 93 of file capi.cpp.

94 {
95  renderer->insert(next);
96 }

◆ TessResultRendererNext()

TESS_API TessResultRenderer* TESS_CALL TessResultRendererNext ( TessResultRenderer renderer)

Definition at line 98 of file capi.cpp.

99 {
100  return renderer->next();
101 }

◆ TessResultRendererTitle()

TESS_API const char* TESS_CALL TessResultRendererTitle ( TessResultRenderer renderer)

Definition at line 123 of file capi.cpp.

124 {
125  return renderer->title();
126 }

◆ TessTextRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessTextRendererCreate ( const char *  outputbase)

Definition at line 52 of file capi.cpp.

53 {
54  return new TessTextRenderer(outputbase);
55 }
struct TessTextRenderer TessTextRenderer
Definition: capi.h:81

◆ TessUnlvRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessUnlvRendererCreate ( const char *  outputbase)

Definition at line 78 of file capi.cpp.

79 {
80  return new TessUnlvRenderer(outputbase);
81 }
struct TessUnlvRenderer TessUnlvRenderer
Definition: capi.h:84

◆ TessVersion()

TESS_API const char* TESS_CALL TessVersion ( )

Definition at line 25 of file capi.cpp.

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