chiark / gitweb /
new context arrangements
[ypp-sc-tools.db-test.git] / pctb / ocr.h
index 26bccbc7b83b81bb693b27995063ed7cedbecc1d..d08ae15ba8b0878a990b0a135e39fbf84cdbb0e9 100644 (file)
@@ -1,12 +1,15 @@
 #ifndef OCR_H
 #define OCR_H
 
+#define _GNU_SOURCE
+
 #include <pam.h>
 #include <stdint.h>
 #include <inttypes.h>
 #include <assert.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 
@@ -19,16 +22,23 @@ typedef struct {
   int ctx; /* match context index */
 } OcrResultGlyph;
 
-OcrResultGlyph *ocr(int w, int h, Pixcol cols[]);
+typedef const struct OcrGlyphContextDeveloperInfo *OcrCellContext;
+extern const struct OcrGlyphContextDeveloperInfo *ocr_celltype_text;
+extern const struct OcrGlyphContextDeveloperInfo *ocr_celltype_number;
+
+typedef struct OcrReader OcrReader;
+OcrReader *ocr_init(int h);
+
+OcrResultGlyph *ocr(OcrReader *rd, int w, Pixcol cols[]);
   /* return value is array terminated by {0,-1,-1}
    * array is valid until next call to ocr()
    */
 
-void ocr_init(void);
-
 void debug_flush(void);
 
 #define eassert assert
 #define debug stdout
 
+const char *get_vardir(void);
+
 #endif /*OCR_H*/