training/training.cpp

Go to the documentation of this file.
00001 
00021 #include "training.h"
00022 #include "debug.h"
00023 #include "memry.h"
00024 #include "grphics.h"
00025 #include "evnts.h"
00026 
00029 make_int_var    (LearningDebugLevel, 0, MakeLearningDebugLevel,
00030       18, 5, SetLearningDebugLevel, "Learning Debug Level: ");
00031 
00032 make_int_var   (NormMethod, character, MakeNormMethod,
00033       15, 10, SetNormMethod, "Normalization Method   ...")
00040 char *demodir;
00041 
00048 void     cprintf(
00049 const char  *format,...
00050 )
00051 {
00052 }// cprintf
00053 
00060 char     *c_alloc_string(
00061 INT32    count
00062 )
00063 {
00064    return alloc_string(count);
00065 }// c_alloc_string
00066 
00072 void     c_free_string(
00073 char     *string  
00074 )
00075 {
00076    free_string(string);
00077 }// c_free_string
00078 
00084 void     *c_alloc_mem_p(
00085 INT32    count
00086 )
00087 {
00088    return alloc_mem_p(count);
00089 }// c_alloc_mem_p
00090 
00097 void     *c_alloc_mem(
00098 INT32    count
00099 )
00100 {
00101    return alloc_mem(count);
00102 }// c_alloc_mem
00103 
00109 void     c_free_mem(
00110 void     *oldchunk
00111 )
00112 {
00113    free_mem(oldchunk);
00114 }// c_free_mem
00115 
00122 void     c_check_mem(
00123 const char  *string,
00124 INT8     level
00125 )
00126 {
00127    check_mem(string,level);
00128 }// c_check_mem
00129 
00136 void*    c_alloc_struct(
00137 INT32    count,
00138 const char* name
00139 )
00140 {
00141    return alloc_struct(count,name);
00142 }// c_alloc_struct
00143 
00151 void     c_free_struct(
00152 void*    deadstruct,
00153 INT32    count,
00154 const char* name
00155 )
00156 {
00157    free_struct(deadstruct,count,name);
00158 }// c_free_struct
00159 
00165 void     c_make_current(
00166 void*    win
00167 )
00168 {
00169    WINDOW               window=(WINDOW)win;
00170 
00171    window->Make_picture_current();
00172 }// c_make_current
00173 
00179 void     reverse32(
00180 void*    ptr
00181 )
00182 {
00183    char              tmp;
00184    char*             cptr=(char*)ptr;
00185 
00186    tmp=*cptr;
00187    *cptr=*(cptr+3);
00188    *(cptr+3)=tmp;
00189    tmp=*(cptr+1);
00190    *(cptr+1)=*(cptr+2);
00191    *(cptr+2)=tmp;
00192 }// reverse32
00193 
00199 void     reverse16(
00200 void*    ptr
00201 )
00202 {
00203    char              tmp;
00204    char*             cptr=(char*)ptr;
00205 
00206    tmp=*cptr;
00207    *cptr=*(cptr+1);
00208    *(cptr+1)=tmp;
00209 }// reverse16
00210 
00224 void*    c_create_window(
00225 const char  *name,
00226 INT16    xpos,
00227 INT16    ypos,
00228 INT16    xsize,
00229 INT16    ysize,
00230 double      xmin,
00231 double      xmax,
00232 double      ymin,
00233 double      ymax
00234 )
00235 {
00236    return create_window(name,SCROLLINGWIN,xpos,ypos,xsize,ysize,
00237       xmin,xmax,ymin,ymax,TRUE,FALSE,FALSE,TRUE);
00238 }// c_create_window
00239 
00246 void     c_line_color_index(
00247 void*    win,
00248 C_COL    index
00249 )
00250 {
00251    WINDOW               window=(WINDOW)win;
00252 
00253 // ASSERT_HOST(index>=0 && index<=48);
00254    if (index<0 || index>48)
00255       index=(C_COL)1;
00256    window->Line_color_index((COLOUR)index);
00257 }
00258 
00266 void     c_move(
00267 void*    win,
00268 double      x,
00269 double      y
00270 )
00271 {
00272    WINDOW               window=(WINDOW)win;
00273 
00274    window->Move2d(x,y);
00275 }// c_move
00276 
00284 void     c_draw(
00285 void*    win,
00286 double      x,
00287 double      y
00288 )
00289 {
00290    WINDOW               window=(WINDOW)win;
00291 
00292    window->Draw2d(x,y);
00293 }// c_draw
00294 
00300 void     c_clear_window(
00301 void*    win
00302 )
00303 {
00304    WINDOW               window=(WINDOW)win;
00305 
00306    window->Clear_view_surface();
00307 }// c_clear_window
00308 
00313 char  window_wait(
00314 void* win
00315 )
00316 {
00317    WINDOW               window=(WINDOW)win;
00318    GRAPHICS_EVENT       event;
00319 
00320    await_event(window,TRUE,ANY_EVENT,&event);
00321    if (event.type==KEYPRESS_EVENT)
00322       return event.key;
00323    else
00324       return '\0';
00325 }// window_wait

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