Main Page   Compound List   File List   Compound Members   File Members  

gocr.h

Go to the documentation of this file.
00001 /*
00002 GOCR Copyright (C) 2000  Joerg Schulenburg Joerg.Schulenburg@physik.uni-magdeburg.de 
00003 GOCR API Copyright (C) 2001 Bruno Barberi Gnecco <brunobg@sourceforge.net>
00004 
00005 This program is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License
00007 as published by the Free Software Foundation; either version 2
00008 of the License, or (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 
00019 */
00020  
00021 
00022 #ifndef GOCR_API_H 
00023 #define GOCR_API_H 
00024 /* This is a draft of the API. */
00025 
00030 /* 
00031  * Initialization/finalization
00032  */
00036 extern int      gocr_init               ( int argc, char **argv );
00037 extern void     gocr_finalize           ( void );
00040 /* gocr options */
00047 enum attributetype {
00048         VERBOSE,                
00049         BLOCK_OVERLAP,          
00050         NO_BLOCK,               
00051         ERROR_FILE,             
00052         PRINT,                  
00053         PRINT_IMAGE             
00054 };
00058 typedef enum attributetype gocrAttributeType;
00059 
00060 extern int      gocr_setAttribute       ( gocrAttributeType t, void *value );
00061 extern void *   gocr_getAttribute       ( gocrAttributeType t );
00067 extern int      gocr_imageLoad          ( const char *filename );
00068 extern void     gocr_imageClose         ( void );
00071 /*
00072  * Module system.
00073  *  
00074  */
00081 enum moduletype {
00082         grayImageFilter,        
00083         grayToBW,               
00084         bwImageFilter,          
00085         blockFinder,            
00087         charFinder,             
00088         charRecognizer,         
00089         contextCorrection,      
00090         outputFormatter,        
00091         allModules              
00092 };
00096 typedef enum moduletype gocr_moduleType;
00097 
00098 extern int      gocr_moduleLoad         ( char *filename );
00099 extern void     gocr_moduleClose        ( int id );
00100 extern int      gocr_moduleSetAttribute ( int id, void *a, void *b );
00101 
00102 extern int      gocr_functionInsertBefore       ( gocr_moduleType t, 
00103                                 char *functionname, void *data, int id );
00104 extern int      gocr_functionAppend     ( gocr_moduleType t,
00105                                 char *functionname, void *data );
00106 
00107 extern void *   gocr_functionDeleteById ( int id );
00108 
00109 /*extern int    gocr_runModuleFunction  ( int id );
00110 extern int      gocr_runModuleType      ( gocr_moduleType t ); */
00111 extern int      gocr_runAllModules      ( void );
00117 #ifdef PROTOTYPES
00118 
00119 /* are these needed? they may only add clumsiness */
00120 #define gocr_moduleFunction(funcname) \
00121                                 int func (pix *p, void *data)
00122 #define gocr_imageFilter(funcname) \
00123                                 void func ( void *v )
00124 #define gocr_blockFinder(funcname) \
00125                                 ( void *v )
00126 #define gocr_charFinder(funcname) \
00127                                 ( gocrBlock *b, void *v )
00128 #define gocr_charRecognizer(funcname) \
00129                                 ( gocrImage *pix, gocrBox *b, void *v )
00130 #define gocr_contextCorrection(funcname) \
00131                                 ( gocrImage *pix, gocrBox *b, void *v )
00132 #define gocr_outputFormatter(funcname) \
00133                                 ( void *v );
00134 
00135 #endif
00136 
00137 
00138 
00139 #endif /* GOCR_API_H */

Generated at Thu Mar 1 10:05:32 2001 for GOCR API by doxygen1.2.2 written by Dimitri van Heesch, © 1997-2000