00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#ifndef _GOCR_API_H
00023
#define _GOCR_API_H
00024
00025
#ifdef __cplusplus
00026
extern "C" {
00027
#endif
00028
00036 #define GOCR_FALSE 0
00037
00039 #define GOCR_TRUE 1
00040
00041
00042
00043
00047
extern int gocr_init (
int argc,
char **argv );
00048
extern void gocr_finalize (
void );
00051
00058 enum gocr_attributetype {
00059
LIBVERSION,
00060
VERBOSE,
00062
BLOCK_OVERLAP,
00063
NO_BLOCK,
00065
CHAR_OVERLAP,
00066
CHAR_RECTANGLES,
00067
FIND_ALL,
00069
ERROR_FILE,
00070
PRINT,
00071
PRINT_IMAGE
00072 };
00076 typedef enum gocr_attributetype gocr_AttributeType;
00077
00078
extern int gocr_setAttribute ( gocr_AttributeType t,
void *value );
00079
extern void *
gocr_getAttribute ( gocr_AttributeType t );
00085 int (*gocr_imageLoad) (
const char *filename,
void *data );
00086
extern void gocr_imageClose (
void );
00089
00090
00091
00092
00099 enum gocr_moduletype {
00100
imageLoader = 0,
00101
imageFilter,
00102
blockFinder,
00104
charFinder,
00105
charRecognizer,
00106
contextCorrection,
00107
outputFormatter,
00108
allModules
00109 };
00113 typedef enum gocr_moduletype gocr_ModuleType;
00114
00115
typedef int gocr_ModuleId;
00116
typedef int gocr_ModuleFunctionId;
00117
00118
extern gocr_ModuleId
gocr_moduleLoad (
char *filename );
00119
extern void gocr_moduleClose ( gocr_ModuleId
id );
00120
extern int gocr_moduleSetAttribute ( gocr_ModuleId
id,
char *a,
00121
char *b );
00122
extern const struct gocr_moduleattributeinfo *
00123
gocr_moduleGetAttributeList ( gocr_ModuleId
id );
00124
extern const struct gocr_modulefunctioninfo *
00125
gocr_moduleGetFunctionList ( gocr_ModuleId
id );
00126
00127
extern gocr_ModuleFunctionId
00128
gocr_functionInsertBefore (
char *functionname,
00129 gocr_ModuleId mid,
void *data,
00130 gocr_ModuleFunctionId func );
00131
extern gocr_ModuleFunctionId
00132
gocr_functionAppend (
char *functionname,
00133 gocr_ModuleId mid,
void *data);
00134
extern void *
gocr_functionDeleteById ( gocr_ModuleFunctionId
id );
00135
00136
00137
00138
extern int gocr_runAllModules (
void );
00145
enum gocr_guifunction {
00146 gocr_BeginWindow,
00147 gocr_EndWindow,
00148 gocr_DisplayCheckButton,
00149 gocr_DisplayImage,
00150 gocr_DisplayRadioButtons,
00151 gocr_DisplaySpinButton,
00152 gocr_DisplayText,
00153 gocr_DisplayTextField
00154 };
00155
typedef enum gocr_guifunction gocr_GUIFunction;
00156
00157
extern int gocr_guiSetFunction ( gocr_GUIFunction type,
void *func );
00158
00161
#ifdef __cplusplus
00162
}
00163
#endif
00164
00165
00166
#endif