27 #ifndef CCUTIL_OCRCLASS_H_ 28 #define CCUTIL_OCRCLASS_H_ 32 #include "gettimeofday.h" 41 #define MAX_FONT_NAME 34 42 #define MAX_OCR_NAME 32 43 #define MAX_OCR_VERSION 17 113 typedef bool (*CANCEL_FUNC)(
void*
cancel_this,
int words);
114 typedef bool (*PROGRESS_FUNC)(
int progress,
int left,
int right,
int top,
116 typedef bool (*PROGRESS_FUNC2)(
ETEXT_DESC* ths,
int left,
int right,
int top,
144 progress_callback(nullptr),
146 cancel_this(nullptr) {
154 int32_t deadline_secs = deadline_msecs / 1000;
156 end_time.tv_usec += (deadline_msecs - deadline_secs * 1000) * 1000;
167 gettimeofday(&now,
nullptr);
184 #endif // CCUTIL_OCRCLASS_H_ int16_t top
Definition: ocrclass.h:86
uint8_t point_size
Definition: ocrclass.h:90
int16_t font_index
Definition: ocrclass.h:88
ETEXT_DESC()
character data
Definition: ocrclass.h:137
uint8_t confidence
Definition: ocrclass.h:89
int16_t count
Definition: ocrclass.h:121
int8_t err_code
ocr sets to 1, HP 0
Definition: ocrclass.h:128
int8_t blanks
Definition: ocrclass.h:91
Definition: ocrclass.h:74
static bool default_progress_func(ETEXT_DESC *ths, int left, int right, int top, int bottom)
Definition: ocrclass.h:173
uint16_t char_code
Definition: ocrclass.h:83
CANCEL_FUNC cancel
for errcode use
Definition: ocrclass.h:129
PROGRESS_FUNC progress_callback
returns true to cancel
Definition: ocrclass.h:130
volatile int8_t ocr_alive
true if not last
Definition: ocrclass.h:127
int16_t bottom
Definition: ocrclass.h:87
struct timeval end_time
this or other data for cancel
Definition: ocrclass.h:133
int8_t more_to_come
percent complete increasing (0-100)
Definition: ocrclass.h:126
PROGRESS_FUNC2 progress_callback2
called whenever progress increases
Definition: ocrclass.h:131
void set_deadline_msecs(int32_t deadline_msecs)
Definition: ocrclass.h:152
bool deadline_exceeded() const
Definition: ocrclass.h:164
uint8_t formatting
Definition: ocrclass.h:92
int16_t right
Definition: ocrclass.h:85
Definition: ocrclass.h:119
void * cancel_this
monitor-aware progress callback
Definition: ocrclass.h:132
int16_t left
Definition: ocrclass.h:84
EANYCODE_CHAR text[1]
Definition: ocrclass.h:135
int16_t progress
chars in this buffer(0)
Definition: ocrclass.h:122