X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Focr.h;h=60234a8e91e6028ea8f028a912f0a53d8eafbc7d;hb=0826bbc65e59d47c270f05af419f24fdfc3c349c;hp=b77a56f8905f5269cddedc4d33de783490ece33a;hpb=d3eaa28d304c5b0639bc0f7e29b3285317d5c1e7;p=ypp-sc-tools.main.git diff --git a/pctb/ocr.h b/pctb/ocr.h index b77a56f..60234a8 100644 --- a/pctb/ocr.h +++ b/pctb/ocr.h @@ -1,19 +1,37 @@ +/* + * ocr.c forms a mostly-self-contained bit + * so we put its declarations in this separate file + */ + #ifndef OCR_H #define OCR_H + +// #define DEBUG_RECTANGLES +// #define DEBUG_OCR + + #define _GNU_SOURCE -#include -#include -#include -#include #include -#include #include +#include +#include +#include +#include +#include #include +#include + #include #include + +typedef struct { + int w,h; + char d[]; +} CanonImage; + typedef uint32_t Pixcol; #define PSPIXCOL(priscan) priscan##32 @@ -23,10 +41,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; + typedef struct OcrReader OcrReader; OcrReader *ocr_init(int h); @@ -35,15 +55,14 @@ OcrResultGlyph *ocr(OcrReader *rd, OcrCellType, int w, Pixcol cols[]); * array is valid until next call to ocr() */ + +/*----- debugging arrangements, rather contingent -----*/ + void debug_flush(void); #define eassert assert -#define debug stdout +#define debug stderr const char *get_vardir(void); - -/* #define DEBUG_RECTANGLES */ -/* #define DEBUG_OCR */ - #endif /*OCR_H*/