@@ -101,13 +101,17 @@ typedef struct { /*single character */
101
101
* the OCR engine is storing its output to shared memory.
102
102
* During progress, all the buffer info is -1.
103
103
* Progress starts at 0 and increases to 100 during OCR. No other constraint.
104
+ * Additionally the progress callback contains the bounding box of the word that
105
+ * is currently being processed.
104
106
* Every progress callback, the OCR engine must set ocr_alive to 1.
105
107
* The HP side will set ocr_alive to 0. Repeated failure to reset
106
108
* to 1 indicates that the OCR engine is dead.
107
109
* If the cancel function is not null then it is called with the number of
108
110
* user words found. If it returns true then operation is cancelled.
109
111
**********************************************************************/
110
112
typedef bool (*CANCEL_FUNC)(void * cancel_this, int words);
113
+ typedef bool (*PROGRESS_FUNC)(int progress,
114
+ int left, int right, int top, int bottom);
111
115
112
116
class ETEXT_DESC { // output header
113
117
public:
@@ -117,6 +121,7 @@ class ETEXT_DESC { // output header
117
121
volatile inT8 ocr_alive; // ocr sets to 1, HP 0
118
122
inT8 err_code; // for errcode use
119
123
CANCEL_FUNC cancel; // returns true to cancel
124
+ PROGRESS_FUNC progress_callback; // called whenever progress increases
120
125
void * cancel_this; // this or other data for cancel
121
126
struct timeval end_time; // time to stop. expected to be set only by call
122
127
// to set_deadline_msecs()
0 commit comments