X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=blobdiff_plain;f=pctb%2Focr.h;h=5a08b5051dc0902d325c164e5fbac0d554e877e0;hp=d8491e68f7dfef0eb0ad634e5473353bfeb092a6;hb=52210ae670b22ce2d187bd2dc943fd8ae3f4a8c0;hpb=80b5d5ede35cfb393591ed6326ca97ca23ce0c31 diff --git a/pctb/ocr.h b/pctb/ocr.h index d8491e6..5a08b50 100644 --- a/pctb/ocr.h +++ b/pctb/ocr.h @@ -1,24 +1,23 @@ +/* + * ocr.c forms a mostly-self-contained bit + * so we put its declarations in this separate file + */ + #ifndef OCR_H #define OCR_H -#define _GNU_SOURCE +#include "common.h" -#include -#include -#include -#include #include -#include #include -#include -#include -#include - +#include +#include +#include +#include +#include +#include -typedef struct { - int w,h; - char d[]; -} CanonImage; +#include typedef uint32_t Pixcol; @@ -30,9 +29,12 @@ typedef struct { unsigned ctxmap; /* match context index */ } OcrResultGlyph; + typedef const struct OcrCellTypeInfo *OcrCellType; extern const struct OcrCellTypeInfo ocr_celltype_text; extern const struct OcrCellTypeInfo ocr_celltype_number; +const char *ocr_celltype_name(OcrCellType ct); + typedef struct OcrReader OcrReader; OcrReader *ocr_init(int h); @@ -42,18 +44,5 @@ OcrResultGlyph *ocr(OcrReader *rd, OcrCellType, int w, Pixcol cols[]); * array is valid until next call to ocr() */ -void debug_flush(void); - -#define eassert assert -#define debug stdout - -const char *get_vardir(void); - -CanonImage *file_read_image(FILE *f); -int main_test(void); - - -#define DEBUG_RECTANGLES -// #define DEBUG_OCR #endif /*OCR_H*/