tesseract  4.00.00dev
ETEXT_DESC Class Reference

#include <ocrclass.h>

Public Member Functions

 ETEXT_DESC ()
 character data More...
 
void set_deadline_msecs (inT32 deadline_msecs)
 
bool deadline_exceeded () const
 

Public Attributes

inT16 count
 
inT16 progress
 chars in this buffer(0) More...
 
inT8 more_to_come
 percent complete increasing (0-100) More...
 
volatile inT8 ocr_alive
 true if not last More...
 
inT8 err_code
 ocr sets to 1, HP 0 More...
 
CANCEL_FUNC cancel
 for errcode use More...
 
PROGRESS_FUNC progress_callback
 returns true to cancel More...
 
void * cancel_this
 called whenever progress increases More...
 
struct timeval end_time
 this or other data for cancel More...
 
EANYCODE_CHAR text [1]
 

Detailed Description

Definition at line 115 of file ocrclass.h.

Constructor & Destructor Documentation

◆ ETEXT_DESC()

ETEXT_DESC::ETEXT_DESC ( )
inline

character data

Definition at line 132 of file ocrclass.h.

133  : count(0),
134  progress(0),
135  more_to_come(0),
136  ocr_alive(0),
137  err_code(0),
138  cancel(NULL),
139  progress_callback(NULL),
140  cancel_this(NULL) {
141  end_time.tv_sec = 0;
142  end_time.tv_usec = 0;
143  }
volatile inT8 ocr_alive
true if not last
Definition: ocrclass.h:123
inT16 count
Definition: ocrclass.h:117
void * cancel_this
called whenever progress increases
Definition: ocrclass.h:127
inT8 err_code
ocr sets to 1, HP 0
Definition: ocrclass.h:124
PROGRESS_FUNC progress_callback
returns true to cancel
Definition: ocrclass.h:126
inT8 more_to_come
percent complete increasing (0-100)
Definition: ocrclass.h:122
CANCEL_FUNC cancel
for errcode use
Definition: ocrclass.h:125
struct timeval end_time
this or other data for cancel
Definition: ocrclass.h:128
inT16 progress
chars in this buffer(0)
Definition: ocrclass.h:118

Member Function Documentation

◆ deadline_exceeded()

bool ETEXT_DESC::deadline_exceeded ( ) const
inline

Definition at line 158 of file ocrclass.h.

158  {
159  if (end_time.tv_sec == 0 && end_time.tv_usec == 0) return false;
160  struct timeval now;
161  gettimeofday(&now, NULL);
162  return (now.tv_sec > end_time.tv_sec || (now.tv_sec == end_time.tv_sec &&
163  now.tv_usec > end_time.tv_usec));
164  }
struct timeval end_time
this or other data for cancel
Definition: ocrclass.h:128
int gettimeofday(struct timeval *tp, struct timezone *tzp)

◆ set_deadline_msecs()

void ETEXT_DESC::set_deadline_msecs ( inT32  deadline_msecs)
inline

Definition at line 146 of file ocrclass.h.

146  {
147  gettimeofday(&end_time, NULL);
148  inT32 deadline_secs = deadline_msecs / 1000;
149  end_time.tv_sec += deadline_secs;
150  end_time.tv_usec += (deadline_msecs - deadline_secs * 1000) * 1000;
151  if (end_time.tv_usec > 1000000) {
152  end_time.tv_usec -= 1000000;
153  ++end_time.tv_sec;
154  }
155  }
int32_t inT32
Definition: host.h:38
struct timeval end_time
this or other data for cancel
Definition: ocrclass.h:128
int gettimeofday(struct timeval *tp, struct timezone *tzp)

Member Data Documentation

◆ cancel

CANCEL_FUNC ETEXT_DESC::cancel

for errcode use

Definition at line 125 of file ocrclass.h.

◆ cancel_this

void* ETEXT_DESC::cancel_this

called whenever progress increases

Definition at line 127 of file ocrclass.h.

◆ count

inT16 ETEXT_DESC::count

Definition at line 117 of file ocrclass.h.

◆ end_time

struct timeval ETEXT_DESC::end_time

this or other data for cancel

Definition at line 128 of file ocrclass.h.

◆ err_code

inT8 ETEXT_DESC::err_code

ocr sets to 1, HP 0

Definition at line 124 of file ocrclass.h.

◆ more_to_come

inT8 ETEXT_DESC::more_to_come

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

Definition at line 122 of file ocrclass.h.

◆ ocr_alive

volatile inT8 ETEXT_DESC::ocr_alive

true if not last

Definition at line 123 of file ocrclass.h.

◆ progress

inT16 ETEXT_DESC::progress

chars in this buffer(0)

Definition at line 118 of file ocrclass.h.

◆ progress_callback

PROGRESS_FUNC ETEXT_DESC::progress_callback

returns true to cancel

Definition at line 126 of file ocrclass.h.

◆ text

EANYCODE_CHAR ETEXT_DESC::text[1]

Time to stop. Expected to be set only by call to set_deadline_msecs().

Definition at line 130 of file ocrclass.h.


The documentation for this class was generated from the following file: