Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
capi.cpp File Reference
`#include "capi.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 TessBaseAPI *TESS_CALL | TessBaseAPICreate ()
TESS_API void TESS_CALL | TessBaseAPIDelete (TessBaseAPI *handle)
TESS_API void TESS_CALL | TessBaseAPISetInputName (TessBaseAPI *handle, const char *name)
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 | 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, const 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 Pix *TESS_CALL | TessBaseAPIGetThresholdedImage (TessBaseAPI *handle)
TESS_API Boxa *TESS_CALL | TessBaseAPIGetRegions (TessBaseAPI *handle, Pixa **pixa)
TESS_API Boxa *TESS_CALL | TessBaseAPIGetTextlines (TessBaseAPI *handle, Pixa **pixa, int **blockids)
TESS_API BOXA *TESS_CALL | TessBaseAPIGetStrips (TessBaseAPI *handle, PIXA **pixa, int **blockids)
TESS_API Boxa *TESS_CALL | TessBaseAPIGetWords (TessBaseAPI *handle, Pixa **pixa)
TESS_API Boxa *TESS_CALL | TessBaseAPIGetConnectedComponents (TessBaseAPI *handle, Pixa **cc)
TESS_API Boxa *TESS_CALL | TessBaseAPIGetComponentImages (TessBaseAPI *handle, TessPageIteratorLevel level, BOOL text_only, Pixa **pixa, int **blockids)
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 char *TESS_CALL | TessBaseAPIProcessPages (TessBaseAPI *handle, const char *filename, const char *retry_config, int timeout_millisec)
TESS_API char *TESS_CALL | TessBaseAPIProcessPage (TessBaseAPI *handle, Pix *pix, int page_index, const char *filename, const char *retry_config, int timeout_millisec)
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 | TessBaseAPISetProbabilityInContextFunc (TessBaseAPI *handle, TessProbabilityInContextFunc f)
TESS_API BOOL TESS_CALL | TessBaseAPIDetectOS (TessBaseAPI *handle, OSResults *results)
TESS_API void TESS_CALL | TessBaseAPIGetFeaturesForBlob (TessBaseAPI *handle, TBLOB *blob, const DENORM *denorm, INT_FEATURE_ARRAY 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, const DENORM *denorm, 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 (Pix *pix)
TESS_API void TESS_CALL | TessNormalizeTBLOB (TBLOB *tblob, ROW *row, BOOL numeric_mode, DENORM *denorm)
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 Pix *TESS_CALL | TessPageIteratorGetBinaryImage (const TessPageIterator *handle, TessPageIteratorLevel level)
TESS_API Pix *TESS_CALL | TessPageIteratorGetImage (const TessPageIterator *handle, TessPageIteratorLevel level, int padding, 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 | 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 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 | 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)

## Macro Definition Documentation

#define TESS_CAPI_INCLUDE_BASEAPI

Definition at line 2 of file capi.cpp.

## Function Documentation

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

Definition at line 345 of file capi.cpp.

{
return handle->AdaptToWordStr(mode, wordstr) ? TRUE : FALSE;
}

TESS_API int* TESS_CALL TessBaseAPIAllWordConfidences | ( | TessBaseAPI * | handle | ) |

Definition at line 340 of file capi.cpp.

{
return handle->AllWordConfidences();
}

TESS_API TessPageIterator* TESS_CALL TessBaseAPIAnalyseLayout | ( | TessBaseAPI * | handle | ) |

Definition at line 270 of file capi.cpp.

{
return handle->AnalyseLayout();
}

TESS_API void TESS_CALL TessBaseAPIClear | ( | TessBaseAPI * | handle | ) |

Definition at line 350 of file capi.cpp.

{
handle->Clear();
}

TESS_API void TESS_CALL TessBaseAPIClearAdaptiveClassifier | ( | TessBaseAPI * | handle | ) |

Definition at line 194 of file capi.cpp.

{
handle->ClearAdaptiveClassifier();
}

TESS_API TessBaseAPI* TESS_CALL TessBaseAPICreate | ( |  | ) |

Definition at line 33 of file capi.cpp.

{
return new TessBaseAPI;
}

TESS_API void TESS_CALL TessBaseAPIDelete | ( | TessBaseAPI * | handle | ) |

Definition at line 38 of file capi.cpp.

{
delete handle;
}

TESS_API BOOL TESS_CALL TessBaseAPIDetectOS | ( | TessBaseAPI * | handle,
|  | OSResults * | results
| ) |  |

Definition at line 380 of file capi.cpp.

{
return handle->DetectOS(results) ? TRUE : FALSE;
}

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

Definition at line 265 of file capi.cpp.

{
handle->DumpPGM(filename);
}

TESS_API void TESS_CALL TessBaseAPIEnd | ( | TessBaseAPI * | handle | ) |

Definition at line 355 of file capi.cpp.

{
handle->End();
}

TESS_API BLOCK_LIST* TESS_CALL TessBaseAPIFindLinesCreateBlockList | ( | TessBaseAPI * | handle | ) |

Definition at line 457 of file capi.cpp.

{
return handle->FindLinesCreateBlockList();
}

TESS_API char** TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector | ( | const TessBaseAPI * | handle | ) |

Definition at line 146 of file capi.cpp.

{
GenericVector<STRING> languages;
handle->GetAvailableLanguagesAsVector(&languages);
char** arr = new char*[languages.size() + 1];
for (int index = 0; index < languages.size(); ++index)
arr[index] = languages[index].strdup();
arr[languages.size()] = NULL;
return arr;
}

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

Definition at line 68 of file capi.cpp.

{
bool boolValue;
if (handle->GetBoolVariable(name, &boolValue))
{
*value = boolValue ? TRUE : FALSE;
return TRUE;
}
else
{
return FALSE;
}
}

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

Definition at line 325 of file capi.cpp.

{
return handle->GetBoxText(page_number);
}

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

Definition at line 255 of file capi.cpp.

{
return handle->GetComponentImages(level, text_only != FALSE, pixa, blockids);
}

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

Definition at line 250 of file capi.cpp.

{
return handle->GetConnectedComponents(cc);
}

TESS_API TessCubeRecoContext* TESS_CALL TessBaseAPIGetCubeRecoContext | ( | const TessBaseAPI * | handle | ) |

Definition at line 442 of file capi.cpp.

{
return handle->GetCubeRecoContext();
}

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

Definition at line 407 of file capi.cpp.

{
return handle->GetDawg(i);
}

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

Definition at line 82 of file capi.cpp.

{
return handle->GetDoubleVariable(name, value) ? TRUE : FALSE;
}

TESS_API void TESS_CALL TessBaseAPIGetFeaturesForBlob | ( | TessBaseAPI * | handle,
|  | TBLOB * | blob,
|  | const DENORM * | denorm,
|  | INT_FEATURE_ARRAY | int_features,
|  | int * | num_features,
|  | int * | FeatureOutlineIndex
| ) |  |

Definition at line 385 of file capi.cpp.

{
handle->GetFeaturesForBlob(blob, *denorm, int_features, num_features, FeatureOutlineIndex);
}

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

Definition at line 320 of file capi.cpp.

{
return handle->GetHOCRText(page_number);
}

TESS_API const char* TESS_CALL TessBaseAPIGetInitLanguagesAsString | ( | const TessBaseAPI * | handle | ) |

Definition at line 130 of file capi.cpp.

{
return handle->GetInitLanguagesAsString();
}

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

Definition at line 63 of file capi.cpp.

{
return handle->GetIntVariable(name, value) ? TRUE : FALSE;
}

TESS_API TessResultIterator* TESS_CALL TessBaseAPIGetIterator | ( | TessBaseAPI * | handle | ) |

Definition at line 305 of file capi.cpp.

{
return handle->GetIterator();
}

TESS_API char** TESS_CALL TessBaseAPIGetLoadedLanguagesAsVector | ( | const TessBaseAPI * | handle | ) |

Definition at line 135 of file capi.cpp.

{
GenericVector<STRING> languages;
handle->GetLoadedLanguagesAsVector(&languages);
char** arr = new char*[languages.size() + 1];
for (int index = 0; index < languages.size(); ++index)
arr[index] = languages[index].strdup();
arr[languages.size()] = NULL;
return arr;
}

TESS_API TessMutableIterator* TESS_CALL TessBaseAPIGetMutableIterator | ( | TessBaseAPI * | handle | ) |

Definition at line 310 of file capi.cpp.

{
return handle->GetMutableIterator();
}

TESS_API TessPageSegMode TESS_CALL TessBaseAPIGetPageSegMode | ( | const TessBaseAPI * | handle | ) |

Definition at line 182 of file capi.cpp.

{
return handle->GetPageSegMode();
}

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

Definition at line 230 of file capi.cpp.

{
return handle->GetRegions(pixa);
}

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

Definition at line 87 of file capi.cpp.

{
return handle->GetStringVariable(name);
}

TESS_API BOXA* TESS_CALL TessBaseAPIGetStrips | ( | TessBaseAPI * | handle,
|  | PIXA ** | pixa,
|  | int ** | blockids
| ) |  |

Definition at line 240 of file capi.cpp.

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

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

Definition at line 365 of file capi.cpp.

{
return handle->GetTextDirection(out_offset, out_slope) ? TRUE : FALSE;
}

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

Definition at line 235 of file capi.cpp.

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

TESS_API Pix* TESS_CALL TessBaseAPIGetThresholdedImage | ( | TessBaseAPI * | handle | ) |

Definition at line 225 of file capi.cpp.

{
return handle->GetThresholdedImage();
}

TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor | ( | const TessBaseAPI * | handle | ) |

Definition at line 260 of file capi.cpp.

{
return handle->GetThresholdedImageScaleFactor();
}

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

Definition at line 402 of file capi.cpp.

{
return handle->GetUnichar(unichar_id);
}

TESS_API char* TESS_CALL TessBaseAPIGetUNLVText | ( | TessBaseAPI * | handle | ) |

Definition at line 330 of file capi.cpp.

{
return handle->GetUNLVText();
}

TESS_API char* TESS_CALL TessBaseAPIGetUTF8Text | ( | TessBaseAPI * | handle | ) |

Definition at line 315 of file capi.cpp.

{
return handle->GetUTF8Text();
}

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

Definition at line 109 of file capi.cpp.

{
return handle->GetVariableAsString(name, val) ? TRUE : FALSE;
}

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

Definition at line 245 of file capi.cpp.

{
return handle->GetWords(pixa);
}

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

Definition at line 114 of file capi.cpp.

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

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

Definition at line 120 of file capi.cpp.

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

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

Definition at line 125 of file capi.cpp.

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

TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage | ( | TessBaseAPI * | handle | ) |

Definition at line 162 of file capi.cpp.

{
handle->InitForAnalysePage();
}

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

Definition at line 157 of file capi.cpp.

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

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

Definition at line 437 of file capi.cpp.

{
handle->InitTruthCallback(cb);
}

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

Definition at line 360 of file capi.cpp.

{
return handle->IsValidWord(word);
}

TESS_API int TESS_CALL TessBaseAPIMeanTextConf | ( | TessBaseAPI * | handle | ) |

Definition at line 335 of file capi.cpp.

{
return handle->MeanTextConf();
}

TESS_API int TESS_CALL TessBaseAPINumDawgs | ( | const TessBaseAPI * | handle | ) |

Definition at line 412 of file capi.cpp.

{
return handle->NumDawgs();
}

TESS_API TessOcrEngineMode TESS_CALL TessBaseAPIOem | ( | const TessBaseAPI * | handle | ) |

Definition at line 432 of file capi.cpp.

{
return handle->oem();
}

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

Definition at line 92 of file capi.cpp.

{
handle->PrintVariables(fp);
}

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

Definition at line 97 of file capi.cpp.

{
FILE* fp = fopen(filename, "w");
if (fp != NULL)
{
handle->PrintVariables(fp);
fclose(fp);
return TRUE;
}
return FALSE;
}

TESS_API char* TESS_CALL TessBaseAPIProcessPage | ( | TessBaseAPI * | handle,
|  | Pix * | pix,
|  | int | page_index,
|  | const char * | filename,
|  | const char * | retry_config,
|  | int | timeout_millisec
| ) |  |

Definition at line 295 of file capi.cpp.

{
STRING text_out;
if (handle->ProcessPage(pix, page_index, filename, retry_config, timeout_millisec, &text_out))
return text_out.strdup();
else
return NULL;
}

TESS_API char* TESS_CALL TessBaseAPIProcessPages | ( | TessBaseAPI * | handle,
|  | const char * | filename,
|  | const char * | retry_config,
|  | int | timeout_millisec
| ) |  |

Definition at line 285 of file capi.cpp.

{
STRING text_out;
if (handle->ProcessPages(filename, retry_config, timeout_millisec, &text_out))
return text_out.strdup();
else
return NULL;
}

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

Definition at line 167 of file capi.cpp.

{
handle->ReadConfigFile(filename);
}

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

Definition at line 172 of file capi.cpp.

{
handle->ReadDebugConfigFile(filename);
}

TESS_API int TESS_CALL TessBaseAPIRecognize | ( | TessBaseAPI * | handle,
|  | ETEXT_DESC * | monitor
| ) |  |

Definition at line 275 of file capi.cpp.

{
return handle->Recognize(monitor);
}

TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest | ( | TessBaseAPI * | handle,
|  | ETEXT_DESC * | monitor
| ) |  |

Definition at line 280 of file capi.cpp.

{
return handle->RecognizeForChopTest(monitor);
}

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

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

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

Definition at line 396 of file capi.cpp.

{
handle->RunAdaptiveClassifier(blob, *denorm, num_max_matches, unichar_ids, ratings, num_matches_returned);
}

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

Definition at line 58 of file capi.cpp.

{
return handle->SetVariable(name, value) ? TRUE : FALSE;
}

TESS_API void TESS_CALL TessBaseAPISetDictFunc | ( | TessBaseAPI * | handle,
|  | TessDictFunc | f
| ) |  |

Definition at line 370 of file capi.cpp.

{
handle->SetDictFunc(f);
}

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

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

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

Definition at line 205 of file capi.cpp.

{
return handle->SetImage(pix);
}

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

Definition at line 43 of file capi.cpp.

{
handle->SetInputName(name);
}

TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin | ( | TessBaseAPI * | handle,
|  | double | margin
| ) |  |

Definition at line 447 of file capi.cpp.

{
handle->set_min_orientation_margin(margin);
}

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

Definition at line 48 of file capi.cpp.

{
handle->SetOutputName(name);
}

TESS_API void TESS_CALL TessBaseAPISetPageSegMode | ( | TessBaseAPI * | handle,
|  | TessPageSegMode | mode
| ) |  |

Definition at line 177 of file capi.cpp.

{
handle->SetPageSegMode(mode);
}

TESS_API void TESS_CALL TessBaseAPISetProbabilityInContextFunc | ( | TessBaseAPI * | handle,
|  | TessProbabilityInContextFunc | f
| ) |  |

Definition at line 375 of file capi.cpp.

{
handle->SetProbabilityInContextFunc(f);
}

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

Definition at line 215 of file capi.cpp.

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

TESS_API void TESS_CALL TessBaseAPISetSourceResolution | ( | TessBaseAPI * | handle,
|  | int | ppi
| ) |  |

Definition at line 210 of file capi.cpp.

{
handle->SetSourceResolution(ppi);
}

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

Definition at line 220 of file capi.cpp.

{
handle->SetThresholder(thresholder);
}

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

Definition at line 53 of file capi.cpp.

{
return handle->SetVariable(name, value) ? TRUE : FALSE;
}

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

Definition at line 452 of file capi.cpp.

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

TESS_API void TESS_CALL TessDeleteBlockList | ( | BLOCK_LIST * | block_list | ) |

Definition at line 28 of file capi.cpp.

{
TessBaseAPI::DeleteBlockList(block_list);
}

TESS_API void TESS_CALL TessDeleteIntArray | ( | int * | arr | ) |

Definition at line 23 of file capi.cpp.

{
delete [] arr;
}

TESS_API void TESS_CALL TessDeleteText | ( | char * | text | ) |

Definition at line 11 of file capi.cpp.

{
delete [] text;
}

TESS_API void TESS_CALL TessDeleteTextArray | ( | char ** | arr | ) |

Definition at line 16 of file capi.cpp.

{
for (char** pos = arr; *pos != NULL; ++pos)
delete [] *pos;
delete [] arr;
}

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

Definition at line 391 of file capi.cpp.

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

TESS_API TBLOB* TESS_CALL TessMakeTBLOB | ( | Pix * | pix | ) |

Definition at line 422 of file capi.cpp.

{
return TessBaseAPI::MakeTBLOB(pix);
}

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

Definition at line 417 of file capi.cpp.

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

TESS_API void TESS_CALL TessNormalizeTBLOB | ( | TBLOB * | tblob,
|  | ROW * | row,
|  | BOOL | numeric_mode,
|  | DENORM * | denorm
| ) |  |

Definition at line 427 of file capi.cpp.

{
TessBaseAPI::NormalizeTBLOB(tblob, row, numeric_mode != FALSE, denorm);
}

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

Definition at line 515 of file capi.cpp.

{
return handle->Baseline(level, x1, y1, x2, y2) ? TRUE : FALSE;
}

TESS_API void TESS_CALL TessPageIteratorBegin | ( | TessPageIterator * | handle | ) |

Definition at line 472 of file capi.cpp.

{
handle->Begin();
}

TESS_API TessPolyBlockType TESS_CALL TessPageIteratorBlockType | ( | const TessPageIterator * | handle | ) |

Definition at line 499 of file capi.cpp.

{
return handle->BlockType();
}

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

Definition at line 493 of file capi.cpp.

{
return handle->BoundingBox(level, left, top, right, bottom) ? TRUE : FALSE;
}

TESS_API TessPageIterator* TESS_CALL TessPageIteratorCopy | ( | const TessPageIterator * | handle | ) |

Definition at line 467 of file capi.cpp.

{
return new TessPageIterator(*handle);
}

TESS_API void TESS_CALL TessPageIteratorDelete | ( | TessPageIterator * | handle | ) |

Definition at line 462 of file capi.cpp.

{
delete handle;
}

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

Definition at line 504 of file capi.cpp.

{
return handle->GetBinaryImage(level);
}

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

Definition at line 509 of file capi.cpp.

{
return handle->GetImage(level, padding, left, top);
}

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

Definition at line 482 of file capi.cpp.

{
return handle->IsAtBeginningOf(level) ? TRUE : FALSE;
}

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

Definition at line 487 of file capi.cpp.

{
return handle->IsAtFinalElement(level, element) ? TRUE : FALSE;
}

TESS_API BOOL TESS_CALL TessPageIteratorNext | ( | TessPageIterator * | handle,
|  | TessPageIteratorLevel | level
| ) |  |

Definition at line 477 of file capi.cpp.

{
return handle->Next(level) ? TRUE : FALSE;
}

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

Definition at line 521 of file capi.cpp.

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

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

Definition at line 553 of file capi.cpp.

{
return handle->Confidence(level);
}

TESS_API TessResultIterator* TESS_CALL TessResultIteratorCopy | ( | const TessResultIterator * | handle | ) |

Definition at line 533 of file capi.cpp.

{
return static_cast<TessResultIterator*>(new TessPageIterator(*handle));
}

TESS_API void TESS_CALL TessResultIteratorDelete | ( | TessResultIterator * | handle | ) |

Definition at line 528 of file capi.cpp.

{
delete handle;
}

TESS_API TessPageIterator* TESS_CALL TessResultIteratorGetPageIterator | ( | TessResultIterator * | handle | ) |

Definition at line 538 of file capi.cpp.

{
return handle;
}

TESS_API const TessPageIterator* TESS_CALL TessResultIteratorGetPageIteratorConst | ( | const TessResultIterator * | handle | ) |

Definition at line 543 of file capi.cpp.

{
return handle;
}

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

Definition at line 548 of file capi.cpp.

{
return handle->GetUTF8Text(level);
}

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap | ( | const TessResultIterator * | handle | ) |

Definition at line 600 of file capi.cpp.

{
return handle->SymbolIsDropcap() ? TRUE : FALSE;
}

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript | ( | const TessResultIterator * | handle | ) |

Definition at line 595 of file capi.cpp.

{
return handle->SymbolIsSubscript() ? TRUE : FALSE;
}

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript | ( | const TessResultIterator * | handle | ) |

Definition at line 590 of file capi.cpp.

{
return handle->SymbolIsSuperscript() ? TRUE : FALSE;
}

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

{
bool bool_is_bold, bool_is_italic, bool_is_underlined, bool_is_monospace, bool_is_serif, bool_is_smallcaps;
const char* ret = handle->WordFontAttributes(&bool_is_bold, &bool_is_italic, &bool_is_underlined, &bool_is_monospace, &bool_is_serif,
&bool_is_smallcaps, pointsize, font_id);
if (is_bold)
*is_bold = bool_is_bold ? TRUE : FALSE;
if (is_italic)
*is_italic = bool_is_italic ? TRUE : FALSE;
if (is_underlined)
*is_underlined = bool_is_underlined ? TRUE : FALSE;
if (is_monospace)
*is_monospace = bool_is_monospace ? TRUE : FALSE;
if (is_serif)
*is_serif = bool_is_serif ? TRUE : FALSE;
if (is_smallcaps)
*is_smallcaps = bool_is_smallcaps ? TRUE : FALSE;
return ret;
}

TESS_API BOOL TESS_CALL TessResultIteratorWordIsFromDictionary | ( | const TessResultIterator * | handle | ) |

Definition at line 580 of file capi.cpp.

{
return handle->WordIsFromDictionary() ? TRUE : FALSE;
}

TESS_API BOOL TESS_CALL TessResultIteratorWordIsNumeric | ( | const TessResultIterator * | handle | ) |

Definition at line 585 of file capi.cpp.

{
return handle->WordIsNumeric() ? TRUE : FALSE;
}

TESS_API const char* TESS_CALL TessVersion | ( |  | ) |

Definition at line 6 of file capi.cpp.

{
return TessBaseAPI::Version();
}