tesseract  4.0.0-1-g2a2b
capi.h File Reference
#include "baseapi.h"
#include "ocrclass.h"
#include "pageiterator.h"
#include "resultiterator.h"
#include "renderer.h"
#include "platform.h"
#include <stdbool.h>
#include <stdio.h>

Go to the source code of this file.

Macros

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

Typedefs

typedef struct TessResultRenderer TessResultRenderer
 
typedef struct TessTextRenderer TessTextRenderer
 
typedef struct TessHOcrRenderer TessHOcrRenderer
 
typedef struct TessPDFRenderer TessPDFRenderer
 
typedef struct TessUnlvRenderer TessUnlvRenderer
 
typedef struct TessBoxTextRenderer TessBoxTextRenderer
 
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_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

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 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, BOOL textonly)
 
TESS_API TessResultRenderer *TESS_CALL TessUnlvRendererCreate (const char *outputbase)
 
TESS_API TessResultRenderer *TESS_CALL TessBoxTextRendererCreate (const char *outputbase)
 
TESS_API void TESS_CALL TessDeleteResultRenderer (TessResultRenderer *renderer)
 
TESS_API void TESS_CALL TessResultRendererInsert (TessResultRenderer *renderer, TessResultRenderer *next)
 
TESS_API TessResultRenderer *TESS_CALL TessResultRendererNext (TessResultRenderer *renderer)
 
TESS_API BOOL TESS_CALL TessResultRendererBeginDocument (TessResultRenderer *renderer, const char *title)
 
TESS_API BOOL TESS_CALL TessResultRendererAddImage (TessResultRenderer *renderer, TessBaseAPI *api)
 
TESS_API BOOL TESS_CALL TessResultRendererEndDocument (TessResultRenderer *renderer)
 
TESS_API const char *TESS_CALL TessResultRendererExtention (TessResultRenderer *renderer)
 
TESS_API const char *TESS_CALL TessResultRendererTitle (TessResultRenderer *renderer)
 
TESS_API int TESS_CALL TessResultRendererImageNum (TessResultRenderer *renderer)
 
TESS_API TessBaseAPI *TESS_CALL TessBaseAPICreate ()
 
TESS_API void TESS_CALL TessBaseAPIDelete (TessBaseAPI *handle)
 
TESS_API size_t TESS_CALL TessBaseAPIGetOpenCLDevice (TessBaseAPI *handle, void **device)
 
TESS_API void TESS_CALL TessBaseAPISetInputName (TessBaseAPI *handle, const char *name)
 
TESS_API const char *TESS_CALL TessBaseAPIGetInputName (TessBaseAPI *handle)
 
TESS_API void TESS_CALL TessBaseAPISetInputImage (TessBaseAPI *handle, struct Pix *pix)
 
TESS_API struct 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 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 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 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 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, const TessPageIteratorLevel level, const 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 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 const char *TESS_CALL TessBaseAPIGetUnichar (TessBaseAPI *handle, int unichar_id)
 
TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin (TessBaseAPI *handle, double margin)
 
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)
 
TESS_API ETEXT_DESC *TESS_CALL TessMonitorCreate ()
 
TESS_API void TESS_CALL TessMonitorDelete (ETEXT_DESC *monitor)
 
TESS_API void TESS_CALL TessMonitorSetCancelFunc (ETEXT_DESC *monitor, TessCancelFunc cancelFunc)
 
TESS_API void TESS_CALL TessMonitorSetCancelThis (ETEXT_DESC *monitor, void *cancelThis)
 
TESS_API void *TESS_CALL TessMonitorGetCancelThis (ETEXT_DESC *monitor)
 
TESS_API void TESS_CALL TessMonitorSetProgressFunc (ETEXT_DESC *monitor, TessProgressFunc progressFunc)
 
TESS_API int TESS_CALL TessMonitorGetProgress (ETEXT_DESC *monitor)
 
TESS_API void TESS_CALL TessMonitorSetDeadlineMSecs (ETEXT_DESC *monitor, int deadline)
 

Macro Definition Documentation

◆ BOOL

#define BOOL   int

Definition at line 50 of file capi.h.

◆ FALSE

#define FALSE   0

Definition at line 52 of file capi.h.

◆ TESS_CALL

#define TESS_CALL

Definition at line 45 of file capi.h.

◆ TRUE

#define TRUE   1

Definition at line 51 of file capi.h.

Typedef Documentation

◆ ETEXT_DESC

typedef struct ETEXT_DESC ETEXT_DESC

Definition at line 106 of file capi.h.

◆ TessBaseAPI

typedef struct TessBaseAPI TessBaseAPI

Definition at line 89 of file capi.h.

◆ TessBoxTextRenderer

Definition at line 88 of file capi.h.

◆ TessCancelFunc

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

Definition at line 109 of file capi.h.

◆ TessChoiceIterator

Definition at line 93 of file capi.h.

◆ TessHOcrRenderer

Definition at line 85 of file capi.h.

◆ TessMutableIterator

Definition at line 92 of file capi.h.

◆ TessOcrEngineMode

◆ TessOrientation

◆ TessPageIterator

Definition at line 90 of file capi.h.

◆ TessPageIteratorLevel

◆ TessPageSegMode

◆ TessParagraphJustification

◆ TessPDFRenderer

Definition at line 86 of file capi.h.

◆ TessPolyBlockType

◆ TessProgressFunc

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

Definition at line 110 of file capi.h.

◆ TessResultIterator

Definition at line 91 of file capi.h.

◆ TessResultRenderer

Definition at line 83 of file capi.h.

◆ TessTextlineOrder

◆ TessTextRenderer

Definition at line 84 of file capi.h.

◆ TessUnlvRenderer

Definition at line 87 of file capi.h.

◆ TessWritingDirection

Enumeration Type Documentation

◆ TessOcrEngineMode

Enumerator
OEM_TESSERACT_ONLY 
OEM_LSTM_ONLY 
OEM_TESSERACT_LSTM_COMBINED 
OEM_DEFAULT 

Definition at line 94 of file capi.h.

◆ TessOrientation

Enumerator
ORIENTATION_PAGE_UP 
ORIENTATION_PAGE_RIGHT 
ORIENTATION_PAGE_DOWN 
ORIENTATION_PAGE_LEFT 

Definition at line 102 of file capi.h.

◆ TessPageIteratorLevel

Enumerator
RIL_BLOCK 
RIL_PARA 
RIL_TEXTLINE 
RIL_WORD 
RIL_SYMBOL 

Definition at line 98 of file capi.h.

◆ 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_COUNT 

Definition at line 95 of file capi.h.

◆ TessParagraphJustification

Enumerator
JUSTIFICATION_UNKNOWN 
JUSTIFICATION_LEFT 
JUSTIFICATION_CENTER 
JUSTIFICATION_RIGHT 

Definition at line 103 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 99 of file capi.h.

◆ TessTextlineOrder

Enumerator
TEXTLINE_ORDER_LEFT_TO_RIGHT 
TEXTLINE_ORDER_RIGHT_TO_LEFT 
TEXTLINE_ORDER_TOP_TO_BOTTOM 

Definition at line 105 of file capi.h.

◆ TessWritingDirection

Enumerator
WRITING_DIRECTION_LEFT_TO_RIGHT 
WRITING_DIRECTION_RIGHT_TO_LEFT 
WRITING_DIRECTION_TOP_TO_BOTTOM 

Definition at line 104 of file capi.h.

Function Documentation

◆ TessBaseAPIAdaptToWordStr()

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

Definition at line 504 of file capi.cpp.

505 {
506  return handle->AdaptToWordStr(mode, wordstr) ? TRUE : FALSE;
507 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIAllWordConfidences()

TESS_API int* TESS_CALL TessBaseAPIAllWordConfidences ( TessBaseAPI handle)

Definition at line 498 of file capi.cpp.

499 {
500  return handle->AllWordConfidences();
501 }

◆ TessBaseAPIAnalyseLayout()

TESS_API TessPageIterator* TESS_CALL TessBaseAPIAnalyseLayout ( TessBaseAPI handle)

Definition at line 428 of file capi.cpp.

429 {
430  return handle->AnalyseLayout();
431 }

◆ TessBaseAPIClear()

TESS_API void TESS_CALL TessBaseAPIClear ( TessBaseAPI handle)

Definition at line 510 of file capi.cpp.

511 {
512  handle->Clear();
513 }

◆ TessBaseAPIClearAdaptiveClassifier()

TESS_API void TESS_CALL TessBaseAPIClearAdaptiveClassifier ( TessBaseAPI handle)

Definition at line 342 of file capi.cpp.

343 {
344  handle->ClearAdaptiveClassifier();
345 }

◆ TessBaseAPICreate()

TESS_API TessBaseAPI* TESS_CALL TessBaseAPICreate ( )

Definition at line 130 of file capi.cpp.

131 {
132  return new TessBaseAPI;
133 }
struct TessBaseAPI TessBaseAPI
Definition: capi.h:89

◆ TessBaseAPIDelete()

TESS_API void TESS_CALL TessBaseAPIDelete ( TessBaseAPI handle)

Definition at line 135 of file capi.cpp.

136 {
137  delete handle;
138 }

◆ TessBaseAPIEnd()

TESS_API void TESS_CALL TessBaseAPIEnd ( TessBaseAPI handle)

Definition at line 515 of file capi.cpp.

516 {
517  handle->End();
518 }

◆ TessBaseAPIGetAvailableLanguagesAsVector()

TESS_API char** TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 291 of file capi.cpp.

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

◆ TessBaseAPIGetBoolVariable()

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

Definition at line 195 of file capi.cpp.

196 {
197  bool boolValue;
198  if (handle->GetBoolVariable(name, &boolValue))
199  {
200  *value = boolValue ? TRUE : FALSE;
201  return TRUE;
202  }
203  else
204  {
205  return FALSE;
206  }
207 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetBoxText()

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

Definition at line 483 of file capi.cpp.

484 {
485  return handle->GetBoxText(page_number);
486 }

◆ TessBaseAPIGetComponentImages()

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

Definition at line 410 of file capi.cpp.

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

◆ TessBaseAPIGetComponentImages1()

TESS_API struct Boxa* TESS_CALL TessBaseAPIGetComponentImages1 ( TessBaseAPI handle,
const TessPageIteratorLevel  level,
const BOOL  text_only,
const BOOL  raw_image,
const int  raw_padding,
struct Pixa **  pixa,
int **  blockids,
int **  paraids 
)

Definition at line 416 of file capi.cpp.

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

◆ TessBaseAPIGetConnectedComponents()

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

Definition at line 405 of file capi.cpp.

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

◆ TessBaseAPIGetDatapath()

TESS_API const char* TESS_CALL TessBaseAPIGetDatapath ( TessBaseAPI handle)

Definition at line 170 of file capi.cpp.

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

◆ TessBaseAPIGetDoubleVariable()

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

Definition at line 209 of file capi.cpp.

210 {
211  return handle->GetDoubleVariable(name, value) ? TRUE : FALSE;
212 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetHOCRText()

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

Definition at line 478 of file capi.cpp.

479 {
480  return handle->GetHOCRText(nullptr, page_number);
481 }

◆ TessBaseAPIGetInitLanguagesAsString()

TESS_API const char* TESS_CALL TessBaseAPIGetInitLanguagesAsString ( const TessBaseAPI handle)

Definition at line 275 of file capi.cpp.

276 {
277  return handle->GetInitLanguagesAsString();
278 }

◆ TessBaseAPIGetInputImage()

TESS_API struct Pix* TESS_CALL TessBaseAPIGetInputImage ( TessBaseAPI handle)

Definition at line 160 of file capi.cpp.

161 {
162  return handle->GetInputImage();
163 }

◆ TessBaseAPIGetInputName()

TESS_API const char* TESS_CALL TessBaseAPIGetInputName ( TessBaseAPI handle)

Definition at line 150 of file capi.cpp.

151 {
152  return handle->GetInputName();
153 }

◆ TessBaseAPIGetIntVariable()

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

Definition at line 190 of file capi.cpp.

191 {
192  return handle->GetIntVariable(name, value) ? TRUE : FALSE;
193 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetIterator()

TESS_API TessResultIterator* TESS_CALL TessBaseAPIGetIterator ( TessBaseAPI handle)

Definition at line 463 of file capi.cpp.

464 {
465  return handle->GetIterator();
466 }

◆ TessBaseAPIGetLoadedLanguagesAsVector()

TESS_API char** TESS_CALL TessBaseAPIGetLoadedLanguagesAsVector ( const TessBaseAPI handle)

Definition at line 280 of file capi.cpp.

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

◆ TessBaseAPIGetMutableIterator()

TESS_API TessMutableIterator* TESS_CALL TessBaseAPIGetMutableIterator ( TessBaseAPI handle)

Definition at line 468 of file capi.cpp.

469 {
470  return handle->GetMutableIterator();
471 }

◆ TessBaseAPIGetOpenCLDevice()

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

Definition at line 140 of file capi.cpp.

141 {
142  return handle->getOpenCLDevice(device);
143 }

◆ TessBaseAPIGetPageSegMode()

TESS_API TessPageSegMode TESS_CALL TessBaseAPIGetPageSegMode ( const TessBaseAPI handle)

Definition at line 329 of file capi.cpp.

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

◆ TessBaseAPIGetRegions()

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

Definition at line 379 of file capi.cpp.

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

◆ TessBaseAPIGetSourceYResolution()

TESS_API int TESS_CALL TessBaseAPIGetSourceYResolution ( TessBaseAPI handle)

Definition at line 165 of file capi.cpp.

166 {
167  return handle->GetSourceYResolution();
168 }

◆ TessBaseAPIGetStringVariable()

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

Definition at line 214 of file capi.cpp.

215 {
216  return handle->GetStringVariable(name);
217 }

◆ TessBaseAPIGetStrips()

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

Definition at line 395 of file capi.cpp.

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

◆ TessBaseAPIGetTextDirection()

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

Definition at line 525 of file capi.cpp.

526 {
527  return handle->GetTextDirection(out_offset, out_slope) ? TRUE : FALSE;
528 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIGetTextlines()

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

Definition at line 384 of file capi.cpp.

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

◆ TessBaseAPIGetTextlines1()

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

Definition at line 389 of file capi.cpp.

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

◆ TessBaseAPIGetThresholdedImage()

TESS_API struct Pix* TESS_CALL TessBaseAPIGetThresholdedImage ( TessBaseAPI handle)

Definition at line 374 of file capi.cpp.

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

◆ TessBaseAPIGetThresholdedImageScaleFactor()

TESS_API int TESS_CALL TessBaseAPIGetThresholdedImageScaleFactor ( const TessBaseAPI handle)

Definition at line 423 of file capi.cpp.

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

◆ TessBaseAPIGetUnichar()

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

Definition at line 574 of file capi.cpp.

575 {
576  return handle->GetUnichar(unichar_id);
577 }

◆ TessBaseAPIGetUNLVText()

TESS_API char* TESS_CALL TessBaseAPIGetUNLVText ( TessBaseAPI handle)

Definition at line 488 of file capi.cpp.

489 {
490  return handle->GetUNLVText();
491 }

◆ TessBaseAPIGetUTF8Text()

TESS_API char* TESS_CALL TessBaseAPIGetUTF8Text ( TessBaseAPI handle)

Definition at line 473 of file capi.cpp.

474 {
475  return handle->GetUTF8Text();
476 }

◆ TessBaseAPIGetWords()

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

Definition at line 400 of file capi.cpp.

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

◆ TessBaseAPIInit1()

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

Definition at line 259 of file capi.cpp.

261 {
262  return handle->Init(datapath, language, oem, configs, configs_size, nullptr, nullptr, false);
263 }

◆ TessBaseAPIInit2()

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

Definition at line 265 of file capi.cpp.

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

◆ TessBaseAPIInit3()

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

Definition at line 270 of file capi.cpp.

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

◆ TessBaseAPIInit4()

TESS_API int TESS_CALL TessBaseAPIInit4 ( TessBaseAPI handle,
const char *  datapath,
const char *  language,
TessOcrEngineMode  mode,
char **  configs,
int  configs_size,
char **  vars_vec,
char **  vars_values,
size_t  vars_vec_size,
BOOL  set_only_non_debug_params 
)

Definition at line 241 of file capi.cpp.

245 {
246  GenericVector<STRING> varNames;
247  GenericVector<STRING> varValues;
248  if (vars_vec != nullptr && vars_values != nullptr) {
249  for (size_t i = 0; i < vars_vec_size; i++) {
250  varNames.push_back(STRING(vars_vec[i]));
251  varValues.push_back(STRING(vars_values[i]));
252  }
253  }
254 
255  return handle->Init(datapath, language, mode, configs, configs_size, &varNames, &varValues, set_only_non_debug_params);
256 }
int push_back(T object)
Definition: strngs.h:45

◆ TessBaseAPIInitForAnalysePage()

TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage ( TessBaseAPI handle)

Definition at line 309 of file capi.cpp.

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

◆ TessBaseAPIInitLangMod()

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

Definition at line 303 of file capi.cpp.

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

◆ TessBaseAPIIsValidWord()

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

Definition at line 520 of file capi.cpp.

521 {
522  return handle->IsValidWord(word);
523 }

◆ TessBaseAPIMeanTextConf()

TESS_API int TESS_CALL TessBaseAPIMeanTextConf ( TessBaseAPI handle)

Definition at line 493 of file capi.cpp.

494 {
495  return handle->MeanTextConf();
496 }

◆ TessBaseAPIPrintVariables()

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

Definition at line 219 of file capi.cpp.

220 {
221  handle->PrintVariables(fp);
222 }

◆ TessBaseAPIPrintVariablesToFile()

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

Definition at line 224 of file capi.cpp.

225 {
226  FILE* fp = fopen(filename, "w");
227  if (fp != nullptr)
228  {
229  handle->PrintVariables(fp);
230  fclose(fp);
231  return TRUE;
232  }
233  return FALSE;
234 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIProcessPage()

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

Definition at line 454 of file capi.cpp.

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

◆ TessBaseAPIProcessPages()

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

Definition at line 445 of file capi.cpp.

447 {
448  if (handle->ProcessPages(filename, retry_config, timeout_millisec, renderer))
449  return TRUE;
450  else
451  return FALSE;
452 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPIReadConfigFile()

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

Definition at line 314 of file capi.cpp.

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

◆ TessBaseAPIReadDebugConfigFile()

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

Definition at line 319 of file capi.cpp.

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

◆ TessBaseAPIRecognize()

TESS_API int TESS_CALL TessBaseAPIRecognize ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 433 of file capi.cpp.

434 {
435  return handle->Recognize(monitor);
436 }

◆ TessBaseAPIRecognizeForChopTest()

TESS_API int TESS_CALL TessBaseAPIRecognizeForChopTest ( TessBaseAPI handle,
ETEXT_DESC monitor 
)

Definition at line 439 of file capi.cpp.

440 {
441  return handle->RecognizeForChopTest(monitor);
442 }

◆ TessBaseAPIRect()

TESS_API char* TESS_CALL TessBaseAPIRect ( TessBaseAPI handle,
const unsigned char *  imagedata,
int  bytes_per_pixel,
int  bytes_per_line,
int  left,
int  top,
int  width,
int  height 
)

Definition at line 334 of file capi.cpp.

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

◆ TessBaseAPISetDebugVariable()

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

Definition at line 185 of file capi.cpp.

186 {
187  return handle->SetVariable(name, value) ? TRUE : FALSE;
188 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBaseAPISetImage()

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

Definition at line 348 of file capi.cpp.

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

◆ TessBaseAPISetImage2()

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

Definition at line 354 of file capi.cpp.

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

◆ TessBaseAPISetInputImage()

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

Definition at line 155 of file capi.cpp.

156 {
157  handle->SetInputImage(pix);
158 }

◆ TessBaseAPISetInputName()

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

Definition at line 145 of file capi.cpp.

146 {
147  handle->SetInputName(name);
148 }

◆ TessBaseAPISetMinOrientationMargin()

TESS_API void TESS_CALL TessBaseAPISetMinOrientationMargin ( TessBaseAPI handle,
double  margin 
)

Definition at line 616 of file capi.cpp.

617 {
618  handle->set_min_orientation_margin(margin);
619 }

◆ TessBaseAPISetOutputName()

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

Definition at line 175 of file capi.cpp.

176 {
177  handle->SetOutputName(name);
178 }

◆ TessBaseAPISetPageSegMode()

TESS_API void TESS_CALL TessBaseAPISetPageSegMode ( TessBaseAPI handle,
TessPageSegMode  mode 
)

Definition at line 324 of file capi.cpp.

325 {
326  handle->SetPageSegMode(mode);
327 }

◆ TessBaseAPISetRectangle()

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

Definition at line 364 of file capi.cpp.

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

◆ TessBaseAPISetSourceResolution()

TESS_API void TESS_CALL TessBaseAPISetSourceResolution ( TessBaseAPI handle,
int  ppi 
)

Definition at line 359 of file capi.cpp.

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

◆ TessBaseAPISetVariable()

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

Definition at line 180 of file capi.cpp.

181 {
182  return handle->SetVariable(name, value) ? TRUE : FALSE;
183 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessBoxTextRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessBoxTextRendererCreate ( const char *  outputbase)

Definition at line 80 of file capi.cpp.

81 {
82  return new TessBoxTextRenderer(outputbase);
83 }
struct TessBoxTextRenderer TessBoxTextRenderer
Definition: capi.h:88

◆ TessChoiceIteratorConfidence()

TESS_API float TESS_CALL TessChoiceIteratorConfidence ( const TessChoiceIterator handle)

Definition at line 818 of file capi.cpp.

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

◆ TessChoiceIteratorDelete()

TESS_API void TESS_CALL TessChoiceIteratorDelete ( TessChoiceIterator handle)

Definition at line 803 of file capi.cpp.

804 {
805  delete handle;
806 }

◆ TessChoiceIteratorGetUTF8Text()

TESS_API const char* TESS_CALL TessChoiceIteratorGetUTF8Text ( const TessChoiceIterator handle)

Definition at line 813 of file capi.cpp.

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

◆ TessChoiceIteratorNext()

TESS_API BOOL TESS_CALL TessChoiceIteratorNext ( TessChoiceIterator handle)

Definition at line 808 of file capi.cpp.

809 {
810  return handle->Next();
811 }

◆ TessDeleteIntArray()

TESS_API void TESS_CALL TessDeleteIntArray ( int *  arr)

Definition at line 42 of file capi.cpp.

43 {
44  delete [] arr;
45 }

◆ TessDeleteResultRenderer()

TESS_API void TESS_CALL TessDeleteResultRenderer ( TessResultRenderer renderer)

Definition at line 85 of file capi.cpp.

86 {
87  delete renderer;
88 }

◆ TessDeleteText()

TESS_API void TESS_CALL TessDeleteText ( char *  text)

Definition at line 30 of file capi.cpp.

31 {
32  delete [] text;
33 }

◆ TessDeleteTextArray()

TESS_API void TESS_CALL TessDeleteTextArray ( char **  arr)

Definition at line 35 of file capi.cpp.

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

◆ TessHOcrRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessHOcrRendererCreate ( const char *  outputbase)

Definition at line 59 of file capi.cpp.

60 {
61  return new TessHOcrRenderer(outputbase);
62 }
struct TessHOcrRenderer TessHOcrRenderer
Definition: capi.h:85

◆ TessHOcrRendererCreate2()

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

Definition at line 64 of file capi.cpp.

65 {
66  return new TessHOcrRenderer(outputbase, font_info);
67 }
struct TessHOcrRenderer TessHOcrRenderer
Definition: capi.h:85

◆ TessMonitorCreate()

TESS_API ETEXT_DESC* TESS_CALL TessMonitorCreate ( )

Definition at line 823 of file capi.cpp.

824 {
825  return new ETEXT_DESC();
826 }
struct ETEXT_DESC ETEXT_DESC
Definition: capi.h:106

◆ TessMonitorDelete()

TESS_API void TESS_CALL TessMonitorDelete ( ETEXT_DESC monitor)

Definition at line 828 of file capi.cpp.

829 {
830  delete monitor;
831 }

◆ TessMonitorGetCancelThis()

TESS_API void* TESS_CALL TessMonitorGetCancelThis ( ETEXT_DESC monitor)

Definition at line 843 of file capi.cpp.

844 {
845  return monitor->cancel_this;
846 }
void * cancel_this
monitor-aware progress callback
Definition: ocrclass.h:132

◆ TessMonitorGetProgress()

TESS_API int TESS_CALL TessMonitorGetProgress ( ETEXT_DESC monitor)

Definition at line 853 of file capi.cpp.

854 {
855  return monitor->progress;
856 }
int16_t progress
chars in this buffer(0)
Definition: ocrclass.h:122

◆ TessMonitorSetCancelFunc()

TESS_API void TESS_CALL TessMonitorSetCancelFunc ( ETEXT_DESC monitor,
TessCancelFunc  cancelFunc 
)

Definition at line 833 of file capi.cpp.

834 {
835  monitor->cancel = cancelFunc;
836 }
CANCEL_FUNC cancel
for errcode use
Definition: ocrclass.h:129

◆ TessMonitorSetCancelThis()

TESS_API void TESS_CALL TessMonitorSetCancelThis ( ETEXT_DESC monitor,
void *  cancelThis 
)

Definition at line 838 of file capi.cpp.

839 {
840  monitor->cancel_this = cancelThis;
841 }
void * cancel_this
monitor-aware progress callback
Definition: ocrclass.h:132

◆ TessMonitorSetDeadlineMSecs()

TESS_API void TESS_CALL TessMonitorSetDeadlineMSecs ( ETEXT_DESC monitor,
int  deadline 
)

Definition at line 858 of file capi.cpp.

859 {
860  monitor->set_deadline_msecs(deadline);
861 }
void set_deadline_msecs(int32_t deadline_msecs)
Definition: ocrclass.h:152

◆ TessMonitorSetProgressFunc()

TESS_API void TESS_CALL TessMonitorSetProgressFunc ( ETEXT_DESC monitor,
TessProgressFunc  progressFunc 
)

Definition at line 848 of file capi.cpp.

849 {
850  monitor->progress_callback2 = progressFunc;
851 }
PROGRESS_FUNC2 progress_callback2
called whenever progress increases
Definition: ocrclass.h:131

◆ TessPageIteratorBaseline()

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

Definition at line 686 of file capi.cpp.

688 {
689  return handle->Baseline(level, x1, y1, x2, y2) ? TRUE : FALSE;
690 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorBegin()

TESS_API void TESS_CALL TessPageIteratorBegin ( TessPageIterator handle)

Definition at line 643 of file capi.cpp.

644 {
645  handle->Begin();
646 }

◆ TessPageIteratorBlockType()

TESS_API TessPolyBlockType TESS_CALL TessPageIteratorBlockType ( const TessPageIterator handle)

Definition at line 670 of file capi.cpp.

671 {
672  return handle->BlockType();
673 }

◆ TessPageIteratorBoundingBox()

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

Definition at line 664 of file capi.cpp.

666 {
667  return handle->BoundingBox(level, left, top, right, bottom) ? TRUE : FALSE;
668 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorCopy()

TESS_API TessPageIterator* TESS_CALL TessPageIteratorCopy ( const TessPageIterator handle)

Definition at line 638 of file capi.cpp.

639 {
640  return new TessPageIterator(*handle);
641 }
struct TessPageIterator TessPageIterator
Definition: capi.h:90

◆ TessPageIteratorDelete()

TESS_API void TESS_CALL TessPageIteratorDelete ( TessPageIterator handle)

Definition at line 633 of file capi.cpp.

634 {
635  delete handle;
636 }

◆ TessPageIteratorGetBinaryImage()

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

Definition at line 675 of file capi.cpp.

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

◆ TessPageIteratorGetImage()

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

Definition at line 680 of file capi.cpp.

682 {
683  return handle->GetImage(level, padding, original_image, left, top);
684 }

◆ TessPageIteratorIsAtBeginningOf()

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

Definition at line 653 of file capi.cpp.

654 {
655  return handle->IsAtBeginningOf(level) ? TRUE : FALSE;
656 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorIsAtFinalElement()

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

Definition at line 658 of file capi.cpp.

660 {
661  return handle->IsAtFinalElement(level, element) ? TRUE : FALSE;
662 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorNext()

TESS_API BOOL TESS_CALL TessPageIteratorNext ( TessPageIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 648 of file capi.cpp.

649 {
650  return handle->Next(level) ? TRUE : FALSE;
651 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPageIteratorOrientation()

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

Definition at line 692 of file capi.cpp.

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

◆ TessPageIteratorParagraphInfo()

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

Definition at line 699 of file capi.cpp.

701 {
702  bool bool_is_list_item, bool_is_crown;
703  handle->ParagraphInfo(justification, &bool_is_list_item, &bool_is_crown, first_line_indent);
704  if (is_list_item)
705  *is_list_item = bool_is_list_item ? TRUE : FALSE;
706  if (is_crown)
707  *is_crown = bool_is_crown ? TRUE : FALSE;
708 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessPDFRendererCreate()

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

Definition at line 69 of file capi.cpp.

71 {
72  return new TessPDFRenderer(outputbase, datadir, textonly);
73 }
struct TessPDFRenderer TessPDFRenderer
Definition: capi.h:86

◆ TessResultIteratorConfidence()

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

Definition at line 746 of file capi.cpp.

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

◆ TessResultIteratorCopy()

TESS_API TessResultIterator* TESS_CALL TessResultIteratorCopy ( const TessResultIterator handle)

Definition at line 716 of file capi.cpp.

717 {
718  return new TessResultIterator(*handle);
719 }
struct TessResultIterator TessResultIterator
Definition: capi.h:91

◆ TessResultIteratorDelete()

TESS_API void TESS_CALL TessResultIteratorDelete ( TessResultIterator handle)

Definition at line 711 of file capi.cpp.

712 {
713  delete handle;
714 }

◆ TessResultIteratorGetChoiceIterator()

TESS_API TessChoiceIterator* TESS_CALL TessResultIteratorGetChoiceIterator ( const TessResultIterator handle)

Definition at line 731 of file capi.cpp.

732 {
733  return new TessChoiceIterator(*handle);
734 }
struct TessChoiceIterator TessChoiceIterator
Definition: capi.h:93

◆ TessResultIteratorGetPageIterator()

TESS_API TessPageIterator* TESS_CALL TessResultIteratorGetPageIterator ( TessResultIterator handle)

Definition at line 721 of file capi.cpp.

722 {
723  return handle;
724 }

◆ TessResultIteratorGetPageIteratorConst()

TESS_API const TessPageIterator* TESS_CALL TessResultIteratorGetPageIteratorConst ( const TessResultIterator handle)

Definition at line 726 of file capi.cpp.

727 {
728  return handle;
729 }

◆ TessResultIteratorGetUTF8Text()

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

Definition at line 741 of file capi.cpp.

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

◆ TessResultIteratorNext()

TESS_API BOOL TESS_CALL TessResultIteratorNext ( TessResultIterator handle,
TessPageIteratorLevel  level 
)

Definition at line 736 of file capi.cpp.

737 {
738  return handle->Next(level);
739 }

◆ TessResultIteratorSymbolIsDropcap()

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap ( const TessResultIterator handle)

Definition at line 798 of file capi.cpp.

799 {
800  return handle->SymbolIsDropcap() ? TRUE : FALSE;
801 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorSymbolIsSubscript()

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript ( const TessResultIterator handle)

Definition at line 793 of file capi.cpp.

794 {
795  return handle->SymbolIsSubscript() ? TRUE : FALSE;
796 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorSymbolIsSuperscript()

TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript ( const TessResultIterator handle)

Definition at line 788 of file capi.cpp.

789 {
790  return handle->SymbolIsSuperscript() ? TRUE : FALSE;
791 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorWordFontAttributes()

TESS_API const char* TESS_CALL TessResultIteratorWordFontAttributes ( const TessResultIterator handle,
BOOL is_bold,
BOOL is_italic,
BOOL is_underlined,
BOOL is_monospace,
BOOL is_serif,
BOOL is_smallcaps,
int *  pointsize,
int *  font_id 
)

Definition at line 756 of file capi.cpp.

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

◆ TessResultIteratorWordIsFromDictionary()

TESS_API BOOL TESS_CALL TessResultIteratorWordIsFromDictionary ( const TessResultIterator handle)

Definition at line 778 of file capi.cpp.

779 {
780  return handle->WordIsFromDictionary() ? TRUE : FALSE;
781 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorWordIsNumeric()

TESS_API BOOL TESS_CALL TessResultIteratorWordIsNumeric ( const TessResultIterator handle)

Definition at line 783 of file capi.cpp.

784 {
785  return handle->WordIsNumeric() ? TRUE : FALSE;
786 }
#define TRUE
Definition: capi.h:51
#define FALSE
Definition: capi.h:52

◆ TessResultIteratorWordRecognitionLanguage()

TESS_API const char* TESS_CALL TessResultIteratorWordRecognitionLanguage ( const TessResultIterator handle)

Definition at line 751 of file capi.cpp.

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

◆ TessResultRendererAddImage()

TESS_API BOOL TESS_CALL TessResultRendererAddImage ( TessResultRenderer renderer,
TessBaseAPI api 
)

Definition at line 105 of file capi.cpp.

106 {
107  return renderer->AddImage(api);
108 }

◆ TessResultRendererBeginDocument()

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

Definition at line 100 of file capi.cpp.

101 {
102  return renderer->BeginDocument(title);
103 }

◆ TessResultRendererEndDocument()

TESS_API BOOL TESS_CALL TessResultRendererEndDocument ( TessResultRenderer renderer)

Definition at line 110 of file capi.cpp.

111 {
112  return renderer->EndDocument();
113 }

◆ TessResultRendererExtention()

TESS_API const char* TESS_CALL TessResultRendererExtention ( TessResultRenderer renderer)

Definition at line 115 of file capi.cpp.

116 {
117  return renderer->file_extension();
118 }

◆ TessResultRendererImageNum()

TESS_API int TESS_CALL TessResultRendererImageNum ( TessResultRenderer renderer)

Definition at line 125 of file capi.cpp.

126 {
127  return renderer->imagenum();
128 }

◆ TessResultRendererInsert()

TESS_API void TESS_CALL TessResultRendererInsert ( TessResultRenderer renderer,
TessResultRenderer next 
)

Definition at line 90 of file capi.cpp.

91 {
92  renderer->insert(next);
93 }

◆ TessResultRendererNext()

TESS_API TessResultRenderer* TESS_CALL TessResultRendererNext ( TessResultRenderer renderer)

Definition at line 95 of file capi.cpp.

96 {
97  return renderer->next();
98 }

◆ TessResultRendererTitle()

TESS_API const char* TESS_CALL TessResultRendererTitle ( TessResultRenderer renderer)

Definition at line 120 of file capi.cpp.

121 {
122  return renderer->title();
123 }

◆ TessTextRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessTextRendererCreate ( const char *  outputbase)

Definition at line 54 of file capi.cpp.

55 {
56  return new TessTextRenderer(outputbase);
57 }
struct TessTextRenderer TessTextRenderer
Definition: capi.h:84

◆ TessUnlvRendererCreate()

TESS_API TessResultRenderer* TESS_CALL TessUnlvRendererCreate ( const char *  outputbase)

Definition at line 75 of file capi.cpp.

76 {
77  return new TessUnlvRenderer(outputbase);
78 }
struct TessUnlvRenderer TessUnlvRenderer
Definition: capi.h:87

◆ TessVersion()

TESS_API const char* TESS_CALL TessVersion ( )

Definition at line 25 of file capi.cpp.

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