tesseract  5.0.0-alpha-619-ge9db
capi.h File Reference
#include <stdbool.h>
#include <stdio.h>
#include "platform.h"

Go to the source code of this file.

Macros

#define BOOL   int
 
#define TRUE   1
 
#define FALSE   0
 

Typedefs

typedef struct TessResultRenderer TessResultRenderer
 
typedef struct TessBaseAPI TessBaseAPI
 
typedef struct TessPageIterator TessPageIterator
 
typedef struct TessResultIterator TessResultIterator
 
typedef struct TessMutableIterator TessMutableIterator
 
typedef struct TessChoiceIterator TessChoiceIterator
 
typedef enum TessOcrEngineMode TessOcrEngineMode
 
typedef enum TessPageSegMode TessPageSegMode
 
typedef enum TessPageIteratorLevel TessPageIteratorLevel
 
typedef enum TessPolyBlockType TessPolyBlockType
 
typedef enum TessOrientation TessOrientation
 
typedef enum TessParagraphJustification TessParagraphJustification
 
typedef enum TessWritingDirection TessWritingDirection
 
typedef enum TessTextlineOrder TessTextlineOrder
 
typedef struct ETEXT_DESC ETEXT_DESC
 
typedef bool(* TessCancelFunc) (void *cancel_this, int words)
 
typedef bool(* TessProgressFunc) (ETEXT_DESC *ths, int left, int right, int top, int bottom)
 

Enumerations

enum  TessOcrEngineMode { OEM_TESSERACT_ONLY, OEM_LSTM_ONLY, OEM_TESSERACT_LSTM_COMBINED, OEM_DEFAULT }
 
enum  TessPageSegMode {
  PSM_OSD_ONLY, PSM_AUTO_OSD, PSM_AUTO_ONLY, PSM_AUTO,
  PSM_SINGLE_COLUMN, PSM_SINGLE_BLOCK_VERT_TEXT, PSM_SINGLE_BLOCK, PSM_SINGLE_LINE,
  PSM_SINGLE_WORD, PSM_CIRCLE_WORD, PSM_SINGLE_CHAR, PSM_SPARSE_TEXT,
  PSM_SPARSE_TEXT_OSD, PSM_RAW_LINE, PSM_COUNT
}
 
enum  TessPageIteratorLevel {
  RIL_BLOCK, RIL_PARA, RIL_TEXTLINE, RIL_WORD,
  RIL_SYMBOL
}
 
enum  TessPolyBlockType {
  PT_UNKNOWN, PT_FLOWING_TEXT, PT_HEADING_TEXT, PT_PULLOUT_TEXT,
  PT_EQUATION, PT_INLINE_EQUATION, PT_TABLE, PT_VERTICAL_TEXT,
  PT_CAPTION_TEXT, PT_FLOWING_IMAGE, PT_HEADING_IMAGE, PT_PULLOUT_IMAGE,
  PT_HORZ_LINE, PT_VERT_LINE, PT_NOISE, PT_COUNT
}
 
enum  TessOrientation { ORIENTATION_PAGE_UP, ORIENTATION_PAGE_RIGHT, ORIENTATION_PAGE_DOWN, ORIENTATION_PAGE_LEFT }
 
enum  TessParagraphJustification { JUSTIFICATION_UNKNOWN, JUSTIFICATION_LEFT, JUSTIFICATION_CENTER, JUSTIFICATION_RIGHT }
 
enum  TessWritingDirection { WRITING_DIRECTION_LEFT_TO_RIGHT, WRITING_DIRECTION_RIGHT_TO_LEFT, WRITING_DIRECTION_TOP_TO_BOTTOM }
 
enum  TessTextlineOrder { TEXTLINE_ORDER_LEFT_TO_RIGHT, TEXTLINE_ORDER_RIGHT_TO_LEFT, TEXTLINE_ORDER_TOP_TO_BOTTOM }
 

Functions

const TESS_API char * TessVersion ()
 
TESS_API void TessDeleteText (const char *text)
 
TESS_API void TessDeleteTextArray (char **arr)
 
TESS_API void TessDeleteIntArray (const int *arr)
 
TESS_API TessResultRendererTessTextRendererCreate (const char *outputbase)
 
TESS_API TessResultRendererTessHOcrRendererCreate (const char *outputbase)
 
TESS_API TessResultRendererTessHOcrRendererCreate2 (const char *outputbase, BOOL font_info)
 
TESS_API TessResultRendererTessAltoRendererCreate (const char *outputbase)
 
TESS_API TessResultRendererTessTsvRendererCreate (const char *outputbase)
 
TESS_API TessResultRendererTessPDFRendererCreate (const char *outputbase, const char *datadir, BOOL textonly)
 
TESS_API TessResultRendererTessUnlvRendererCreate (const char *outputbase)
 
TESS_API TessResultRendererTessBoxTextRendererCreate (const char *outputbase)
 
TESS_API TessResultRendererTessLSTMBoxRendererCreate (const char *outputbase)
 
TESS_API TessResultRendererTessWordStrBoxRendererCreate (const char *outputbase)
 
TESS_API void TessDeleteResultRenderer (TessResultRenderer *renderer)
 
TESS_API void TessResultRendererInsert (TessResultRenderer *renderer, TessResultRenderer *next)
 
TESS_API TessResultRendererTessResultRendererNext (TessResultRenderer *renderer)
 
TESS_API BOOL TessResultRendererBeginDocument (TessResultRenderer *renderer, const char *title)
 
TESS_API BOOL TessResultRendererAddImage (TessResultRenderer *renderer, TessBaseAPI *api)
 
TESS_API BOOL TessResultRendererEndDocument (TessResultRenderer *renderer)
 
const TESS_API char * TessResultRendererExtention (TessResultRenderer *renderer)
 
const TESS_API char * TessResultRendererTitle (TessResultRenderer *renderer)
 
TESS_API int TessResultRendererImageNum (TessResultRenderer *renderer)
 
TESS_API TessBaseAPITessBaseAPICreate ()
 
TESS_API void TessBaseAPIDelete (TessBaseAPI *handle)
 
TESS_API size_t TessBaseAPIGetOpenCLDevice (TessBaseAPI *handle, void **device)
 
TESS_API void TessBaseAPISetInputName (TessBaseAPI *handle, const char *name)
 
const TESS_API char * TessBaseAPIGetInputName (TessBaseAPI *handle)
 
TESS_API void TessBaseAPISetInputImage (TessBaseAPI *handle, struct Pix *pix)
 
TESS_API struct Pix * TessBaseAPIGetInputImage (TessBaseAPI *handle)
 
TESS_API int TessBaseAPIGetSourceYResolution (TessBaseAPI *handle)
 
const TESS_API char * TessBaseAPIGetDatapath (TessBaseAPI *handle)
 
TESS_API void TessBaseAPISetOutputName (TessBaseAPI *handle, const char *name)
 
TESS_API BOOL TessBaseAPISetVariable (TessBaseAPI *handle, const char *name, const char *value)
 
TESS_API BOOL TessBaseAPISetDebugVariable (TessBaseAPI *handle, const char *name, const char *value)
 
TESS_API BOOL TessBaseAPIGetIntVariable (const TessBaseAPI *handle, const char *name, int *value)
 
TESS_API BOOL TessBaseAPIGetBoolVariable (const TessBaseAPI *handle, const char *name, BOOL *value)
 
TESS_API BOOL TessBaseAPIGetDoubleVariable (const TessBaseAPI *handle, const char *name, double *value)
 
const TESS_API char * TessBaseAPIGetStringVariable (const TessBaseAPI *handle, const char *name)
 
TESS_API void TessBaseAPIPrintVariables (const TessBaseAPI *handle, FILE *fp)
 
TESS_API BOOL TessBaseAPIPrintVariablesToFile (const TessBaseAPI *handle, const char *filename)
 
TESS_API int TessBaseAPIInit1 (TessBaseAPI *handle, const char *datapath, const char *language, TessOcrEngineMode oem, char **configs, int configs_size)
 
TESS_API int TessBaseAPIInit2 (TessBaseAPI *handle, const char *datapath, const char *language, TessOcrEngineMode oem)
 
TESS_API int TessBaseAPIInit3 (TessBaseAPI *handle, const char *datapath, const char *language)
 
TESS_API 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)
 
const TESS_API char * TessBaseAPIGetInitLanguagesAsString (const TessBaseAPI *handle)
 
TESS_API char ** TessBaseAPIGetLoadedLanguagesAsVector (const TessBaseAPI *handle)
 
TESS_API char ** TessBaseAPIGetAvailableLanguagesAsVector (const TessBaseAPI *handle)
 
TESS_API int TessBaseAPIInitLangMod (TessBaseAPI *handle, const char *datapath, const char *language)
 
TESS_API void TessBaseAPIInitForAnalysePage (TessBaseAPI *handle)
 
TESS_API void TessBaseAPIReadConfigFile (TessBaseAPI *handle, const char *filename)
 
TESS_API void TessBaseAPIReadDebugConfigFile (TessBaseAPI *handle, const char *filename)
 
TESS_API void TessBaseAPISetPageSegMode (TessBaseAPI *handle, TessPageSegMode mode)
 
TESS_API TessPageSegMode TessBaseAPIGetPageSegMode (const TessBaseAPI *handle)
 
TESS_API char * 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 TessBaseAPIClearAdaptiveClassifier (TessBaseAPI *handle)
 
TESS_API void TessBaseAPISetImage (TessBaseAPI *handle, const unsigned char *imagedata, int width, int height, int bytes_per_pixel, int bytes_per_line)
 
TESS_API void TessBaseAPISetImage2 (TessBaseAPI *handle, struct Pix *pix)
 
TESS_API void TessBaseAPISetSourceResolution (TessBaseAPI *handle, int ppi)
 
TESS_API void TessBaseAPISetRectangle (TessBaseAPI *handle, int left, int top, int width, int height)
 
TESS_API struct Pix * TessBaseAPIGetThresholdedImage (TessBaseAPI *handle)
 
TESS_API struct Boxa * TessBaseAPIGetRegions (TessBaseAPI *handle, struct Pixa **pixa)
 
TESS_API struct Boxa * TessBaseAPIGetTextlines (TessBaseAPI *handle, struct Pixa **pixa, int **blockids)
 
TESS_API struct Boxa * TessBaseAPIGetTextlines1 (TessBaseAPI *handle, BOOL raw_image, int raw_padding, struct Pixa **pixa, int **blockids, int **paraids)
 
TESS_API struct Boxa * TessBaseAPIGetStrips (TessBaseAPI *handle, struct Pixa **pixa, int **blockids)
 
TESS_API struct Boxa * TessBaseAPIGetWords (TessBaseAPI *handle, struct Pixa **pixa)
 
TESS_API struct Boxa * TessBaseAPIGetConnectedComponents (TessBaseAPI *handle, struct Pixa **cc)
 
TESS_API struct Boxa * TessBaseAPIGetComponentImages (TessBaseAPI *handle, TessPageIteratorLevel level, BOOL text_only, struct Pixa **pixa, int **blockids)
 
TESS_API struct Boxa * TessBaseAPIGetComponentImages1 (TessBaseAPI *handle, TessPageIteratorLevel level, BOOL text_only, BOOL raw_image, int raw_padding, struct Pixa **pixa, int **blockids, int **paraids)
 
TESS_API int TessBaseAPIGetThresholdedImageScaleFactor (const TessBaseAPI *handle)
 
TESS_API TessPageIteratorTessBaseAPIAnalyseLayout (TessBaseAPI *handle)
 
TESS_API int TessBaseAPIRecognize (TessBaseAPI *handle, ETEXT_DESC *monitor)
 
TESS_API int TessBaseAPIRecognizeForChopTest (TessBaseAPI *handle, ETEXT_DESC *monitor)
 
TESS_API BOOL TessBaseAPIProcessPages (TessBaseAPI *handle, const char *filename, const char *retry_config, int timeout_millisec, TessResultRenderer *renderer)
 
TESS_API BOOL TessBaseAPIProcessPage (TessBaseAPI *handle, struct Pix *pix, int page_index, const char *filename, const char *retry_config, int timeout_millisec, TessResultRenderer *renderer)
 
TESS_API TessResultIteratorTessBaseAPIGetIterator (TessBaseAPI *handle)
 
TESS_API TessMutableIteratorTessBaseAPIGetMutableIterator (TessBaseAPI *handle)
 
TESS_API char * TessBaseAPIGetUTF8Text (TessBaseAPI *handle)
 
TESS_API char * TessBaseAPIGetHOCRText (TessBaseAPI *handle, int page_number)
 
TESS_API char * TessBaseAPIGetAltoText (TessBaseAPI *handle, int page_number)
 
TESS_API char * TessBaseAPIGetTsvText (TessBaseAPI *handle, int page_number)
 
TESS_API char * TessBaseAPIGetBoxText (TessBaseAPI *handle, int page_number)
 
TESS_API char * TessBaseAPIGetLSTMBoxText (TessBaseAPI *handle, int page_number)
 
TESS_API char * TessBaseAPIGetWordStrBoxText (TessBaseAPI *handle, int page_number)
 
TESS_API char * TessBaseAPIGetUNLVText (TessBaseAPI *handle)
 
TESS_API int TessBaseAPIMeanTextConf (TessBaseAPI *handle)
 
TESS_API int * TessBaseAPIAllWordConfidences (TessBaseAPI *handle)
 
TESS_API BOOL TessBaseAPIAdaptToWordStr (TessBaseAPI *handle, TessPageSegMode mode, const char *wordstr)
 
TESS_API void TessBaseAPIClear (TessBaseAPI *handle)
 
TESS_API void TessBaseAPIEnd (TessBaseAPI *handle)
 
TESS_API int TessBaseAPIIsValidWord (TessBaseAPI *handle, const char *word)
 
TESS_API BOOL TessBaseAPIGetTextDirection (TessBaseAPI *handle, int *out_offset, float *out_slope)
 
const TESS_API char * TessBaseAPIGetUnichar (TessBaseAPI *handle, int unichar_id)
 
TESS_API void TessBaseAPISetMinOrientationMargin (TessBaseAPI *handle, double margin)
 
TESS_API void TessPageIteratorDelete (TessPageIterator *handle)
 
TESS_API TessPageIteratorTessPageIteratorCopy (const TessPageIterator *handle)
 
TESS_API void TessPageIteratorBegin (TessPageIterator *handle)
 
TESS_API BOOL TessPageIteratorNext (TessPageIterator *handle, TessPageIteratorLevel level)
 
TESS_API BOOL TessPageIteratorIsAtBeginningOf (const TessPageIterator *handle, TessPageIteratorLevel level)
 
TESS_API BOOL TessPageIteratorIsAtFinalElement (const TessPageIterator *handle, TessPageIteratorLevel level, TessPageIteratorLevel element)
 
TESS_API BOOL TessPageIteratorBoundingBox (const TessPageIterator *handle, TessPageIteratorLevel level, int *left, int *top, int *right, int *bottom)
 
TESS_API TessPolyBlockType TessPageIteratorBlockType (const TessPageIterator *handle)
 
TESS_API struct Pix * TessPageIteratorGetBinaryImage (const TessPageIterator *handle, TessPageIteratorLevel level)
 
TESS_API struct Pix * TessPageIteratorGetImage (const TessPageIterator *handle, TessPageIteratorLevel level, int padding, struct Pix *original_image, int *left, int *top)
 
TESS_API BOOL TessPageIteratorBaseline (const TessPageIterator *handle, TessPageIteratorLevel level, int *x1, int *y1, int *x2, int *y2)
 
TESS_API void TessPageIteratorOrientation (TessPageIterator *handle, TessOrientation *orientation, TessWritingDirection *writing_direction, TessTextlineOrder *textline_order, float *deskew_angle)
 
TESS_API void TessPageIteratorParagraphInfo (TessPageIterator *handle, TessParagraphJustification *justification, BOOL *is_list_item, BOOL *is_crown, int *first_line_indent)
 
TESS_API void TessResultIteratorDelete (TessResultIterator *handle)
 
TESS_API TessResultIteratorTessResultIteratorCopy (const TessResultIterator *handle)
 
TESS_API TessPageIteratorTessResultIteratorGetPageIterator (TessResultIterator *handle)
 
const TESS_API TessPageIteratorTessResultIteratorGetPageIteratorConst (const TessResultIterator *handle)
 
TESS_API TessChoiceIteratorTessResultIteratorGetChoiceIterator (const TessResultIterator *handle)
 
TESS_API BOOL TessResultIteratorNext (TessResultIterator *handle, TessPageIteratorLevel level)
 
TESS_API char * TessResultIteratorGetUTF8Text (const TessResultIterator *handle, TessPageIteratorLevel level)
 
TESS_API float TessResultIteratorConfidence (const TessResultIterator *handle, TessPageIteratorLevel level)
 
const TESS_API char * TessResultIteratorWordRecognitionLanguage (const TessResultIterator *handle)
 
const TESS_API 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)
 
TESS_API BOOL TessResultIteratorWordIsFromDictionary (const TessResultIterator *handle)
 
TESS_API BOOL TessResultIteratorWordIsNumeric (const TessResultIterator *handle)
 
TESS_API BOOL TessResultIteratorSymbolIsSuperscript (const TessResultIterator *handle)
 
TESS_API BOOL TessResultIteratorSymbolIsSubscript (const TessResultIterator *handle)
 
TESS_API BOOL TessResultIteratorSymbolIsDropcap (const TessResultIterator *handle)
 
TESS_API void TessChoiceIteratorDelete (TessChoiceIterator *handle)
 
TESS_API BOOL TessChoiceIteratorNext (TessChoiceIterator *handle)
 
const TESS_API char * TessChoiceIteratorGetUTF8Text (const TessChoiceIterator *handle)
 
TESS_API float TessChoiceIteratorConfidence (const TessChoiceIterator *handle)
 
TESS_API ETEXT_DESCTessMonitorCreate ()
 
TESS_API void TessMonitorDelete (ETEXT_DESC *monitor)
 
TESS_API void TessMonitorSetCancelFunc (ETEXT_DESC *monitor, TessCancelFunc cancelFunc)
 
TESS_API void TessMonitorSetCancelThis (ETEXT_DESC *monitor, void *cancelThis)
 
TESS_API void * TessMonitorGetCancelThis (ETEXT_DESC *monitor)
 
TESS_API void TessMonitorSetProgressFunc (ETEXT_DESC *monitor, TessProgressFunc progressFunc)
 
TESS_API int TessMonitorGetProgress (ETEXT_DESC *monitor)
 
TESS_API void TessMonitorSetDeadlineMSecs (ETEXT_DESC *monitor, int deadline)
 

Macro Definition Documentation

◆ BOOL

#define BOOL   int

Definition at line 43 of file capi.h.

◆ FALSE

#define FALSE   0

Definition at line 45 of file capi.h.

◆ TRUE

#define TRUE   1

Definition at line 44 of file capi.h.

Typedef Documentation

◆ ETEXT_DESC

typedef struct ETEXT_DESC ETEXT_DESC

Definition at line 147 of file capi.h.

◆ TessBaseAPI

typedef struct TessBaseAPI TessBaseAPI

Definition at line 72 of file capi.h.

◆ TessCancelFunc

typedef bool(* TessCancelFunc) (void *cancel_this, int words)

Definition at line 150 of file capi.h.

◆ TessChoiceIterator

Definition at line 76 of file capi.h.

◆ TessMutableIterator

Definition at line 75 of file capi.h.

◆ TessOcrEngineMode

◆ TessOrientation

◆ TessPageIterator

Definition at line 73 of file capi.h.

◆ TessPageIteratorLevel

◆ TessPageSegMode

◆ TessParagraphJustification

◆ TessPolyBlockType

◆ TessProgressFunc

typedef bool(* TessProgressFunc) (ETEXT_DESC *ths, int left, int right, int top, int bottom)

Definition at line 151 of file capi.h.

◆ TessResultIterator

Definition at line 74 of file capi.h.

◆ TessResultRenderer

Definition at line 71 of file capi.h.

◆ TessTextlineOrder

◆ TessWritingDirection

Enumeration Type Documentation

◆ TessOcrEngineMode

Enumerator
OEM_TESSERACT_ONLY 
OEM_LSTM_ONLY 
OEM_TESSERACT_LSTM_COMBINED 
OEM_DEFAULT 

Definition at line 77 of file capi.h.

◆ TessOrientation

Enumerator
ORIENTATION_PAGE_UP 
ORIENTATION_PAGE_RIGHT 
ORIENTATION_PAGE_DOWN 
ORIENTATION_PAGE_LEFT 

Definition at line 125 of file capi.h.

◆ TessPageIteratorLevel

Enumerator
RIL_BLOCK 
RIL_PARA 
RIL_TEXTLINE 
RIL_WORD 
RIL_SYMBOL 

Definition at line 100 of file capi.h.

100  {
101  RIL_BLOCK,
102  RIL_PARA,
103  RIL_TEXTLINE,
104  RIL_WORD,
105  RIL_SYMBOL

◆ TessPageSegMode

Enumerator
PSM_OSD_ONLY 
PSM_AUTO_OSD 
PSM_AUTO_ONLY 
PSM_AUTO 
PSM_SINGLE_COLUMN 
PSM_SINGLE_BLOCK_VERT_TEXT 
PSM_SINGLE_BLOCK 
PSM_SINGLE_LINE 
PSM_SINGLE_WORD 
PSM_CIRCLE_WORD 
PSM_SINGLE_CHAR 
PSM_SPARSE_TEXT 
PSM_SPARSE_TEXT_OSD 
PSM_RAW_LINE 
PSM_COUNT 

Definition at line 83 of file capi.h.

◆ TessParagraphJustification

Enumerator
JUSTIFICATION_UNKNOWN 
JUSTIFICATION_LEFT 
JUSTIFICATION_CENTER 
JUSTIFICATION_RIGHT 

Definition at line 131 of file capi.h.

◆ TessPolyBlockType

Enumerator
PT_UNKNOWN 
PT_FLOWING_TEXT 
PT_HEADING_TEXT 
PT_PULLOUT_TEXT 
PT_EQUATION 
PT_INLINE_EQUATION 
PT_TABLE 
PT_VERTICAL_TEXT 
PT_CAPTION_TEXT 
PT_FLOWING_IMAGE 
PT_HEADING_IMAGE 
PT_PULLOUT_IMAGE 
PT_HORZ_LINE 
PT_VERT_LINE 
PT_NOISE 
PT_COUNT 

Definition at line 107 of file capi.h.

◆ TessTextlineOrder

Enumerator
TEXTLINE_ORDER_LEFT_TO_RIGHT 
TEXTLINE_ORDER_RIGHT_TO_LEFT 
TEXTLINE_ORDER_TOP_TO_BOTTOM 

Definition at line 142 of file capi.h.

◆ TessWritingDirection

Enumerator
WRITING_DIRECTION_LEFT_TO_RIGHT 
WRITING_DIRECTION_RIGHT_TO_LEFT 
WRITING_DIRECTION_TOP_TO_BOTTOM 

Definition at line 137 of file capi.h.

Function Documentation

◆ TessAltoRendererCreate()

TESS_API TessResultRenderer* TessAltoRendererCreate ( const char *  outputbase)

Definition at line 66 of file capi.cpp.

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

◆ TessBaseAPIAdaptToWordStr()

TESS_API 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()

TESS_API int* TessBaseAPIAllWordConfidences ( TessBaseAPI handle)

Definition at line 543 of file capi.cpp.

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

◆ TessBaseAPIAnalyseLayout()

TESS_API TessPageIterator* TessBaseAPIAnalyseLayout ( TessBaseAPI handle)

Definition at line 456 of file capi.cpp.

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

◆ TessBaseAPIClear()

TESS_API void TessBaseAPIClear ( TessBaseAPI handle)

Definition at line 555 of file capi.cpp.

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

◆ TessBaseAPIClearAdaptiveClassifier()

TESS_API void TessBaseAPIClearAdaptiveClassifier ( TessBaseAPI handle)

Definition at line 361 of file capi.cpp.

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

◆ TessBaseAPICreate()

TESS_API TessBaseAPI* TessBaseAPICreate ( )

Definition at line 144 of file capi.cpp.

144  {
145  return new TessBaseAPI;
146 }

◆ TessBaseAPIDelete()

TESS_API void TessBaseAPIDelete ( TessBaseAPI handle)

Definition at line 148 of file capi.cpp.

148  {
149  delete handle;
150 }

◆ TessBaseAPIEnd()

TESS_API void TessBaseAPIEnd ( TessBaseAPI handle)

Definition at line 559 of file capi.cpp.

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

◆ TessBaseAPIGetAltoText()

TESS_API char* TessBaseAPIGetAltoText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 510 of file capi.cpp.

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

◆ TessBaseAPIGetAvailableLanguagesAsVector()

TESS_API 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()

TESS_API 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()

TESS_API char* TessBaseAPIGetBoxText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 520 of file capi.cpp.

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

◆ TessBaseAPIGetComponentImages()

TESS_API 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()

TESS_API struct Boxa* TessBaseAPIGetComponentImages1 ( TessBaseAPI handle,
TessPageIteratorLevel  level,
BOOL  text_only,
BOOL  raw_image,
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()

TESS_API 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 TESS_API char* TessBaseAPIGetDatapath ( TessBaseAPI handle)

Definition at line 179 of file capi.cpp.

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

◆ TessBaseAPIGetDoubleVariable()

TESS_API 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 }

◆ TessBaseAPIGetHOCRText()

TESS_API 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 TESS_API char* TessBaseAPIGetInitLanguagesAsString ( const TessBaseAPI handle)

Definition at line 290 of file capi.cpp.

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

◆ TessBaseAPIGetInputImage()

TESS_API struct Pix* TessBaseAPIGetInputImage ( TessBaseAPI handle)

Definition at line 171 of file capi.cpp.

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

◆ TessBaseAPIGetInputName()

const TESS_API char* TessBaseAPIGetInputName ( TessBaseAPI handle)

Definition at line 162 of file capi.cpp.

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

◆ TessBaseAPIGetIntVariable()

TESS_API 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()

TESS_API TessResultIterator* TessBaseAPIGetIterator ( TessBaseAPI handle)

Definition at line 492 of file capi.cpp.

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

◆ TessBaseAPIGetLoadedLanguagesAsVector()

TESS_API 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()

TESS_API char* TessBaseAPIGetLSTMBoxText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 530 of file capi.cpp.

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

◆ TessBaseAPIGetMutableIterator()

TESS_API TessMutableIterator* TessBaseAPIGetMutableIterator ( TessBaseAPI handle)

Definition at line 497 of file capi.cpp.

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

◆ TessBaseAPIGetOpenCLDevice()

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

Definition at line 152 of file capi.cpp.

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

◆ TessBaseAPIGetPageSegMode()

TESS_API TessPageSegMode TessBaseAPIGetPageSegMode ( const TessBaseAPI handle)

Definition at line 346 of file capi.cpp.

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

◆ TessBaseAPIGetRegions()

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

Definition at line 400 of file capi.cpp.

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

◆ TessBaseAPIGetSourceYResolution()

TESS_API int TessBaseAPIGetSourceYResolution ( TessBaseAPI handle)

Definition at line 175 of file capi.cpp.

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

◆ TessBaseAPIGetStringVariable()

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

Definition at line 224 of file capi.cpp.

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

◆ TessBaseAPIGetStrips()

TESS_API 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()

TESS_API 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()

TESS_API 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()

TESS_API struct Boxa* TessBaseAPIGetTextlines1 ( TessBaseAPI handle,
BOOL  raw_image,
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()

TESS_API struct Pix* TessBaseAPIGetThresholdedImage ( TessBaseAPI handle)

Definition at line 396 of file capi.cpp.

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

◆ TessBaseAPIGetThresholdedImageScaleFactor()

TESS_API int TessBaseAPIGetThresholdedImageScaleFactor ( const TessBaseAPI handle)

Definition at line 451 of file capi.cpp.

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

◆ TessBaseAPIGetTsvText()

TESS_API 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 TESS_API char* TessBaseAPIGetUnichar ( TessBaseAPI handle,
int  unichar_id 
)

Definition at line 621 of file capi.cpp.

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

◆ TessBaseAPIGetUNLVText()

TESS_API char* TessBaseAPIGetUNLVText ( TessBaseAPI handle)

Definition at line 535 of file capi.cpp.

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

◆ TessBaseAPIGetUTF8Text()

TESS_API char* TessBaseAPIGetUTF8Text ( TessBaseAPI handle)

Definition at line 501 of file capi.cpp.

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

◆ TessBaseAPIGetWords()

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

Definition at line 424 of file capi.cpp.

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

◆ TessBaseAPIGetWordStrBoxText()

TESS_API char* TessBaseAPIGetWordStrBoxText ( TessBaseAPI handle,
int  page_number 
)

Definition at line 525 of file capi.cpp.

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

◆ TessBaseAPIInit1()

TESS_API 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()

TESS_API 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()

TESS_API 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()

TESS_API 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()

TESS_API void TessBaseAPIInitForAnalysePage ( TessBaseAPI handle)

Definition at line 326 of file capi.cpp.

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

◆ TessBaseAPIInitLangMod()

TESS_API 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 }

◆ TessBaseAPIIsValidWord()

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

Definition at line 563 of file capi.cpp.

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

◆ TessBaseAPIMeanTextConf()

TESS_API int TessBaseAPIMeanTextConf ( TessBaseAPI handle)

Definition at line 539 of file capi.cpp.

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

◆ TessBaseAPIPrintVariables()

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

Definition at line 228 of file capi.cpp.

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

◆ TessBaseAPIPrintVariablesToFile()

TESS_API 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()

TESS_API 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()

TESS_API 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()

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

Definition at line 330 of file capi.cpp.

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

◆ TessBaseAPIReadDebugConfigFile()

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

Definition at line 335 of file capi.cpp.

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

◆ TessBaseAPIRecognize()

TESS_API int TessBaseAPIRecognize ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 460 of file capi.cpp.

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

◆ TessBaseAPIRecognizeForChopTest()

TESS_API int TessBaseAPIRecognizeForChopTest ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 466 of file capi.cpp.

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

◆ TessBaseAPIRect()

TESS_API 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 }

◆ TessBaseAPISetDebugVariable()

TESS_API 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 }

◆ TessBaseAPISetImage()

TESS_API 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()

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

Definition at line 374 of file capi.cpp.

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

◆ TessBaseAPISetInputImage()

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

Definition at line 166 of file capi.cpp.

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

◆ TessBaseAPISetInputName()

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

Definition at line 157 of file capi.cpp.

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

◆ TessBaseAPISetMinOrientationMargin()

TESS_API void TessBaseAPISetMinOrientationMargin ( TessBaseAPI handle,
double  margin 
)

Definition at line 660 of file capi.cpp.

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

◆ TessBaseAPISetOutputName()

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

Definition at line 183 of file capi.cpp.

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

◆ TessBaseAPISetPageSegMode()

TESS_API void TessBaseAPISetPageSegMode ( TessBaseAPI handle,
TessPageSegMode  mode 
)

Definition at line 340 of file capi.cpp.

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

◆ TessBaseAPISetRectangle()

TESS_API 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()

TESS_API void TessBaseAPISetSourceResolution ( TessBaseAPI handle,
int  ppi 
)

Definition at line 379 of file capi.cpp.

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

◆ TessBaseAPISetVariable()

TESS_API 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 }

◆ TessBoxTextRendererCreate()

TESS_API TessResultRenderer* TessBoxTextRendererCreate ( const char *  outputbase)

Definition at line 86 of file capi.cpp.

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

◆ TessChoiceIteratorConfidence()

TESS_API float TessChoiceIteratorConfidence ( const TessChoiceIterator handle)

Definition at line 875 of file capi.cpp.

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

◆ TessChoiceIteratorDelete()

TESS_API void TessChoiceIteratorDelete ( TessChoiceIterator handle)

Definition at line 861 of file capi.cpp.

861  {
862  delete handle;
863 }

◆ TessChoiceIteratorGetUTF8Text()

const TESS_API char* TessChoiceIteratorGetUTF8Text ( const TessChoiceIterator handle)

Definition at line 870 of file capi.cpp.

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

◆ TessChoiceIteratorNext()

TESS_API BOOL TessChoiceIteratorNext ( TessChoiceIterator handle)

Definition at line 865 of file capi.cpp.

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

◆ TessDeleteIntArray()

TESS_API void TessDeleteIntArray ( const int *  arr)

Definition at line 40 of file capi.cpp.

40  {
41  delete[] arr;
42 }

◆ TessDeleteResultRenderer()

TESS_API void TessDeleteResultRenderer ( TessResultRenderer renderer)

Definition at line 100 of file capi.cpp.

100  {
101  delete renderer;
102 }

◆ TessDeleteText()

TESS_API void TessDeleteText ( const char *  text)

Definition at line 29 of file capi.cpp.

29  {
30  delete[] text;
31 }

◆ TessDeleteTextArray()

TESS_API 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 }

◆ TessHOcrRendererCreate()

TESS_API TessResultRenderer* TessHOcrRendererCreate ( const char *  outputbase)

Definition at line 56 of file capi.cpp.

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

◆ TessHOcrRendererCreate2()

TESS_API 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()

TESS_API TessResultRenderer* TessLSTMBoxRendererCreate ( const char *  outputbase)

Definition at line 96 of file capi.cpp.

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

◆ TessMonitorCreate()

TESS_API ETEXT_DESC* TessMonitorCreate ( )

Definition at line 879 of file capi.cpp.

879  {
880  return new ETEXT_DESC();
881 }

◆ TessMonitorDelete()

TESS_API void TessMonitorDelete ( ETEXT_DESC monitor)

Definition at line 883 of file capi.cpp.

883  {
884  delete monitor;
885 }

◆ TessMonitorGetCancelThis()

TESS_API void* TessMonitorGetCancelThis ( ETEXT_DESC monitor)

Definition at line 897 of file capi.cpp.

897  {
898  return monitor->cancel_this;
899 }

◆ TessMonitorGetProgress()

TESS_API int TessMonitorGetProgress ( ETEXT_DESC monitor)

Definition at line 906 of file capi.cpp.

906  {
907  return monitor->progress;
908 }

◆ TessMonitorSetCancelFunc()

TESS_API void TessMonitorSetCancelFunc ( ETEXT_DESC monitor,
TessCancelFunc  cancelFunc 
)

Definition at line 887 of file capi.cpp.

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

◆ TessMonitorSetCancelThis()

TESS_API void TessMonitorSetCancelThis ( ETEXT_DESC monitor,
void *  cancelThis 
)

Definition at line 892 of file capi.cpp.

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

◆ TessMonitorSetDeadlineMSecs()

TESS_API void TessMonitorSetDeadlineMSecs ( ETEXT_DESC monitor,
int  deadline 
)

Definition at line 910 of file capi.cpp.

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

◆ TessMonitorSetProgressFunc()

TESS_API void TessMonitorSetProgressFunc ( ETEXT_DESC monitor,
TessProgressFunc  progressFunc 
)

Definition at line 902 of file capi.cpp.

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

◆ TessPageIteratorBaseline()

TESS_API 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()

TESS_API void TessPageIteratorBegin ( TessPageIterator handle)

Definition at line 686 of file capi.cpp.

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

◆ TessPageIteratorBlockType()

TESS_API TessPolyBlockType TessPageIteratorBlockType ( const TessPageIterator handle)

Definition at line 713 of file capi.cpp.

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

◆ TessPageIteratorBoundingBox()

TESS_API 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()

TESS_API TessPageIterator* TessPageIteratorCopy ( const TessPageIterator handle)

Definition at line 682 of file capi.cpp.

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

◆ TessPageIteratorDelete()

TESS_API void TessPageIteratorDelete ( TessPageIterator handle)

Definition at line 677 of file capi.cpp.

677  {
678  delete handle;
679 }

◆ TessPageIteratorGetBinaryImage()

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

Definition at line 717 of file capi.cpp.

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

◆ TessPageIteratorGetImage()

TESS_API 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()

TESS_API 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()

TESS_API 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()

TESS_API 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()

TESS_API 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()

TESS_API 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()

TESS_API 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()

TESS_API float TessResultIteratorConfidence ( const TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 792 of file capi.cpp.

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

◆ TessResultIteratorCopy()

TESS_API TessResultIterator* TessResultIteratorCopy ( const TessResultIterator handle)

Definition at line 763 of file capi.cpp.

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

◆ TessResultIteratorDelete()

TESS_API void TessResultIteratorDelete ( TessResultIterator handle)

Definition at line 758 of file capi.cpp.

758  {
759  delete handle;
760 }

◆ TessResultIteratorGetChoiceIterator()

TESS_API TessChoiceIterator* TessResultIteratorGetChoiceIterator ( const TessResultIterator handle)

Definition at line 778 of file capi.cpp.

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

◆ TessResultIteratorGetPageIterator()

TESS_API TessPageIterator* TessResultIteratorGetPageIterator ( TessResultIterator handle)

Definition at line 768 of file capi.cpp.

768  {
769  return handle;
770 }

◆ TessResultIteratorGetPageIteratorConst()

const TESS_API TessPageIterator* TessResultIteratorGetPageIteratorConst ( const TessResultIterator handle)

Definition at line 773 of file capi.cpp.

773  {
774  return handle;
775 }

◆ TessResultIteratorGetUTF8Text()

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

Definition at line 787 of file capi.cpp.

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

◆ TessResultIteratorNext()

TESS_API 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()

TESS_API BOOL TessResultIteratorSymbolIsDropcap ( const TessResultIterator handle)

Definition at line 857 of file capi.cpp.

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

◆ TessResultIteratorSymbolIsSubscript()

TESS_API BOOL TessResultIteratorSymbolIsSubscript ( const TessResultIterator handle)

Definition at line 852 of file capi.cpp.

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

◆ TessResultIteratorSymbolIsSuperscript()

TESS_API BOOL TessResultIteratorSymbolIsSuperscript ( const TessResultIterator handle)

Definition at line 847 of file capi.cpp.

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

◆ TessResultIteratorWordFontAttributes()

const TESS_API 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()

TESS_API BOOL TessResultIteratorWordIsFromDictionary ( const TessResultIterator handle)

Definition at line 837 of file capi.cpp.

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

◆ TessResultIteratorWordIsNumeric()

TESS_API BOOL TessResultIteratorWordIsNumeric ( const TessResultIterator handle)

Definition at line 842 of file capi.cpp.

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

◆ TessResultIteratorWordRecognitionLanguage()

const TESS_API char* TessResultIteratorWordRecognitionLanguage ( const TessResultIterator handle)

Definition at line 798 of file capi.cpp.

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

◆ TessResultRendererAddImage()

TESS_API 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()

TESS_API 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()

TESS_API BOOL TessResultRendererEndDocument ( TessResultRenderer renderer)

Definition at line 125 of file capi.cpp.

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

◆ TessResultRendererExtention()

const TESS_API char* TessResultRendererExtention ( TessResultRenderer renderer)

Definition at line 130 of file capi.cpp.

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

◆ TessResultRendererImageNum()

TESS_API int TessResultRendererImageNum ( TessResultRenderer renderer)

Definition at line 140 of file capi.cpp.

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

◆ TessResultRendererInsert()

TESS_API void TessResultRendererInsert ( TessResultRenderer renderer,
TessResultRenderer next 
)

Definition at line 104 of file capi.cpp.

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

◆ TessResultRendererNext()

TESS_API TessResultRenderer* TessResultRendererNext ( TessResultRenderer renderer)

Definition at line 110 of file capi.cpp.

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

◆ TessResultRendererTitle()

const TESS_API char* TessResultRendererTitle ( TessResultRenderer renderer)

Definition at line 135 of file capi.cpp.

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

◆ TessTextRendererCreate()

TESS_API TessResultRenderer* TessTextRendererCreate ( const char *  outputbase)

Definition at line 51 of file capi.cpp.

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

◆ TessTsvRendererCreate()

TESS_API TessResultRenderer* TessTsvRendererCreate ( const char *  outputbase)

Definition at line 71 of file capi.cpp.

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

◆ TessUnlvRendererCreate()

TESS_API TessResultRenderer* TessUnlvRendererCreate ( const char *  outputbase)

Definition at line 81 of file capi.cpp.

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

◆ TessVersion()

const TESS_API char* TessVersion ( )

Definition at line 25 of file capi.cpp.

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

◆ TessWordStrBoxRendererCreate()

TESS_API TessResultRenderer* TessWordStrBoxRendererCreate ( const char *  outputbase)

Definition at line 91 of file capi.cpp.

91  {
92  return new tesseract::TessWordStrBoxRenderer(outputbase);
93 }
PSM_OSD_ONLY
Definition: capi.h:84
ETEXT_DESC
struct ETEXT_DESC ETEXT_DESC
Definition: capi.h:147
TessChoiceIterator
struct TessChoiceIterator TessChoiceIterator
Definition: capi.h:76
JUSTIFICATION_UNKNOWN
Definition: capi.h:132
WRITING_DIRECTION_TOP_TO_BOTTOM
Definition: capi.h:140
PSM_AUTO_ONLY
Definition: capi.h:86
TessPageIterator
struct TessPageIterator TessPageIterator
Definition: capi.h:73
tesseract::TessTextRenderer
Definition: renderer.h:157
WRITING_DIRECTION_RIGHT_TO_LEFT
Definition: capi.h:139
TessOcrEngineMode
TessOcrEngineMode
Definition: capi.h:77
RIL_WORD
Definition: capi.h:104
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
PT_HEADING_IMAGE
Definition: capi.h:118
PT_NOISE
Definition: capi.h:122
STRING
Definition: strngs.h:45
PT_FLOWING_IMAGE
Definition: capi.h:117
PSM_AUTO_OSD
Definition: capi.h:85
PSM_RAW_LINE
Definition: capi.h:97
PT_INLINE_EQUATION
Definition: capi.h:113
PT_TABLE
Definition: capi.h:114
PSM_SINGLE_BLOCK
Definition: capi.h:90
PSM_AUTO
Definition: capi.h:87
TEXTLINE_ORDER_TOP_TO_BOTTOM
Definition: capi.h:145
PT_CAPTION_TEXT
Definition: capi.h:116
JUSTIFICATION_LEFT
Definition: capi.h:133
tesseract::TessBoxTextRenderer
Definition: renderer.h:275
OEM_TESSERACT_LSTM_COMBINED
Definition: capi.h:80
PT_VERTICAL_TEXT
Definition: capi.h:115
PT_COUNT
Definition: capi.h:123
RIL_SYMBOL
Definition: capi.h:105
tesseract::TessPDFRenderer
Definition: renderer.h:215
PSM_SINGLE_COLUMN
Definition: capi.h:88
PSM_SINGLE_LINE
Definition: capi.h:91
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
PT_EQUATION
Definition: capi.h:112
PSM_SINGLE_BLOCK_VERT_TEXT
Definition: capi.h:89
PT_HEADING_TEXT
Definition: capi.h:110
ORIENTATION_PAGE_RIGHT
Definition: capi.h:127
TessWritingDirection
TessWritingDirection
Definition: capi.h:137
TEXTLINE_ORDER_RIGHT_TO_LEFT
Definition: capi.h:144
TessOrientation
TessOrientation
Definition: capi.h:125
TessParagraphJustification
TessParagraphJustification
Definition: capi.h:131
TessPageSegMode
TessPageSegMode
Definition: capi.h:83
TessResultIterator
struct TessResultIterator TessResultIterator
Definition: capi.h:74
PSM_SPARSE_TEXT_OSD
Definition: capi.h:96
RIL_TEXTLINE
Definition: capi.h:103
PT_VERT_LINE
Definition: capi.h:121
tesseract::TessLSTMBoxRenderer
Definition: renderer.h:264
PT_UNKNOWN
Definition: capi.h:108
TessPageIteratorLevel
TessPageIteratorLevel
Definition: capi.h:100
ORIENTATION_PAGE_DOWN
Definition: capi.h:128
JUSTIFICATION_CENTER
Definition: capi.h:134
GenericVector< STRING >
JUSTIFICATION_RIGHT
Definition: capi.h:135
PT_PULLOUT_IMAGE
Definition: capi.h:119
OEM_LSTM_ONLY
Definition: capi.h:79
tesseract::TessWordStrBoxRenderer
Definition: renderer.h:286
TessPolyBlockType
TessPolyBlockType
Definition: capi.h:107
tesseract::TessUnlvRenderer
Definition: renderer.h:253
PT_FLOWING_TEXT
Definition: capi.h:109
ETEXT_DESC::cancel
CANCEL_FUNC cancel
for errcode use
Definition: ocrclass.h:105
TessTextlineOrder
TessTextlineOrder
Definition: capi.h:142
TRUE
#define TRUE
Definition: capi.h:44
ORIENTATION_PAGE_LEFT
Definition: capi.h:129
PSM_COUNT
Definition: capi.h:98
tesseract::TessTsvRenderer
Definition: renderer.h:198
WRITING_DIRECTION_LEFT_TO_RIGHT
Definition: capi.h:138
PSM_CIRCLE_WORD
Definition: capi.h:93
RIL_PARA
Definition: capi.h:102
FALSE
#define FALSE
Definition: capi.h:45
PT_PULLOUT_TEXT
Definition: capi.h:111
TessBaseAPI
struct TessBaseAPI TessBaseAPI
Definition: capi.h:72
PSM_SINGLE_CHAR
Definition: capi.h:94
RIL_BLOCK
Definition: capi.h:101
ORIENTATION_PAGE_UP
Definition: capi.h:126
PT_HORZ_LINE
Definition: capi.h:120
GenericVector::size
int size() const
Definition: genericvector.h:71
TEXTLINE_ORDER_LEFT_TO_RIGHT
Definition: capi.h:143
PSM_SINGLE_WORD
Definition: capi.h:92
OEM_TESSERACT_ONLY
Definition: capi.h:78
OEM_DEFAULT
Definition: capi.h:81
tesseract::TessHOcrRenderer
Definition: renderer.h:168
PSM_SPARSE_TEXT
Definition: capi.h:95