tesseract  4.0.0-1-g2a2b
ETEXT_DESC Class Reference

#include <ocrclass.h>

Public Member Functions

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

Public Attributes

int16_t count
 
int16_t progress
 chars in this buffer(0) More...
 
int8_t more_to_come
 percent complete increasing (0-100) More...
 
volatile int8_t ocr_alive
 true if not last More...
 
int8_t 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...
 
PROGRESS_FUNC2 progress_callback2
 called whenever progress increases More...
 
void * cancel_this
 monitor-aware progress callback More...
 
struct timeval end_time
 this or other data for cancel More...
 
EANYCODE_CHAR text [1]
 

Detailed Description

Definition at line 119 of file ocrclass.h.

Constructor & Destructor Documentation

◆ ETEXT_DESC()

ETEXT_DESC::ETEXT_DESC ( )
inline

character data

Definition at line 137 of file ocrclass.h.

138  : count(0),
139  progress(0),
140  more_to_come(0),
141  ocr_alive(0),
142  err_code(0),
143  cancel(nullptr),
144  progress_callback(nullptr),
145  progress_callback2(&default_progress_func),
146  cancel_this(nullptr) {
147  end_time.tv_sec = 0;
148  end_time.tv_usec = 0;
149  }
void * cancel_this
monitor-aware progress callback
Definition: ocrclass.h:132
int8_t err_code
ocr sets to 1, HP 0
Definition: ocrclass.h:128
struct timeval end_time
this or other data for cancel
Definition: ocrclass.h:133
volatile int8_t ocr_alive
true if not last
Definition: ocrclass.h:127
PROGRESS_FUNC progress_callback
returns true to cancel
Definition: ocrclass.h:130
int8_t more_to_come
percent complete increasing (0-100)
Definition: ocrclass.h:126
CANCEL_FUNC cancel
for errcode use
Definition: ocrclass.h:129
PROGRESS_FUNC2 progress_callback2
called whenever progress increases
Definition: ocrclass.h:131
int16_t progress
chars in this buffer(0)
Definition: ocrclass.h:122
int16_t count
Definition: ocrclass.h:121

Member Function Documentation

◆ deadline_exceeded()

bool ETEXT_DESC::deadline_exceeded ( ) const
inline

Definition at line 164 of file ocrclass.h.

164  {
165  if (end_time.tv_sec == 0 && end_time.tv_usec == 0) return false;
166  struct timeval now;
167  gettimeofday(&now, nullptr);
168  return (now.tv_sec > end_time.tv_sec || (now.tv_sec == end_time.tv_sec &&
169  now.tv_usec > end_time.tv_usec));
170  }
int gettimeofday(struct timeval *tp, struct timezone *tzp)
struct timeval end_time
this or other data for cancel
Definition: ocrclass.h:133

◆ set_deadline_msecs()

void ETEXT_DESC::set_deadline_msecs ( int32_t  deadline_msecs)
inline

Definition at line 152 of file ocrclass.h.

152  {
153  gettimeofday(&end_time, nullptr);
154  int32_t deadline_secs = deadline_msecs / 1000;
155  end_time.tv_sec += deadline_secs;
156  end_time.tv_usec += (deadline_msecs - deadline_secs * 1000) * 1000;
157  if (end_time.tv_usec > 1000000) {
158  end_time.tv_usec -= 1000000;
159  ++end_time.tv_sec;
160  }
161  }
int gettimeofday(struct timeval *tp, struct timezone *tzp)
struct timeval end_time
this or other data for cancel
Definition: ocrclass.h:133

Member Data Documentation

◆ cancel

CANCEL_FUNC ETEXT_DESC::cancel

for errcode use

Definition at line 129 of file ocrclass.h.

◆ cancel_this

void* ETEXT_DESC::cancel_this

monitor-aware progress callback

Definition at line 132 of file ocrclass.h.

◆ count

int16_t ETEXT_DESC::count

Definition at line 121 of file ocrclass.h.

◆ end_time

struct timeval ETEXT_DESC::end_time

this or other data for cancel

Definition at line 133 of file ocrclass.h.

◆ err_code

int8_t ETEXT_DESC::err_code

ocr sets to 1, HP 0

Definition at line 128 of file ocrclass.h.

◆ more_to_come

int8_t 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 126 of file ocrclass.h.

◆ ocr_alive

volatile int8_t ETEXT_DESC::ocr_alive

true if not last

Definition at line 127 of file ocrclass.h.

◆ progress

int16_t ETEXT_DESC::progress

chars in this buffer(0)

Definition at line 122 of file ocrclass.h.

◆ progress_callback

PROGRESS_FUNC ETEXT_DESC::progress_callback

returns true to cancel

Definition at line 130 of file ocrclass.h.

◆ progress_callback2

PROGRESS_FUNC2 ETEXT_DESC::progress_callback2

called whenever progress increases

Definition at line 131 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 135 of file ocrclass.h.


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