training/training.h File Reference

#include "host.h"
#include "callcpp.h"

Go to the source code of this file.

Classes

Defines

Typedefs

Enumerations

Functions

Variables


Define Documentation

 
#define GetPicoFeatureLength (  )     (PICO_FEATURE_LENGTH)

Definition at line 57 of file training.h.

#define INTEL   0x4949

Definition at line 53 of file training.h.

#define MOTO   0x4d4d

Definition at line 54 of file training.h.

#define PICO_FEATURE_LENGTH   (0.05)

Definition at line 56 of file training.h.


Typedef Documentation

typedef FPOINT FVECTOR

Definition at line 51 of file training.h.


Enumeration Type Documentation

enum NORM_METHOD

Enumerator:
baseline 
character 
baseline 
character 

Definition at line 31 of file training.h.

00032 {
00033    baseline,
00034    character
00035 }


Function Documentation

void* c_alloc_mem ( INT32  count  ) 

Allocate count units of memory.

Parameters:
count Number of bytes to get
Returns:
Pointer to new memory or NULL

Definition at line 149 of file callcpp.cpp.

References alloc_mem().

00151                    {
00152   return alloc_mem (count);
00153 }

void* c_alloc_mem_p ( INT32  count  ) 

Allocate permanent space.

Parameters:
count Block size to allocate

Definition at line 142 of file callcpp.cpp.

References alloc_mem_p().

00144                      {
00145   return alloc_mem_p (count);
00146 }

char* c_alloc_string ( INT32  count  ) 

Allocate string.

Parameters:
count Number of chars required
Returns:
Pointer to memory or NULL

Definition at line 111 of file callcpp.cpp.

References alloc_string().

00113                       {
00114   return alloc_string (count);
00115 }

void* c_alloc_struct ( INT32  count,
const char *  name 
)

Allocate count units of memory for name Class.

Parameters:
count Number of chars required
name Class name

Definition at line 125 of file callcpp.cpp.

References alloc_struct().

00128                       {
00129   return alloc_struct (count, name);
00130 }

void c_check_mem ( char *  string,
INT8  level 
)

void c_clear_window ( void *  win  ) 

Clear window.

Parameters:
win Window

Definition at line 227 of file callcpp.cpp.

References WINFD::Clear_view_surface().

00228                                {
00229   WINDOW window = (WINDOW) win;
00230 
00231   window->Clear_view_surface ();
00232 }

void* c_create_window ( const char *  name,
INT16  xpos,
INT16  ypos,
INT16  xsize,
INT16  ysize,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)

Create new window for training interface.

Parameters:
name Name/title of window
xpos X coord of window
ypos Y coord of window
xsize Width, size of window
ysize Height, size of window
xmin Minimum x user can scroll
xmax Maximum x user can scroll
ymin Minimum y user can scroll
ymax Maximum y user can scroll

Definition at line 171 of file callcpp.cpp.

References create_window, FALSE, SCROLLINGWIN, and TRUE.

00181                        {
00182   return create_window (name, SCROLLINGWIN, xpos, ypos, xsize, ysize,
00183     xmin, xmax, ymin, ymax, TRUE, FALSE, FALSE, TRUE);
00184 }

void c_draw ( void *  win,
double  x,
double  y 
)

Draw line to new point (x,y) and move pen.

Parameters:
win Window
x To x
y To y

Definition at line 209 of file callcpp.cpp.

References WINFD::Draw2d().

00212                       {
00213   WINDOW window = (WINDOW) win;
00214 
00215   window->Draw2d (x, y);
00216 }

void c_free_mem ( void *  oldchunk  ) 

Free mem from alloc_mem.

Parameters:
oldchunk Chunk to free

Definition at line 156 of file callcpp.cpp.

References free_mem().

00158                  {
00159   free_mem(oldchunk); 
00160 }

void c_free_string ( char *  string  ) 

Free a string.

Parameters:
string String to free

Definition at line 118 of file callcpp.cpp.

References free_string().

00120                     {
00121   free_string(string); 
00122 }

void c_free_struct ( void *  deadstruct,
INT32  count,
const char *  name 
)

Free a structure of count bytes.

Parameters:
deadstruct Structure to free
count Number of bytes
name Class name

Definition at line 133 of file callcpp.cpp.

References free_struct().

00137                     {
00138   free_struct(deadstruct, count, name); 
00139 }

void c_line_color_index ( void *  win,
C_COL  index 
)

Sets color of line.

Parameters:
win Window
index Color (0 to 48) to set line to

Definition at line 187 of file callcpp.cpp.

References WINFD::Line_color_index().

00189                                      {
00190   WINDOW window = (WINDOW) win;
00191 
00192   //      ASSERT_HOST(index>=0 && index<=48);
00193   if (index < 0 || index > 48)
00194     index = (C_COL) 1;
00195   window->Line_color_index ((COLOUR) index);
00196 }

void c_make_current ( void *  win  ) 

Make picture current, FIX:.

Parameters:
win Window

Definition at line 219 of file callcpp.cpp.

References WINFD::Make_picture_current().

00220                                {
00221   WINDOW window = (WINDOW) win;
00222 
00223   window->Make_picture_current ();
00224 }

void c_move ( void *  win,
double  x,
double  y 
)

Move "current location" to new point (x,y).

Parameters:
win Window
x To x
y To y

Definition at line 199 of file callcpp.cpp.

References WINFD::Move2d().

00202                       {
00203   WINDOW window = (WINDOW) win;
00204 
00205   window->Move2d (x, y);
00206 }

void cprintf ( const char *  format,
  ... 
)

Does nothing at all, might output a trace printf.

Parameters:
format Special message
... Additional parameters

Definition at line 97 of file callcpp.cpp.

References tprintf().

00099   {
00100   va_list args;                  //variable args
00101   char msg[1000];
00102 
00103   va_start(args, format);  //variable list
00104   vsprintf(msg, format, args);  //Format into msg
00105   va_end(args); 
00106 
00107   tprintf ("%s", msg);
00108 }

void reverse16 ( void *  ptr  ) 

Inverts/flips 16-bit data (2 characters) pointed to by ptr.

Parameters:
ptr Pointer to data

Definition at line 261 of file callcpp.cpp.

00261                           { 
00262   char tmp;
00263   char *cptr = (char *) ptr;
00264 
00265   tmp = *cptr;
00266   *cptr = *(cptr + 1);
00267   *(cptr + 1) = tmp;
00268 }

void reverse32 ( void *  ptr  ) 

Inverts/flips 32-bit data (4 characters) pointed to by ptr.

Parameters:
ptr Pointer to data

Definition at line 248 of file callcpp.cpp.

00248                           { 
00249   char tmp;
00250   char *cptr = (char *) ptr;
00251 
00252   tmp = *cptr;
00253   *cptr = *(cptr + 3);
00254   *(cptr + 3) = tmp;
00255   tmp = *(cptr + 1);
00256   *(cptr + 1) = *(cptr + 2);
00257   *(cptr + 2) = tmp;
00258 }

char window_wait ( void *  win  ) 

Move pen.

Parameters:
win Window

Definition at line 235 of file callcpp.cpp.

References ANY_EVENT, await_event, graphicsevent::key, KEYPRESS_EVENT, TRUE, and graphicsevent::type.

00236                             {
00237   WINDOW window = (WINDOW) win;
00238   GRAPHICS_EVENT event;
00239 
00240   await_event(window, TRUE, ANY_EVENT, &event); 
00241   if (event.type == KEYPRESS_EVENT)
00242     return event.key;
00243   else
00244     return '\0';
00245 }


Variable Documentation

int LearningDebugLevel

int NormMethod


Generated on Wed Feb 28 19:49:27 2007 for Tesseract by  doxygen 1.5.1