Skip to content

Commit

Permalink
Add info for progress monitor, make it visible in doxygen doc; remove…
Browse files Browse the repository at this point in the history
… commented code
  • Loading branch information
zdenop committed Jan 5, 2016
1 parent c53add7 commit 1db9482
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
1 change: 0 additions & 1 deletion ccmain/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ bool Tesseract::RecogAllWordsPassN(int pass_n, ETEXT_DESC* monitor,
if (monitor != NULL) {
monitor->ocr_alive = TRUE;
if (pass_n == 1) {
// monitor->progress = 30 + 50 * w / words->size();
monitor->progress = 70 * w / words->size();
if (monitor->progress_callback != NULL) {
TBOX box = pr_it->word()->word->bounding_box();
Expand Down
25 changes: 14 additions & 11 deletions ccutil/ocrclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,20 @@ typedef bool (*PROGRESS_FUNC)(int progress,

class ETEXT_DESC { // output header
public:
inT16 count; // chars in this buffer(0)
inT16 progress; // percent complete increasing (0-100)
inT8 more_to_come; // true if not last
volatile inT8 ocr_alive; // ocr sets to 1, HP 0
inT8 err_code; // for errcode use
CANCEL_FUNC cancel; // returns true to cancel
PROGRESS_FUNC progress_callback; // called whenever progress increases
void* cancel_this; // this or other data for cancel
struct timeval end_time; // time to stop. expected to be set only by call
// to set_deadline_msecs()
EANYCODE_CHAR text[1]; // character data
inT16 count; /// chars in this buffer(0)
inT16 progress; /// percent complete increasing (0-100)
/** Progress monitor covers word recognition and it does not cover layout
* analysis.
* See Ray comment in https://github.com/tesseract-ocr/tesseract/pull/27 */
inT8 more_to_come; /// true if not last
volatile inT8 ocr_alive; /// ocr sets to 1, HP 0
inT8 err_code; /// for errcode use
CANCEL_FUNC cancel; /// returns true to cancel
PROGRESS_FUNC progress_callback; /// called whenever progress increases
void* cancel_this; /// this or other data for cancel
struct timeval end_time; /** time to stop. expected to be set only by call
* to set_deadline_msecs() */
EANYCODE_CHAR text[1]; /// character data

ETEXT_DESC() : count(0), progress(0), more_to_come(0), ocr_alive(0),
err_code(0), cancel(NULL), cancel_this(NULL) {
Expand Down

0 comments on commit 1db9482

Please sign in to comment.