tesseract  3.05.00
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
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

#define TESS_CAPI_INCLUDE_BASEAPI

Definition at line 19 of file capi.cpp.

Function Documentation

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

Definition at line 499 of file capi.cpp.

500 {
501  return handle->AdaptToWordStr(mode, wordstr) ? TRUE : FALSE;
502 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
CMD_EVENTS mode
Definition: pgedit.cpp:116
TESS_API int* TESS_CALL TessBaseAPIAllWordConfidences ( TessBaseAPI handle)

Definition at line 494 of file capi.cpp.

495 {
496  return handle->AllWordConfidences();
497 }
TESS_API TessPageIterator* TESS_CALL TessBaseAPIAnalyseLayout ( TessBaseAPI handle)

Definition at line 426 of file capi.cpp.

427 {
428  return handle->AnalyseLayout();
429 }
TESS_API void TESS_CALL TessBaseAPIClear ( TessBaseAPI handle)

Definition at line 504 of file capi.cpp.

505 {
506  handle->Clear();
507 }
TESS_API void TESS_CALL TessBaseAPIClearAdaptiveClassifier ( TessBaseAPI handle)

Definition at line 336 of file capi.cpp.

337 {
338  handle->ClearAdaptiveClassifier();
339 }
TESS_API void TESS_CALL TessBaseAPIClearPersistentCache ( TessBaseAPI handle)

Definition at line 529 of file capi.cpp.

530 {
531  handle->ClearPersistentCache();
532 }
TESS_API TessBaseAPI* TESS_CALL TessBaseAPICreate ( )

Definition at line 127 of file capi.cpp.

128 {
129  return new TessBaseAPI;
130 }
struct TessBaseAPI TessBaseAPI
Definition: capi.h:86
TESS_API void TESS_CALL TessBaseAPIDelete ( TessBaseAPI handle)

Definition at line 132 of file capi.cpp.

133 {
134  delete handle;
135 }
TESS_API BOOL TESS_CALL TessBaseAPIDetectOrientationScript ( TessBaseAPI handle,
int *  orient_deg,
float *  orient_conf,
const char **  script_name,
float *  script_conf 
)

Definition at line 544 of file capi.cpp.

546 {
547  bool success;
548  success = handle->DetectOrientationScript(orient_deg, orient_conf, script_name, script_conf);
549  return (BOOL)success;
550 }
#define BOOL
Definition: capi.h:44
TESS_API BOOL TESS_CALL TessBaseAPIDetectOS ( TessBaseAPI handle,
OSResults results 
)

Definition at line 539 of file capi.cpp.

540 {
541  return FALSE; // Unsafe ABI, return FALSE always
542 }
#define FALSE
Definition: capi.h:46
TESS_API void TESS_CALL TessBaseAPIDumpPGM ( TessBaseAPI handle,
const char *  filename 
)

Definition at line 421 of file capi.cpp.

422 {
423  handle->DumpPGM(filename);
424 }
TESS_API void TESS_CALL TessBaseAPIEnd ( TessBaseAPI handle)

Definition at line 509 of file capi.cpp.

510 {
511  handle->End();
512 }
TESS_API BLOCK_LIST* TESS_CALL TessBaseAPIFindLinesCreateBlockList ( TessBaseAPI handle)

Definition at line 627 of file capi.cpp.

628 {
629  return handle->FindLinesCreateBlockList();
630 }
TESS_API char** TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 288 of file capi.cpp.

289 {
290  GenericVector<STRING> languages;
291  handle->GetAvailableLanguagesAsVector(&languages);
292  char** arr = new char*[languages.size() + 1];
293  for (int index = 0; index < languages.size(); ++index)
294  arr[index] = languages[index].strdup();
295  arr[languages.size()] = NULL;
296  return arr;
297 }
int size() const
Definition: genericvector.h:72
TESS_API BOOL TESS_CALL TessBaseAPIGetBoolVariable ( const TessBaseAPI handle,
const char *  name,
BOOL value 
)

Definition at line 192 of file capi.cpp.

193 {
194  bool boolValue;
195  if (handle->GetBoolVariable(name, &boolValue))
196  {
197  *value = boolValue ? TRUE : FALSE;
198  return TRUE;
199  }
200  else
201  {
202  return FALSE;
203  }
204 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API char* TESS_CALL TessBaseAPIGetBoxText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 479 of file capi.cpp.

480 {
481  return handle->GetBoxText(page_number);
482 }
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetComponentImages ( TessBaseAPI handle,
TessPageIteratorLevel  level,
BOOL  text_only,
struct Pixa **  pixa,
int **  blockids 
)

Definition at line 403 of file capi.cpp.

404 {
405  return handle->GetComponentImages(level, text_only != FALSE, pixa, blockids);
406 }
#define FALSE
Definition: capi.h:46
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 409 of file capi.cpp.

412 {
413  return handle->GetComponentImages(level, text_only != FALSE, raw_image, raw_padding, pixa, blockids, paraids);
414 }
#define FALSE
Definition: capi.h:46
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetConnectedComponents ( TessBaseAPI handle,
struct Pixa **  cc 
)

Definition at line 398 of file capi.cpp.

399 {
400  return handle->GetConnectedComponents(cc);
401 }
TESS_API TessCubeRecoContext* TESS_CALL TessBaseAPIGetCubeRecoContext ( const TessBaseAPI handle)

Definition at line 611 of file capi.cpp.

612 {
613  return handle->GetCubeRecoContext();
614 }
TESS_API const char* TESS_CALL TessBaseAPIGetDatapath ( TessBaseAPI handle)

Definition at line 167 of file capi.cpp.

168 {
169  return handle->GetDatapath();
170 }
TESS_API const TessDawg* TESS_CALL TessBaseAPIGetDawg ( const TessBaseAPI handle,
int  i 
)

Definition at line 575 of file capi.cpp.

576 {
577  return handle->GetDawg(i);
578 }
TESS_API BOOL TESS_CALL TessBaseAPIGetDoubleVariable ( const TessBaseAPI handle,
const char *  name,
double *  value 
)

Definition at line 206 of file capi.cpp.

207 {
208  return handle->GetDoubleVariable(name, value) ? TRUE : FALSE;
209 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API void TESS_CALL TessBaseAPIGetFeaturesForBlob ( TessBaseAPI handle,
TBLOB blob,
INT_FEATURE_STRUCT int_features,
int *  num_features,
int *  FeatureOutlineIndex 
)

Definition at line 553 of file capi.cpp.

555 {
556  handle->GetFeaturesForBlob(blob, int_features, num_features, FeatureOutlineIndex);
557 }
TESS_API char* TESS_CALL TessBaseAPIGetHOCRText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 474 of file capi.cpp.

475 {
476  return handle->GetHOCRText(NULL, page_number);
477 }
TESS_API const char* TESS_CALL TessBaseAPIGetInitLanguagesAsString ( const TessBaseAPI handle)

Definition at line 272 of file capi.cpp.

273 {
274  return handle->GetInitLanguagesAsString();
275 }
TESS_API Pix* TESS_CALL TessBaseAPIGetInputImage ( TessBaseAPI handle)

Definition at line 157 of file capi.cpp.

158 {
159  return handle->GetInputImage();
160 }
TESS_API const char* TESS_CALL TessBaseAPIGetInputName ( TessBaseAPI handle)

Definition at line 147 of file capi.cpp.

148 {
149  return handle->GetInputName();
150 }
TESS_API BOOL TESS_CALL TessBaseAPIGetIntVariable ( const TessBaseAPI handle,
const char *  name,
int *  value 
)

Definition at line 187 of file capi.cpp.

188 {
189  return handle->GetIntVariable(name, value) ? TRUE : FALSE;
190 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API TessResultIterator* TESS_CALL TessBaseAPIGetIterator ( TessBaseAPI handle)

Definition at line 459 of file capi.cpp.

460 {
461  return handle->GetIterator();
462 }
TESS_API char** TESS_CALL TessBaseAPIGetLoadedLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 277 of file capi.cpp.

278 {
279  GenericVector<STRING> languages;
280  handle->GetLoadedLanguagesAsVector(&languages);
281  char** arr = new char*[languages.size() + 1];
282  for (int index = 0; index < languages.size(); ++index)
283  arr[index] = languages[index].strdup();
284  arr[languages.size()] = NULL;
285  return arr;
286 }
int size() const
Definition: genericvector.h:72
TESS_API TessMutableIterator* TESS_CALL TessBaseAPIGetMutableIterator ( TessBaseAPI handle)

Definition at line 464 of file capi.cpp.

465 {
466  return handle->GetMutableIterator();
467 }
TESS_API size_t TESS_CALL TessBaseAPIGetOpenCLDevice ( TessBaseAPI handle,
void **  device 
)

Definition at line 137 of file capi.cpp.

138 {
139  return handle->getOpenCLDevice(device);
140 }
TESS_API TessPageSegMode TESS_CALL TessBaseAPIGetPageSegMode ( const TessBaseAPI handle)

Definition at line 324 of file capi.cpp.

325 {
326  return handle->GetPageSegMode();
327 }
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetRegions ( TessBaseAPI handle,
struct Pixa **  pixa 
)

Definition at line 372 of file capi.cpp.

373 {
374  return handle->GetRegions(pixa);
375 }
TESS_API int TESS_CALL TessBaseAPIGetSourceYResolution ( TessBaseAPI handle)

Definition at line 162 of file capi.cpp.

163 {
164  return handle->GetSourceYResolution();
165 }
TESS_API const char* TESS_CALL TessBaseAPIGetStringVariable ( const TessBaseAPI handle,
const char *  name 
)

Definition at line 211 of file capi.cpp.

212 {
213  return handle->GetStringVariable(name);
214 }
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetStrips ( TessBaseAPI handle,
struct Pixa **  pixa,
int **  blockids 
)

Definition at line 388 of file capi.cpp.

389 {
390  return handle->GetStrips(pixa, blockids);
391 }
TESS_API BOOL TESS_CALL TessBaseAPIGetTextDirection ( TessBaseAPI handle,
int *  out_offset,
float *  out_slope 
)

Definition at line 519 of file capi.cpp.

520 {
521  return handle->GetTextDirection(out_offset, out_slope) ? TRUE : FALSE;
522 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetTextlines ( TessBaseAPI handle,
struct Pixa **  pixa,
int **  blockids 
)

Definition at line 377 of file capi.cpp.

378 {
379  return handle->GetTextlines(pixa, blockids);
380 }
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 382 of file capi.cpp.

384 {
385  return handle->GetTextlines(raw_image, raw_padding, pixa, blockids, paraids);
386 }
TESS_API struct Pix* TESS_CALL TessBaseAPIGetThresholdedImage ( TessBaseAPI handle)

Definition at line 367 of file capi.cpp.

368 {
369  return handle->GetThresholdedImage();
370 }
TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor ( const TessBaseAPI handle)

Definition at line 416 of file capi.cpp.

417 {
418  return handle->GetThresholdedImageScaleFactor();
419 }
TESS_API const char* TESS_CALL TessBaseAPIGetUnichar ( TessBaseAPI handle,
int  unichar_id 
)

Definition at line 570 of file capi.cpp.

571 {
572  return handle->GetUnichar(unichar_id);
573 }
TESS_API char* TESS_CALL TessBaseAPIGetUNLVText ( TessBaseAPI handle)

Definition at line 484 of file capi.cpp.

485 {
486  return handle->GetUNLVText();
487 }
TESS_API char* TESS_CALL TessBaseAPIGetUTF8Text ( TessBaseAPI handle)

Definition at line 469 of file capi.cpp.

470 {
471  return handle->GetUTF8Text();
472 }
TESS_API BOOL TESS_CALL TessBaseAPIGetVariableAsString ( TessBaseAPI handle,
const char *  name,
STRING val 
)

Definition at line 233 of file capi.cpp.

234 {
235  return handle->GetVariableAsString(name, val) ? TRUE : FALSE;
236 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API struct Boxa* TESS_CALL TessBaseAPIGetWords ( TessBaseAPI handle,
struct Pixa **  pixa 
)

Definition at line 393 of file capi.cpp.

394 {
395  return handle->GetWords(pixa);
396 }
TESS_API int TESS_CALL TessBaseAPIInit1 ( TessBaseAPI handle,
const char *  datapath,
const char *  language,
TessOcrEngineMode  oem,
char **  configs,
int  configs_size 
)

Definition at line 256 of file capi.cpp.

258 {
259  return handle->Init(datapath, language, oem, configs, configs_size, NULL, NULL, false);
260 }
TESS_API int TESS_CALL TessBaseAPIInit2 ( TessBaseAPI handle,
const char *  datapath,
const char *  language,
TessOcrEngineMode  oem 
)

Definition at line 262 of file capi.cpp.

263 {
264  return handle->Init(datapath, language, oem);
265 }
TESS_API int TESS_CALL TessBaseAPIInit3 ( TessBaseAPI handle,
const char *  datapath,
const char *  language 
)

Definition at line 267 of file capi.cpp.

268 {
269  return handle->Init(datapath, language);
270 }
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 238 of file capi.cpp.

242 {
243  GenericVector<STRING> varNames;
244  GenericVector<STRING> varValues;
245  if (vars_vec != NULL && vars_values != NULL) {
246  for (size_t i = 0; i < vars_vec_size; i++) {
247  varNames.push_back(STRING(vars_vec[i]));
248  varValues.push_back(STRING(vars_values[i]));
249  }
250  }
251 
252  return handle->Init(datapath, language, mode, configs, configs_size, &varNames, &varValues, set_only_non_debug_params);
253 }
Definition: strngs.h:44
CMD_EVENTS mode
Definition: pgedit.cpp:116
int push_back(T object)
TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage ( TessBaseAPI handle)

Definition at line 304 of file capi.cpp.

305 {
306  handle->InitForAnalysePage();
307 }
TESS_API int TESS_CALL TessBaseAPIInitLangMod ( TessBaseAPI handle,
const char *  datapath,
const char *  language 
)

Definition at line 299 of file capi.cpp.

300 {
301  return handle->InitLangMod(datapath, language);
302 }
TESS_API void TESS_CALL TessBaseAPIInitTruthCallback ( TessBaseAPI handle,
TessTruthCallback *  cb 
)

Definition at line 605 of file capi.cpp.

606 {
607  handle->InitTruthCallback(cb);
608 }
TESS_API int TESS_CALL TessBaseAPIIsValidWord ( TessBaseAPI handle,
const char *  word 
)

Definition at line 514 of file capi.cpp.

515 {
516  return handle->IsValidWord(word);
517 }
TESS_API int TESS_CALL TessBaseAPIMeanTextConf ( TessBaseAPI handle)

Definition at line 489 of file capi.cpp.

490 {
491  return handle->MeanTextConf();
492 }
TESS_API int TESS_CALL TessBaseAPINumDawgs ( const TessBaseAPI handle)

Definition at line 580 of file capi.cpp.

581 {
582  return handle->NumDawgs();
583 }
TESS_API TessOcrEngineMode TESS_CALL TessBaseAPIOem ( const TessBaseAPI handle)

Definition at line 600 of file capi.cpp.

601 {
602  return handle->oem();
603 }
TESS_API void TESS_CALL TessBaseAPIPrintVariables ( const TessBaseAPI handle,
FILE *  fp 
)

Definition at line 216 of file capi.cpp.

217 {
218  handle->PrintVariables(fp);
219 }
TESS_API BOOL TESS_CALL TessBaseAPIPrintVariablesToFile ( const TessBaseAPI handle,
const char *  filename 
)

Definition at line 221 of file capi.cpp.

222 {
223  FILE* fp = fopen(filename, "w");
224  if (fp != NULL)
225  {
226  handle->PrintVariables(fp);
227  fclose(fp);
228  return TRUE;
229  }
230  return FALSE;
231 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
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 450 of file capi.cpp.

452 {
453  if (handle->ProcessPage(pix, page_index, filename, retry_config, timeout_millisec, renderer))
454  return TRUE;
455  else
456  return FALSE;
457 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API BOOL TESS_CALL TessBaseAPIProcessPages ( TessBaseAPI handle,
const char *  filename,
const char *  retry_config,
int  timeout_millisec,
TessResultRenderer renderer 
)

Definition at line 441 of file capi.cpp.

443 {
444  if (handle->ProcessPages(filename, retry_config, timeout_millisec, renderer))
445  return TRUE;
446  else
447  return FALSE;
448 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API void TESS_CALL TessBaseAPIReadConfigFile ( TessBaseAPI handle,
const char *  filename 
)

Definition at line 309 of file capi.cpp.

310 {
311  handle->ReadConfigFile(filename);
312 }
TESS_API void TESS_CALL TessBaseAPIReadDebugConfigFile ( TessBaseAPI handle,
const char *  filename 
)

Definition at line 314 of file capi.cpp.

315 {
316  handle->ReadDebugConfigFile(filename);
317 }
TESS_API int TESS_CALL TessBaseAPIRecognize ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 431 of file capi.cpp.

432 {
433  return handle->Recognize(monitor);
434 }
TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 436 of file capi.cpp.

437 {
438  return handle->RecognizeForChopTest(monitor);
439 }
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 329 of file capi.cpp.

332 {
333  return handle->TesseractRect(imagedata, bytes_per_pixel, bytes_per_line, left, top, width, height);
334 }
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 564 of file capi.cpp.

566 {
567  handle->RunAdaptiveClassifier(blob, num_max_matches, unichar_ids, ratings, num_matches_returned);
568 }
TESS_API BOOL TESS_CALL TessBaseAPISetDebugVariable ( TessBaseAPI handle,
const char *  name,
const char *  value 
)

Definition at line 182 of file capi.cpp.

183 {
184  return handle->SetVariable(name, value) ? TRUE : FALSE;
185 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API void TESS_CALL TessBaseAPISetDictFunc ( TessBaseAPI handle,
TessDictFunc  f 
)

Definition at line 524 of file capi.cpp.

525 {
526  handle->SetDictFunc(f);
527 }
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 341 of file capi.cpp.

343 {
344  handle->SetImage(imagedata, width, height, bytes_per_pixel, bytes_per_line);
345 }
TESS_API void TESS_CALL TessBaseAPISetImage2 ( TessBaseAPI handle,
struct Pix *  pix 
)

Definition at line 347 of file capi.cpp.

348 {
349  return handle->SetImage(pix);
350 }
TESS_API void TESS_CALL TessBaseAPISetInputImage ( TessBaseAPI handle,
Pix *  pix 
)

Definition at line 152 of file capi.cpp.

153 {
154  handle->SetInputImage(pix);
155 }
TESS_API void TESS_CALL TessBaseAPISetInputName ( TessBaseAPI handle,
const char *  name 
)

Definition at line 142 of file capi.cpp.

143 {
144  handle->SetInputName(name);
145 }
TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin ( TessBaseAPI handle,
double  margin 
)

Definition at line 617 of file capi.cpp.

618 {
619  handle->set_min_orientation_margin(margin);
620 }
TESS_API void TESS_CALL TessBaseAPISetOutputName ( TessBaseAPI handle,
const char *  name 
)

Definition at line 172 of file capi.cpp.

173 {
174  handle->SetOutputName(name);
175 }
TESS_API void TESS_CALL TessBaseAPISetPageSegMode ( TessBaseAPI handle,
TessPageSegMode  mode 
)

Definition at line 319 of file capi.cpp.

320 {
321  handle->SetPageSegMode(mode);
322 }
CMD_EVENTS mode
Definition: pgedit.cpp:116
TESS_API void TESS_CALL TessBaseAPISetProbabilityInContextFunc ( TessBaseAPI handle,
TessProbabilityInContextFunc  f 
)

Definition at line 534 of file capi.cpp.

535 {
536  handle->SetProbabilityInContextFunc(f);
537 }
TESS_API void TESS_CALL TessBaseAPISetRectangle ( TessBaseAPI handle,
int  left,
int  top,
int  width,
int  height 
)

Definition at line 357 of file capi.cpp.

358 {
359  handle->SetRectangle(left, top, width, height);
360 }
TESS_API void TESS_CALL TessBaseAPISetSourceResolution ( TessBaseAPI handle,
int  ppi 
)

Definition at line 352 of file capi.cpp.

353 {
354  handle->SetSourceResolution(ppi);
355 }
TESS_API void TESS_CALL TessBaseAPISetThresholder ( TessBaseAPI handle,
TessImageThresholder *  thresholder 
)

Definition at line 362 of file capi.cpp.

363 {
364  handle->SetThresholder(thresholder);
365 }
TESS_API BOOL TESS_CALL TessBaseAPISetVariable ( TessBaseAPI handle,
const char *  name,
const char *  value 
)

Definition at line 177 of file capi.cpp.

178 {
179  return handle->SetVariable(name, value) ? TRUE : FALSE;
180 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API void TESS_CALL TessBaseGetBlockTextOrientations ( TessBaseAPI handle,
int **  block_orientation,
bool **  vertical_writing 
)

Definition at line 622 of file capi.cpp.

623 {
624  handle->GetBlockTextOrientations(block_orientation, vertical_writing);
625 }
TESS_API TessResultRenderer* TESS_CALL TessBoxTextRendererCreate ( const char *  outputbase)

Definition at line 77 of file capi.cpp.

78 {
79  return new TessBoxTextRenderer(outputbase);
80 }
struct TessBoxTextRenderer TessBoxTextRenderer
Definition: capi.h:85
TESS_API float TESS_CALL TessChoiceIteratorConfidence ( const TessChoiceIterator handle)

Definition at line 817 of file capi.cpp.

818 {
819  return handle->Confidence();
820 }
TESS_API void TESS_CALL TessChoiceIteratorDelete ( TessChoiceIterator handle)

Definition at line 802 of file capi.cpp.

803 {
804  delete handle;
805 }
TESS_API const char* TESS_CALL TessChoiceIteratorGetUTF8Text ( const TessChoiceIterator handle)

Definition at line 812 of file capi.cpp.

813 {
814  return handle->GetUTF8Text();
815 }
TESS_API BOOL TESS_CALL TessChoiceIteratorNext ( TessChoiceIterator handle)

Definition at line 807 of file capi.cpp.

808 {
809  return handle->Next();
810 }
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 }
TESS_API void TESS_CALL TessDeleteIntArray ( int *  arr)

Definition at line 42 of file capi.cpp.

43 {
44  delete [] arr;
45 }
TESS_API void TESS_CALL TessDeleteResultRenderer ( TessResultRenderer renderer)

Definition at line 82 of file capi.cpp.

83 {
84  delete renderer;
85 }
TESS_API void TESS_CALL TessDeleteText ( char *  text)

Definition at line 30 of file capi.cpp.

31 {
32  delete [] text;
33 }
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 }
TESS_API ROW* TESS_CALL TessFindRowForBox ( BLOCK_LIST *  blocks,
int  left,
int  top,
int  right,
int  bottom 
)

Definition at line 559 of file capi.cpp.

560 {
561  return TessBaseAPI::FindRowForBox(blocks, left, top, right, bottom);
562 }
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
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
TESS_API TBLOB* TESS_CALL TessMakeTBLOB ( struct Pix *  pix)

Definition at line 590 of file capi.cpp.

591 {
592  return TessBaseAPI::MakeTBLOB(pix);
593 }
TESS_API ROW* TESS_CALL TessMakeTessOCRRow ( float  baseline,
float  xheight,
float  descender,
float  ascender 
)

Definition at line 585 of file capi.cpp.

586 {
587  return TessBaseAPI::MakeTessOCRRow(baseline, xheight, descender, ascender);
588 }
TESS_API void TESS_CALL TessNormalizeTBLOB ( TBLOB tblob,
ROW row,
BOOL  numeric_mode 
)

Definition at line 595 of file capi.cpp.

596 {
597  TessBaseAPI::NormalizeTBLOB(tblob, row, numeric_mode != FALSE);
598 }
#define FALSE
Definition: capi.h:46
TESS_API BOOL TESS_CALL TessPageIteratorBaseline ( const TessPageIterator handle,
TessPageIteratorLevel  level,
int *  x1,
int *  y1,
int *  x2,
int *  y2 
)

Definition at line 685 of file capi.cpp.

687 {
688  return handle->Baseline(level, x1, y1, x2, y2) ? TRUE : FALSE;
689 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API void TESS_CALL TessPageIteratorBegin ( TessPageIterator handle)

Definition at line 642 of file capi.cpp.

643 {
644  handle->Begin();
645 }
TESS_API TessPolyBlockType TESS_CALL TessPageIteratorBlockType ( const TessPageIterator handle)

Definition at line 669 of file capi.cpp.

670 {
671  return handle->BlockType();
672 }
TESS_API BOOL TESS_CALL TessPageIteratorBoundingBox ( const TessPageIterator handle,
TessPageIteratorLevel  level,
int *  left,
int *  top,
int *  right,
int *  bottom 
)

Definition at line 663 of file capi.cpp.

665 {
666  return handle->BoundingBox(level, left, top, right, bottom) ? TRUE : FALSE;
667 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API TessPageIterator* TESS_CALL TessPageIteratorCopy ( const TessPageIterator handle)

Definition at line 637 of file capi.cpp.

638 {
639  return new TessPageIterator(*handle);
640 }
struct TessPageIterator TessPageIterator
Definition: capi.h:87
TESS_API void TESS_CALL TessPageIteratorDelete ( TessPageIterator handle)

Definition at line 632 of file capi.cpp.

633 {
634  delete handle;
635 }
TESS_API struct Pix* TESS_CALL TessPageIteratorGetBinaryImage ( const TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 674 of file capi.cpp.

675 {
676  return handle->GetBinaryImage(level);
677 }
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 679 of file capi.cpp.

681 {
682  return handle->GetImage(level, padding, original_image, left, top);
683 }
TESS_API BOOL TESS_CALL TessPageIteratorIsAtBeginningOf ( const TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 652 of file capi.cpp.

653 {
654  return handle->IsAtBeginningOf(level) ? TRUE : FALSE;
655 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API BOOL TESS_CALL TessPageIteratorIsAtFinalElement ( const TessPageIterator handle,
TessPageIteratorLevel  level,
TessPageIteratorLevel  element 
)

Definition at line 657 of file capi.cpp.

659 {
660  return handle->IsAtFinalElement(level, element) ? TRUE : FALSE;
661 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API BOOL TESS_CALL TessPageIteratorNext ( TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 647 of file capi.cpp.

648 {
649  return handle->Next(level) ? TRUE : FALSE;
650 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API void TESS_CALL TessPageIteratorOrientation ( TessPageIterator handle,
TessOrientation orientation,
TessWritingDirection writing_direction,
TessTextlineOrder textline_order,
float *  deskew_angle 
)

Definition at line 691 of file capi.cpp.

694 {
695  handle->Orientation(orientation, writing_direction, textline_order, deskew_angle);
696 }
TESS_API void TESS_CALL TessPageIteratorParagraphInfo ( TessPageIterator handle,
TessParagraphJustification justification,
BOOL is_list_item,
BOOL is_crown,
int *  first_line_indent 
)

Definition at line 698 of file capi.cpp.

700 {
701  bool bool_is_list_item, bool_is_crown;
702  handle->ParagraphInfo(justification, &bool_is_list_item, &bool_is_crown, first_line_indent);
703  if (is_list_item)
704  *is_list_item = bool_is_list_item ? TRUE : FALSE;
705  if (is_crown)
706  *is_crown = bool_is_crown ? TRUE : FALSE;
707 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
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);
70 }
struct TessPDFRenderer TessPDFRenderer
Definition: capi.h:83
TESS_API float TESS_CALL TessResultIteratorConfidence ( const TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 745 of file capi.cpp.

746 {
747  return handle->Confidence(level);
748 }
TESS_API TessResultIterator* TESS_CALL TessResultIteratorCopy ( const TessResultIterator handle)

Definition at line 715 of file capi.cpp.

716 {
717  return new TessResultIterator(*handle);
718 }
struct TessResultIterator TessResultIterator
Definition: capi.h:88
TESS_API void TESS_CALL TessResultIteratorDelete ( TessResultIterator handle)

Definition at line 710 of file capi.cpp.

711 {
712  delete handle;
713 }
TESS_API TessChoiceIterator* TESS_CALL TessResultIteratorGetChoiceIterator ( const TessResultIterator handle)

Definition at line 730 of file capi.cpp.

731 {
732  return new TessChoiceIterator(*handle);
733 }
struct TessChoiceIterator TessChoiceIterator
Definition: capi.h:90
TESS_API TessPageIterator* TESS_CALL TessResultIteratorGetPageIterator ( TessResultIterator handle)

Definition at line 720 of file capi.cpp.

721 {
722  return handle;
723 }
TESS_API const TessPageIterator* TESS_CALL TessResultIteratorGetPageIteratorConst ( const TessResultIterator handle)

Definition at line 725 of file capi.cpp.

726 {
727  return handle;
728 }
TESS_API char* TESS_CALL TessResultIteratorGetUTF8Text ( const TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 740 of file capi.cpp.

741 {
742  return handle->GetUTF8Text(level);
743 }
TESS_API BOOL TESS_CALL TessResultIteratorNext ( TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 735 of file capi.cpp.

736 {
737  return handle->Next(level);
738 }
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap ( const TessResultIterator handle)

Definition at line 797 of file capi.cpp.

798 {
799  return handle->SymbolIsDropcap() ? TRUE : FALSE;
800 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript ( const TessResultIterator handle)

Definition at line 792 of file capi.cpp.

793 {
794  return handle->SymbolIsSubscript() ? TRUE : FALSE;
795 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript ( const TessResultIterator handle)

Definition at line 787 of file capi.cpp.

788 {
789  return handle->SymbolIsSuperscript() ? TRUE : FALSE;
790 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
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 755 of file capi.cpp.

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

Definition at line 777 of file capi.cpp.

778 {
779  return handle->WordIsFromDictionary() ? TRUE : FALSE;
780 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API BOOL TESS_CALL TessResultIteratorWordIsNumeric ( const TessResultIterator handle)

Definition at line 782 of file capi.cpp.

783 {
784  return handle->WordIsNumeric() ? TRUE : FALSE;
785 }
#define TRUE
Definition: capi.h:45
#define FALSE
Definition: capi.h:46
TESS_API const char* TESS_CALL TessResultIteratorWordRecognitionLanguage ( const TessResultIterator handle)

Definition at line 750 of file capi.cpp.

751 {
752  return handle->WordRecognitionLanguage();
753 }
TESS_API BOOL TESS_CALL TessResultRendererAddImage ( TessResultRenderer renderer,
TessBaseAPI api 
)

Definition at line 102 of file capi.cpp.

103 {
104  return renderer->AddImage(api);
105 }
TESS_API BOOL TESS_CALL TessResultRendererBeginDocument ( TessResultRenderer renderer,
const char *  title 
)

Definition at line 97 of file capi.cpp.

98 {
99  return renderer->BeginDocument(title);
100 }
TESS_API BOOL TESS_CALL TessResultRendererEndDocument ( TessResultRenderer renderer)

Definition at line 107 of file capi.cpp.

108 {
109  return renderer->EndDocument();
110 }
TESS_API const char* TESS_CALL TessResultRendererExtention ( TessResultRenderer renderer)

Definition at line 112 of file capi.cpp.

113 {
114  return renderer->file_extension();
115 }
TESS_API int TESS_CALL TessResultRendererImageNum ( TessResultRenderer renderer)

Definition at line 122 of file capi.cpp.

123 {
124  return renderer->imagenum();
125 }
TESS_API void TESS_CALL TessResultRendererInsert ( TessResultRenderer renderer,
TessResultRenderer next 
)

Definition at line 87 of file capi.cpp.

88 {
89  renderer->insert(next);
90 }
TESS_API TessResultRenderer* TESS_CALL TessResultRendererNext ( TessResultRenderer renderer)

Definition at line 92 of file capi.cpp.

93 {
94  return renderer->next();
95 }
TESS_API const char* TESS_CALL TessResultRendererTitle ( TessResultRenderer renderer)

Definition at line 117 of file capi.cpp.

118 {
119  return renderer->title();
120 }
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
TESS_API TessResultRenderer* TESS_CALL TessUnlvRendererCreate ( const char *  outputbase)

Definition at line 72 of file capi.cpp.

73 {
74  return new TessUnlvRenderer(outputbase);
75 }
struct TessUnlvRenderer TessUnlvRenderer
Definition: capi.h:84
TESS_API const char* TESS_CALL TessVersion ( )

Definition at line 25 of file capi.cpp.

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