chiark / gitweb /
much fixes for new arrangements
[ypp-sc-tools.web-live.git] / pctb / ocr.h
index 60234a8e91e6028ea8f028a912f0a53d8eafbc7d..a688742cc631f0bdb88b66bce1b3e8d360713794 100644 (file)
@@ -7,10 +7,6 @@
 #define OCR_H
 
 
-// #define DEBUG_RECTANGLES
-// #define DEBUG_OCR
-
-
 #define _GNU_SOURCE
 
 #include <string.h>
@@ -58,6 +54,26 @@ OcrResultGlyph *ocr(OcrReader *rd, OcrCellType, int w, Pixcol cols[]);
 
 /*----- debugging arrangements, rather contingent -----*/
 
+#define DEBUG_FLAG_LIST                                \
+   DF(ocr)                                     \
+   DF(rect)                                    \
+   DF(callout)
+
+enum {
+#define DF(f) dbg__shift_##f,
+  DEBUG_FLAG_LIST
+#undef DF
+};
+enum {
+#define DF(f) dbg_##f = 1 << dbg__shift_##f,
+  DEBUG_FLAG_LIST
+#undef DF
+};
+
+unsigned debug_flags;
+
+#define DEBUGP(f) (!!(debug_flags & dbg_##f))
+
 void debug_flush(void);
 
 #define eassert assert