tesseract  5.0.0-alpha-619-ge9db
capi.cpp File Reference

Go to the source code of this file.

Macros

#define TESS_CAPI_INCLUDE_BASEAPI
 

Functions

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

◆ TessAltoRendererCreate()

TessResultRenderer* TessAltoRendererCreate ( const char *  outputbase)

Definition at line 66 of file capi.cpp.

66  {
67  return new tesseract::TessAltoRenderer(outputbase);
68 }

◆ TessBaseAPIAdaptToWordStr()

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

Definition at line 548 of file capi.cpp.

550  {
551  return static_cast<int>(handle->AdaptToWordStr(mode, wordstr));
552 }

◆ TessBaseAPIAllWordConfidences()

int* TessBaseAPIAllWordConfidences ( TessBaseAPI handle)

Definition at line 543 of file capi.cpp.

543  {
544  return handle->AllWordConfidences();
545 }

◆ TessBaseAPIAnalyseLayout()

TessPageIterator* TessBaseAPIAnalyseLayout ( TessBaseAPI handle)

Definition at line 456 of file capi.cpp.

456  {
457  return handle->AnalyseLayout();
458 }

◆ TessBaseAPIClear()

void TessBaseAPIClear ( TessBaseAPI handle)

Definition at line 555 of file capi.cpp.

555  {
556  handle->Clear();
557 }

◆ TessBaseAPIClearAdaptiveClassifier()

void TessBaseAPIClearAdaptiveClassifier ( TessBaseAPI handle)

Definition at line 361 of file capi.cpp.

361  {
362  handle->ClearAdaptiveClassifier();
363 }

◆ TessBaseAPIClearPersistentCache()

void TessBaseAPIClearPersistentCache ( TessBaseAPI )

Definition at line 580 of file capi.cpp.

580  {
581  TessBaseAPI::ClearPersistentCache();
582 }

◆ TessBaseAPICreate()

TessBaseAPI* TessBaseAPICreate ( )

Definition at line 144 of file capi.cpp.

144  {
145  return new TessBaseAPI;
146 }

◆ TessBaseAPIDelete()

void TessBaseAPIDelete ( TessBaseAPI handle)

Definition at line 148 of file capi.cpp.

148  {
149  delete handle;
150 }

◆ TessBaseAPIDetectOrientationScript()

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

Definition at line 591 of file capi.cpp.

593  {
594  bool success;
595  success = handle->DetectOrientationScript(orient_deg, orient_conf,
596  script_name, script_conf);
597  return static_cast<BOOL>(success);
598 }

◆ TessBaseAPIEnd()

void TessBaseAPIEnd ( TessBaseAPI handle)

Definition at line 559 of file capi.cpp.

559  {
560  handle->End();
561 }

◆ TessBaseAPIFindLinesCreateBlockList()

BLOCK_LIST* TessBaseAPIFindLinesCreateBlockList ( TessBaseAPI handle)

Definition at line 672 of file capi.cpp.

672  {
673  return handle->FindLinesCreateBlockList();
674 }

◆ TessBaseAPIGetAltoText()

char* TessBaseAPIGetAltoText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 510 of file capi.cpp.

511  {
512  return handle->GetAltoText(page_number);
513 }

◆ TessBaseAPIGetAvailableLanguagesAsVector()

char** TessBaseAPIGetAvailableLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 307 of file capi.cpp.

307  {
308  GenericVector<STRING> languages;
309  handle->GetAvailableLanguagesAsVector(&languages);
310  char** arr = new char*[languages.size() + 1];
311  for (int index = 0; index < languages.size(); ++index) {
312  arr[index] = languages[index].strdup();
313  }
314  arr[languages.size()] = nullptr;
315  return arr;
316 }

◆ TessBaseAPIGetBoolVariable()

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

Definition at line 206 of file capi.cpp.

208  {
209  bool boolValue;
210  bool result = handle->GetBoolVariable(name, &boolValue);
211  if (result) {
212  *value = static_cast<int>(boolValue);
213  }
214  return static_cast<int>(result);
215 }

◆ TessBaseAPIGetBoxText()

char* TessBaseAPIGetBoxText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 520 of file capi.cpp.

521  {
522  return handle->GetBoxText(page_number);
523 }

◆ TessBaseAPIGetComponentImages()

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

Definition at line 434 of file capi.cpp.

436  {
437  return handle->GetComponentImages(level, static_cast<bool>(text_only), pixa,
438  blockids);
439 }

◆ TessBaseAPIGetComponentImages1()

struct Boxa* 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 441 of file capi.cpp.

444  {
445  return handle->GetComponentImages(level, static_cast<bool>(text_only),
446  raw_image != 0, raw_padding, pixa, blockids,
447  paraids);
448 }

◆ TessBaseAPIGetConnectedComponents()

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

Definition at line 430 of file capi.cpp.

430  {
431  return handle->GetConnectedComponents(cc);
432 }

◆ TessBaseAPIGetDatapath()

const char* TessBaseAPIGetDatapath ( TessBaseAPI handle)

Definition at line 179 of file capi.cpp.

179  {
180  return handle->GetDatapath();
181 }

◆ TessBaseAPIGetDawg()

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

Definition at line 626 of file capi.cpp.

627  {
628  return handle->GetDawg(i);
629 }

◆ TessBaseAPIGetDoubleVariable()

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

Definition at line 217 of file capi.cpp.

219  {
220  return static_cast<int>(handle->GetDoubleVariable(name, value));
221 }

◆ TessBaseAPIGetFeaturesForBlob()

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

Definition at line 600 of file capi.cpp.

602  {
603  handle->GetFeaturesForBlob(blob, int_features, num_features,
604  FeatureOutlineIndex);
605 }

◆ TessBaseAPIGetHOCRText()

char* TessBaseAPIGetHOCRText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 505 of file capi.cpp.

506  {
507  return handle->GetHOCRText(nullptr, page_number);
508 }

◆ TessBaseAPIGetInitLanguagesAsString()

const char* TessBaseAPIGetInitLanguagesAsString ( const TessBaseAPI handle)

Definition at line 290 of file capi.cpp.

290  {
291  return handle->GetInitLanguagesAsString();
292 }

◆ TessBaseAPIGetInputImage()

Pix* TessBaseAPIGetInputImage ( TessBaseAPI handle)

Definition at line 171 of file capi.cpp.

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

◆ TessBaseAPIGetInputName()

const char* TessBaseAPIGetInputName ( TessBaseAPI handle)

Definition at line 162 of file capi.cpp.

162  {
163  return handle->GetInputName();
164 }

◆ TessBaseAPIGetIntVariable()

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

Definition at line 200 of file capi.cpp.

202  {
203  return static_cast<int>(handle->GetIntVariable(name, value));
204 }

◆ TessBaseAPIGetIterator()

TessResultIterator* TessBaseAPIGetIterator ( TessBaseAPI handle)

Definition at line 492 of file capi.cpp.

492  {
493  return handle->GetIterator();
494 }

◆ TessBaseAPIGetLoadedLanguagesAsVector()

char** TessBaseAPIGetLoadedLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 295 of file capi.cpp.

295  {
296  GenericVector<STRING> languages;
297  handle->GetLoadedLanguagesAsVector(&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  }
302  arr[languages.size()] = nullptr;
303  return arr;
304 }

◆ TessBaseAPIGetLSTMBoxText()

char* TessBaseAPIGetLSTMBoxText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 530 of file capi.cpp.

531  {
532  return handle->GetLSTMBoxText(page_number);
533 }

◆ TessBaseAPIGetMutableIterator()

TessMutableIterator* TessBaseAPIGetMutableIterator ( TessBaseAPI handle)

Definition at line 497 of file capi.cpp.

497  {
498  return handle->GetMutableIterator();
499 }

◆ TessBaseAPIGetOpenCLDevice()

size_t TessBaseAPIGetOpenCLDevice ( TessBaseAPI ,
void **  device 
)

Definition at line 152 of file capi.cpp.

153  {
154  return TessBaseAPI::getOpenCLDevice(device);
155 }

◆ TessBaseAPIGetPageSegMode()

TessPageSegMode TessBaseAPIGetPageSegMode ( const TessBaseAPI handle)

Definition at line 346 of file capi.cpp.

346  {
347  return handle->GetPageSegMode();
348 }

◆ TessBaseAPIGetRegions()

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

Definition at line 400 of file capi.cpp.

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

◆ TessBaseAPIGetSourceYResolution()

int TessBaseAPIGetSourceYResolution ( TessBaseAPI handle)

Definition at line 175 of file capi.cpp.

175  {
176  return handle->GetSourceYResolution();
177 }

◆ TessBaseAPIGetStringVariable()

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

Definition at line 224 of file capi.cpp.

224  {
225  return handle->GetStringVariable(name);
226 }

◆ TessBaseAPIGetStrips()

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

Definition at line 418 of file capi.cpp.

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

◆ TessBaseAPIGetTextDirection()

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

Definition at line 568 of file capi.cpp.

570  {
571  return static_cast<int>(handle->GetTextDirection(out_offset, out_slope));
572 }

◆ TessBaseAPIGetTextlines()

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

Definition at line 405 of file capi.cpp.

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

◆ TessBaseAPIGetTextlines1()

struct Boxa* TessBaseAPIGetTextlines1 ( TessBaseAPI handle,
const BOOL  raw_image,
const int  raw_padding,
struct Pixa **  pixa,
int **  blockids,
int **  paraids 
)

Definition at line 411 of file capi.cpp.

413  {
414  return handle->GetTextlines(raw_image != 0, raw_padding, pixa, blockids,
415  paraids);
416 }

◆ TessBaseAPIGetThresholdedImage()

struct Pix* TessBaseAPIGetThresholdedImage ( TessBaseAPI handle)

Definition at line 396 of file capi.cpp.

396  {
397  return handle->GetThresholdedImage();
398 }

◆ TessBaseAPIGetThresholdedImageScaleFactor()

int TessBaseAPIGetThresholdedImageScaleFactor ( const TessBaseAPI handle)

Definition at line 451 of file capi.cpp.

451  {
452  return handle->GetThresholdedImageScaleFactor();
453 }

◆ TessBaseAPIGetTsvText()

char* TessBaseAPIGetTsvText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 515 of file capi.cpp.

516  {
517  return handle->GetTSVText(page_number);
518 }

◆ TessBaseAPIGetUnichar()

const char* TessBaseAPIGetUnichar ( TessBaseAPI handle,
int  unichar_id 
)

Definition at line 621 of file capi.cpp.

622  {
623  return handle->GetUnichar(unichar_id);
624 }

◆ TessBaseAPIGetUNLVText()

char* TessBaseAPIGetUNLVText ( TessBaseAPI handle)

Definition at line 535 of file capi.cpp.

535  {
536  return handle->GetUNLVText();
537 }

◆ TessBaseAPIGetUTF8Text()

char* TessBaseAPIGetUTF8Text ( TessBaseAPI handle)

Definition at line 501 of file capi.cpp.

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

◆ TessBaseAPIGetVariableAsString()

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

Definition at line 244 of file capi.cpp.

246  {
247  return static_cast<int>(handle->GetVariableAsString(name, val));
248 }

◆ TessBaseAPIGetWords()

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

Definition at line 424 of file capi.cpp.

425  {
426  return handle->GetWords(pixa);
427 }

◆ TessBaseAPIGetWordStrBoxText()

char* TessBaseAPIGetWordStrBoxText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 525 of file capi.cpp.

526  {
527  return handle->GetWordStrBoxText(page_number);
528 }

◆ TessBaseAPIInit1()

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

Definition at line 267 of file capi.cpp.

271  {
272  return handle->Init(datapath, language, oem, configs, configs_size, nullptr,
273  nullptr, false);
274 }

◆ TessBaseAPIInit2()

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

Definition at line 276 of file capi.cpp.

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

◆ TessBaseAPIInit3()

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

Definition at line 283 of file capi.cpp.

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

◆ TessBaseAPIInit4()

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

253  {
254  GenericVector<STRING> varNames;
255  GenericVector<STRING> varValues;
256  if (vars_vec != nullptr && vars_values != nullptr) {
257  for (size_t i = 0; i < vars_vec_size; i++) {
258  varNames.push_back(STRING(vars_vec[i]));
259  varValues.push_back(STRING(vars_values[i]));
260  }
261  }
262 
263  return handle->Init(datapath, language, mode, configs, configs_size,
264  &varNames, &varValues, set_only_non_debug_params != 0);
265 }

◆ TessBaseAPIInitForAnalysePage()

void TessBaseAPIInitForAnalysePage ( TessBaseAPI handle)

Definition at line 326 of file capi.cpp.

326  {
327  handle->InitForAnalysePage();
328 }

◆ TessBaseAPIInitLangMod()

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

Definition at line 319 of file capi.cpp.

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

◆ TessBaseAPIInitTruthCallback()

void TessBaseAPIInitTruthCallback ( TessBaseAPI handle,
TessTruthCallback  cb 
)

Definition at line 655 of file capi.cpp.

656  {
657  handle->InitTruthCallback(cb);
658 }

◆ TessBaseAPIIsValidWord()

int TessBaseAPIIsValidWord ( TessBaseAPI handle,
const char *  word 
)

Definition at line 563 of file capi.cpp.

564  {
565  return handle->IsValidWord(word);
566 }

◆ TessBaseAPIMeanTextConf()

int TessBaseAPIMeanTextConf ( TessBaseAPI handle)

Definition at line 539 of file capi.cpp.

539  {
540  return handle->MeanTextConf();
541 }

◆ TessBaseAPINumDawgs()

int TessBaseAPINumDawgs ( const TessBaseAPI handle)

Definition at line 631 of file capi.cpp.

631  {
632  return handle->NumDawgs();
633 }

◆ TessBaseAPIOem()

TessOcrEngineMode TessBaseAPIOem ( const TessBaseAPI handle)

Definition at line 651 of file capi.cpp.

651  {
652  return handle->oem();
653 }

◆ TessBaseAPIPrintVariables()

void TessBaseAPIPrintVariables ( const TessBaseAPI handle,
FILE *  fp 
)

Definition at line 228 of file capi.cpp.

229  {
230  handle->PrintVariables(fp);
231 }

◆ TessBaseAPIPrintVariablesToFile()

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

Definition at line 233 of file capi.cpp.

234  {
235  FILE* fp = fopen(filename, "w");
236  if (fp != nullptr) {
237  handle->PrintVariables(fp);
238  fclose(fp);
239  return TRUE;
240  }
241  return FALSE;
242 }

◆ TessBaseAPIProcessPage()

BOOL TessBaseAPIProcessPage ( TessBaseAPI handle,
struct Pix *  pix,
int  page_index,
const char *  filename,
const char *  retry_config,
int  timeout_millisec,
TessResultRenderer renderer 
)

Definition at line 481 of file capi.cpp.

486  {
487  return static_cast<int>(handle->ProcessPage(
488  pix, page_index, filename, retry_config, timeout_millisec, renderer));
489 }

◆ TessBaseAPIProcessPages()

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

Definition at line 472 of file capi.cpp.

476  {
477  return static_cast<int>(
478  handle->ProcessPages(filename, retry_config, timeout_millisec, renderer));
479 }

◆ TessBaseAPIReadConfigFile()

void TessBaseAPIReadConfigFile ( TessBaseAPI handle,
const char *  filename 
)

Definition at line 330 of file capi.cpp.

331  {
332  handle->ReadConfigFile(filename);
333 }

◆ TessBaseAPIReadDebugConfigFile()

void TessBaseAPIReadDebugConfigFile ( TessBaseAPI handle,
const char *  filename 
)

Definition at line 335 of file capi.cpp.

336  {
337  handle->ReadDebugConfigFile(filename);
338 }

◆ TessBaseAPIRecognize()

int TessBaseAPIRecognize ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 460 of file capi.cpp.

461  {
462  return handle->Recognize(monitor);
463 }

◆ TessBaseAPIRecognizeForChopTest()

int TessBaseAPIRecognizeForChopTest ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 466 of file capi.cpp.

467  {
468  return handle->RecognizeForChopTest(monitor);
469 }

◆ TessBaseAPIRect()

char* 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 350 of file capi.cpp.

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

◆ TessBaseAPIRunAdaptiveClassifier()

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

Definition at line 612 of file capi.cpp.

614  {
615  handle->RunAdaptiveClassifier(blob, num_max_matches, unichar_ids, ratings,
616  num_matches_returned);
617 }

◆ TessBaseAPISetDebugVariable()

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

Definition at line 194 of file capi.cpp.

196  {
197  return static_cast<int>(handle->SetDebugVariable(name, value));
198 }

◆ TessBaseAPISetDictFunc()

void TessBaseAPISetDictFunc ( TessBaseAPI handle,
TessDictFunc  f 
)

Definition at line 574 of file capi.cpp.

575  {
576  handle->SetDictFunc(f);
577 }

◆ TessBaseAPISetImage()

void TessBaseAPISetImage ( TessBaseAPI handle,
const unsigned char *  imagedata,
int  width,
int  height,
int  bytes_per_pixel,
int  bytes_per_line 
)

Definition at line 366 of file capi.cpp.

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

◆ TessBaseAPISetImage2()

void TessBaseAPISetImage2 ( TessBaseAPI handle,
struct Pix *  pix 
)

Definition at line 374 of file capi.cpp.

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

◆ TessBaseAPISetInputImage()

void TessBaseAPISetInputImage ( TessBaseAPI handle,
Pix *  pix 
)

Definition at line 166 of file capi.cpp.

167  {
168  handle->SetInputImage(pix);
169 }

◆ TessBaseAPISetInputName()

void TessBaseAPISetInputName ( TessBaseAPI handle,
const char *  name 
)

Definition at line 157 of file capi.cpp.

158  {
159  handle->SetInputName(name);
160 }

◆ TessBaseAPISetMinOrientationMargin()

void TessBaseAPISetMinOrientationMargin ( TessBaseAPI handle,
double  margin 
)

Definition at line 660 of file capi.cpp.

661  {
662  handle->set_min_orientation_margin(margin);
663 }

◆ TessBaseAPISetOutputName()

void TessBaseAPISetOutputName ( TessBaseAPI handle,
const char *  name 
)

Definition at line 183 of file capi.cpp.

184  {
185  handle->SetOutputName(name);
186 }

◆ TessBaseAPISetPageSegMode()

void TessBaseAPISetPageSegMode ( TessBaseAPI handle,
TessPageSegMode  mode 
)

Definition at line 340 of file capi.cpp.

341  {
342  handle->SetPageSegMode(mode);
343 }

◆ TessBaseAPISetProbabilityInContextFunc()

void TessBaseAPISetProbabilityInContextFunc ( TessBaseAPI handle,
TessProbabilityInContextFunc  f 
)

Definition at line 584 of file capi.cpp.

585  {
586  handle->SetProbabilityInContextFunc(f);
587 }

◆ TessBaseAPISetRectangle()

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

Definition at line 384 of file capi.cpp.

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

◆ TessBaseAPISetSourceResolution()

void TessBaseAPISetSourceResolution ( TessBaseAPI handle,
int  ppi 
)

Definition at line 379 of file capi.cpp.

380  {
381  handle->SetSourceResolution(ppi);
382 }

◆ TessBaseAPISetThresholder()

void TessBaseAPISetThresholder ( TessBaseAPI handle,
TessImageThresholder *  thresholder 
)

Definition at line 390 of file capi.cpp.

391  {
392  handle->SetThresholder(thresholder);
393 }

◆ TessBaseAPISetVariable()

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

Definition at line 188 of file capi.cpp.

190  {
191  return static_cast<int>(handle->SetVariable(name, value));
192 }

◆ TessBaseGetBlockTextOrientations()

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

Definition at line 665 of file capi.cpp.

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

◆ TessBoxTextRendererCreate()

TessResultRenderer* TessBoxTextRendererCreate ( const char *  outputbase)

Definition at line 86 of file capi.cpp.

86  {
87  return new tesseract::TessBoxTextRenderer(outputbase);
88 }

◆ TessChoiceIteratorConfidence()

float TessChoiceIteratorConfidence ( const TessChoiceIterator handle)

Definition at line 875 of file capi.cpp.

875  {
876  return handle->Confidence();
877 }

◆ TessChoiceIteratorDelete()

void TessChoiceIteratorDelete ( TessChoiceIterator handle)

Definition at line 861 of file capi.cpp.

861  {
862  delete handle;
863 }

◆ TessChoiceIteratorGetUTF8Text()

const char* TessChoiceIteratorGetUTF8Text ( const TessChoiceIterator handle)

Definition at line 870 of file capi.cpp.

870  {
871  return handle->GetUTF8Text();
872 }

◆ TessChoiceIteratorNext()

BOOL TessChoiceIteratorNext ( TessChoiceIterator handle)

Definition at line 865 of file capi.cpp.

865  {
866  return static_cast<int>(handle->Next());
867 }

◆ TessDeleteBlockList()

void TessDeleteBlockList ( BLOCK_LIST *  block_list)

Definition at line 45 of file capi.cpp.

45  {
46  TessBaseAPI::DeleteBlockList(block_list);
47 }

◆ TessDeleteIntArray()

void TessDeleteIntArray ( const int *  arr)

Definition at line 40 of file capi.cpp.

40  {
41  delete[] arr;
42 }

◆ TessDeleteResultRenderer()

void TessDeleteResultRenderer ( TessResultRenderer renderer)

Definition at line 100 of file capi.cpp.

100  {
101  delete renderer;
102 }

◆ TessDeleteText()

void TessDeleteText ( const char *  text)

Definition at line 29 of file capi.cpp.

29  {
30  delete[] text;
31 }

◆ TessDeleteTextArray()

void TessDeleteTextArray ( char **  arr)

Definition at line 33 of file capi.cpp.

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

◆ TessFindRowForBox()

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

Definition at line 607 of file capi.cpp.

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

◆ TessHOcrRendererCreate()

TessResultRenderer* TessHOcrRendererCreate ( const char *  outputbase)

Definition at line 56 of file capi.cpp.

56  {
57  return new tesseract::TessHOcrRenderer(outputbase);
58 }

◆ TessHOcrRendererCreate2()

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

Definition at line 61 of file capi.cpp.

61  {
62  return new tesseract::TessHOcrRenderer(outputbase, font_info != 0);
63 }

◆ TessLSTMBoxRendererCreate()

TessResultRenderer* TessLSTMBoxRendererCreate ( const char *  outputbase)

Definition at line 96 of file capi.cpp.

96  {
97  return new tesseract::TessLSTMBoxRenderer(outputbase);
98 }

◆ TessMakeTBLOB()

TBLOB* TessMakeTBLOB ( struct Pix *  pix)

Definition at line 641 of file capi.cpp.

641  {
642  return TessBaseAPI::MakeTBLOB(pix);
643 }

◆ TessMakeTessOCRRow()

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

Definition at line 636 of file capi.cpp.

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

◆ TessMonitorCreate()

ETEXT_DESC* TessMonitorCreate ( )

Definition at line 879 of file capi.cpp.

879  {
880  return new ETEXT_DESC();
881 }

◆ TessMonitorDelete()

void TessMonitorDelete ( ETEXT_DESC monitor)

Definition at line 883 of file capi.cpp.

883  {
884  delete monitor;
885 }

◆ TessMonitorGetCancelThis()

void* TessMonitorGetCancelThis ( ETEXT_DESC monitor)

Definition at line 897 of file capi.cpp.

897  {
898  return monitor->cancel_this;
899 }

◆ TessMonitorGetProgress()

int TessMonitorGetProgress ( ETEXT_DESC monitor)

Definition at line 906 of file capi.cpp.

906  {
907  return monitor->progress;
908 }

◆ TessMonitorSetCancelFunc()

void TessMonitorSetCancelFunc ( ETEXT_DESC monitor,
TessCancelFunc  cancelFunc 
)

Definition at line 887 of file capi.cpp.

888  {
889  monitor->cancel = cancelFunc;
890 }

◆ TessMonitorSetCancelThis()

void TessMonitorSetCancelThis ( ETEXT_DESC monitor,
void *  cancelThis 
)

Definition at line 892 of file capi.cpp.

893  {
894  monitor->cancel_this = cancelThis;
895 }

◆ TessMonitorSetDeadlineMSecs()

void TessMonitorSetDeadlineMSecs ( ETEXT_DESC monitor,
int  deadline 
)

Definition at line 910 of file capi.cpp.

911  {
912  monitor->set_deadline_msecs(deadline);
913 }

◆ TessMonitorSetProgressFunc()

void TessMonitorSetProgressFunc ( ETEXT_DESC monitor,
TessProgressFunc  progressFunc 
)

Definition at line 902 of file capi.cpp.

902  {
903  monitor->progress_callback2 = progressFunc;
904 }

◆ TessNormalizeTBLOB()

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

Definition at line 645 of file capi.cpp.

646  {
647  TessBaseAPI::NormalizeTBLOB(tblob, row, static_cast<bool>(numeric_mode));
648 }

◆ TessPageIteratorBaseline()

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

Definition at line 728 of file capi.cpp.

731  {
732  return static_cast<int>(handle->Baseline(level, x1, y1, x2, y2));
733 }

◆ TessPageIteratorBegin()

void TessPageIteratorBegin ( TessPageIterator handle)

Definition at line 686 of file capi.cpp.

686  {
687  handle->Begin();
688 }

◆ TessPageIteratorBlockType()

TessPolyBlockType TessPageIteratorBlockType ( const TessPageIterator handle)

Definition at line 713 of file capi.cpp.

713  {
714  return handle->BlockType();
715 }

◆ TessPageIteratorBoundingBox()

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

Definition at line 706 of file capi.cpp.

708  {
709  return static_cast<int>(handle->BoundingBox(level, left, top, right, bottom));
710 }

◆ TessPageIteratorCopy()

TessPageIterator* TessPageIteratorCopy ( const TessPageIterator handle)

Definition at line 682 of file capi.cpp.

682  {
683  return new TessPageIterator(*handle);
684 }

◆ TessPageIteratorDelete()

void TessPageIteratorDelete ( TessPageIterator handle)

Definition at line 677 of file capi.cpp.

677  {
678  delete handle;
679 }

◆ TessPageIteratorGetBinaryImage()

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

Definition at line 717 of file capi.cpp.

718  {
719  return handle->GetBinaryImage(level);
720 }

◆ TessPageIteratorGetImage()

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

Definition at line 722 of file capi.cpp.

724  {
725  return handle->GetImage(level, padding, original_image, left, top);
726 }

◆ TessPageIteratorIsAtBeginningOf()

BOOL TessPageIteratorIsAtBeginningOf ( const TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 695 of file capi.cpp.

696  {
697  return static_cast<int>(handle->IsAtBeginningOf(level));
698 }

◆ TessPageIteratorIsAtFinalElement()

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

Definition at line 700 of file capi.cpp.

702  {
703  return static_cast<int>(handle->IsAtFinalElement(level, element));
704 }

◆ TessPageIteratorNext()

BOOL TessPageIteratorNext ( TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 690 of file capi.cpp.

691  {
692  return static_cast<int>(handle->Next(level));
693 }

◆ TessPageIteratorOrientation()

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

Definition at line 735 of file capi.cpp.

738  {
739  handle->Orientation(orientation, writing_direction, textline_order,
740  deskew_angle);
741 }

◆ TessPageIteratorParagraphInfo()

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

Definition at line 743 of file capi.cpp.

745  {
746  bool bool_is_list_item;
747  bool bool_is_crown;
748  handle->ParagraphInfo(justification, &bool_is_list_item, &bool_is_crown,
749  first_line_indent);
750  if (is_list_item != nullptr) {
751  *is_list_item = static_cast<int>(bool_is_list_item);
752  }
753  if (is_crown != nullptr) {
754  *is_crown = static_cast<int>(bool_is_crown);
755  }
756 }

◆ TessPDFRendererCreate()

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

Definition at line 75 of file capi.cpp.

76  {
77  return new tesseract::TessPDFRenderer(outputbase, datadir, textonly != 0);
78 }

◆ TessResultIteratorConfidence()

float TessResultIteratorConfidence ( const TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 792 of file capi.cpp.

793  {
794  return handle->Confidence(level);
795 }

◆ TessResultIteratorCopy()

TessResultIterator* TessResultIteratorCopy ( const TessResultIterator handle)

Definition at line 763 of file capi.cpp.

763  {
764  return new TessResultIterator(*handle);
765 }

◆ TessResultIteratorDelete()

void TessResultIteratorDelete ( TessResultIterator handle)

Definition at line 758 of file capi.cpp.

758  {
759  delete handle;
760 }

◆ TessResultIteratorGetChoiceIterator()

TessChoiceIterator* TessResultIteratorGetChoiceIterator ( const TessResultIterator handle)

Definition at line 778 of file capi.cpp.

778  {
779  return new TessChoiceIterator(*handle);
780 }

◆ TessResultIteratorGetPageIterator()

TessPageIterator* TessResultIteratorGetPageIterator ( TessResultIterator handle)

Definition at line 768 of file capi.cpp.

768  {
769  return handle;
770 }

◆ TessResultIteratorGetPageIteratorConst()

const TessPageIterator* TessResultIteratorGetPageIteratorConst ( const TessResultIterator handle)

Definition at line 773 of file capi.cpp.

773  {
774  return handle;
775 }

◆ TessResultIteratorGetUTF8Text()

char* TessResultIteratorGetUTF8Text ( const TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 787 of file capi.cpp.

788  {
789  return handle->GetUTF8Text(level);
790 }

◆ TessResultIteratorNext()

BOOL TessResultIteratorNext ( TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 782 of file capi.cpp.

783  {
784  return static_cast<int>(handle->Next(level));
785 }

◆ TessResultIteratorSymbolIsDropcap()

BOOL TessResultIteratorSymbolIsDropcap ( const TessResultIterator handle)

Definition at line 857 of file capi.cpp.

857  {
858  return static_cast<int>(handle->SymbolIsDropcap());
859 }

◆ TessResultIteratorSymbolIsSubscript()

BOOL TessResultIteratorSymbolIsSubscript ( const TessResultIterator handle)

Definition at line 852 of file capi.cpp.

852  {
853  return static_cast<int>(handle->SymbolIsSubscript());
854 }

◆ TessResultIteratorSymbolIsSuperscript()

BOOL TessResultIteratorSymbolIsSuperscript ( const TessResultIterator handle)

Definition at line 847 of file capi.cpp.

847  {
848  return static_cast<int>(handle->SymbolIsSuperscript());
849 }

◆ TessResultIteratorWordFontAttributes()

const char* 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 802 of file capi.cpp.

805  {
806  bool bool_is_bold;
807  bool bool_is_italic;
808  bool bool_is_underlined;
809  bool bool_is_monospace;
810  bool bool_is_serif;
811  bool bool_is_smallcaps;
812  const char* ret = handle->WordFontAttributes(
813  &bool_is_bold, &bool_is_italic, &bool_is_underlined, &bool_is_monospace,
814  &bool_is_serif, &bool_is_smallcaps, pointsize, font_id);
815  if (is_bold != nullptr) {
816  *is_bold = static_cast<int>(bool_is_bold);
817  }
818  if (is_italic != nullptr) {
819  *is_italic = static_cast<int>(bool_is_italic);
820  }
821  if (is_underlined != nullptr) {
822  *is_underlined = static_cast<int>(bool_is_underlined);
823  }
824  if (is_monospace != nullptr) {
825  *is_monospace = static_cast<int>(bool_is_monospace);
826  }
827  if (is_serif != nullptr) {
828  *is_serif = static_cast<int>(bool_is_serif);
829  }
830  if (is_smallcaps != nullptr) {
831  *is_smallcaps = static_cast<int>(bool_is_smallcaps);
832  }
833  return ret;
834 }

◆ TessResultIteratorWordIsFromDictionary()

BOOL TessResultIteratorWordIsFromDictionary ( const TessResultIterator handle)

Definition at line 837 of file capi.cpp.

837  {
838  return static_cast<int>(handle->WordIsFromDictionary());
839 }

◆ TessResultIteratorWordIsNumeric()

BOOL TessResultIteratorWordIsNumeric ( const TessResultIterator handle)

Definition at line 842 of file capi.cpp.

842  {
843  return static_cast<int>(handle->WordIsNumeric());
844 }

◆ TessResultIteratorWordRecognitionLanguage()

const char* TessResultIteratorWordRecognitionLanguage ( const TessResultIterator handle)

Definition at line 798 of file capi.cpp.

798  {
799  return handle->WordRecognitionLanguage();
800 }

◆ TessResultRendererAddImage()

BOOL TessResultRendererAddImage ( TessResultRenderer renderer,
TessBaseAPI api 
)

Definition at line 119 of file capi.cpp.

120  {
121  return static_cast<int>(renderer->AddImage(api));
122 }

◆ TessResultRendererBeginDocument()

BOOL TessResultRendererBeginDocument ( TessResultRenderer renderer,
const char *  title 
)

Definition at line 114 of file capi.cpp.

115  {
116  return static_cast<int>(renderer->BeginDocument(title));
117 }

◆ TessResultRendererEndDocument()

BOOL TessResultRendererEndDocument ( TessResultRenderer renderer)

Definition at line 125 of file capi.cpp.

125  {
126  return static_cast<int>(renderer->EndDocument());
127 }

◆ TessResultRendererExtention()

const char* TessResultRendererExtention ( TessResultRenderer renderer)

Definition at line 130 of file capi.cpp.

130  {
131  return renderer->file_extension();
132 }

◆ TessResultRendererImageNum()

int TessResultRendererImageNum ( TessResultRenderer renderer)

Definition at line 140 of file capi.cpp.

140  {
141  return renderer->imagenum();
142 }

◆ TessResultRendererInsert()

void TessResultRendererInsert ( TessResultRenderer renderer,
TessResultRenderer next 
)

Definition at line 104 of file capi.cpp.

105  {
106  renderer->insert(next);
107 }

◆ TessResultRendererNext()

TessResultRenderer* TessResultRendererNext ( TessResultRenderer renderer)

Definition at line 110 of file capi.cpp.

110  {
111  return renderer->next();
112 }

◆ TessResultRendererTitle()

const char* TessResultRendererTitle ( TessResultRenderer renderer)

Definition at line 135 of file capi.cpp.

135  {
136  return renderer->title();
137 }

◆ TessTextRendererCreate()

TessResultRenderer* TessTextRendererCreate ( const char *  outputbase)

Definition at line 51 of file capi.cpp.

51  {
52  return new tesseract::TessTextRenderer(outputbase);
53 }

◆ TessTsvRendererCreate()

TessResultRenderer* TessTsvRendererCreate ( const char *  outputbase)

Definition at line 71 of file capi.cpp.

71  {
72  return new tesseract::TessTsvRenderer(outputbase);
73 }

◆ TessUnlvRendererCreate()

TessResultRenderer* TessUnlvRendererCreate ( const char *  outputbase)

Definition at line 81 of file capi.cpp.

81  {
82  return new tesseract::TessUnlvRenderer(outputbase);
83 }

◆ TessVersion()

const char* TessVersion ( )

Definition at line 25 of file capi.cpp.

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

◆ TessWordStrBoxRendererCreate()

TessResultRenderer* TessWordStrBoxRendererCreate ( const char *  outputbase)

Definition at line 91 of file capi.cpp.

91  {
92  return new tesseract::TessWordStrBoxRenderer(outputbase);
93 }
ETEXT_DESC
struct ETEXT_DESC ETEXT_DESC
Definition: capi.h:147
TessChoiceIterator
struct TessChoiceIterator TessChoiceIterator
Definition: capi.h:76
TessPageIterator
struct TessPageIterator TessPageIterator
Definition: capi.h:73
tesseract::TessTextRenderer
Definition: renderer.h:157
baseline
Definition: mfoutline.h:62
ETEXT_DESC::set_deadline_msecs
void set_deadline_msecs(int32_t deadline_msecs)
Definition: ocrclass.h:121
ETEXT_DESC::progress_callback2
PROGRESS_FUNC2 progress_callback2
called whenever progress increases
Definition: ocrclass.h:108
STRING
Definition: strngs.h:45
tesseract::TessBoxTextRenderer
Definition: renderer.h:275
tesseract::TessPDFRenderer
Definition: renderer.h:215
GenericVector::push_back
int push_back(T object)
Definition: genericvector.h:799
tesseract::TessAltoRenderer
Definition: renderer.h:185
ETEXT_DESC::cancel_this
void * cancel_this
monitor-aware progress callback
Definition: ocrclass.h:109
ETEXT_DESC::progress
int16_t progress
chars in this buffer(0)
Definition: ocrclass.h:98
TessResultIterator
struct TessResultIterator TessResultIterator
Definition: capi.h:74
tesseract::TessLSTMBoxRenderer
Definition: renderer.h:264
GenericVector< STRING >
tesseract::TessWordStrBoxRenderer
Definition: renderer.h:286
tesseract::TessUnlvRenderer
Definition: renderer.h:253
ETEXT_DESC::cancel
CANCEL_FUNC cancel
for errcode use
Definition: ocrclass.h:105
TRUE
#define TRUE
Definition: capi.h:44
tesseract::TessTsvRenderer
Definition: renderer.h:198
FALSE
#define FALSE
Definition: capi.h:45
TessBaseAPI
struct TessBaseAPI TessBaseAPI
Definition: capi.h:72
GenericVector::size
int size() const
Definition: genericvector.h:71
tesseract::TessHOcrRenderer
Definition: renderer.h:168