Tesseract  3.02
tesseract-ocr/cutil/callcpp.h File Reference
#include "host.h"
#include "params.h"
#include "unichar.h"

Go to the source code of this file.

Enumerations

enum  C_COL {
  Black, White, Red, Yellow,
  Green, Cyan, Blue, Magenta,
  Aquamarine, Dark_SLATE_BLUE, Light_BLUE, Medium_BLUE,
  Midnight_BLUE, Navy_BLUE, Sky_BLUE, Slate_BLUE,
  Steel_BLUE, Coral, Brown, Sandy_BROWN,
  Gold, GoldENROD, Dark_GREEN, Dark_OLIVE_GREEN,
  Forest_GREEN, Lime_GREEN, Pale_GREEN, Yellow_GREEN,
  Light_GREY, Dark_SLATE_GREY, Dim_GREY, Grey,
  Khaki, Maroon, Orange, Orchid,
  Pink, Plum, Indian_RED, Orange_RED,
  Violet_RED, Salmon, Tan, Turqoise,
  Dark_TURQUOISE, Violet, Wheat, Green_YELLOW
}

Functions

void cprintf (const char *format,...)
ScrollViewc_create_window (const char *name, inT16 xpos, inT16 ypos, inT16 xsize, inT16 ysize, double xmin, double xmax, double ymin, double ymax)
void c_line_color_index (void *win, C_COL index)
void c_move (void *win, double x, double y)
void c_draw (void *win, double x, double y)
void c_make_current (void *win)
void c_clear_window (void *win)
char window_wait (ScrollView *win)
void reverse32 (void *ptr)
void reverse16 (void *ptr)

Enumeration Type Documentation

enum C_COL
Enumerator:
Black 
White 
Red 
Yellow 
Green 
Cyan 
Blue 
Magenta 
Aquamarine 
Dark_SLATE_BLUE 
Light_BLUE 
Medium_BLUE 
Midnight_BLUE 
Navy_BLUE 
Sky_BLUE 
Slate_BLUE 
Steel_BLUE 
Coral 
Brown 
Sandy_BROWN 
Gold 
GoldENROD 
Dark_GREEN 
Dark_OLIVE_GREEN 
Forest_GREEN 
Lime_GREEN 
Pale_GREEN 
Yellow_GREEN 
Light_GREY 
Dark_SLATE_GREY 
Dim_GREY 
Grey 
Khaki 
Maroon 
Orange 
Orchid 
Pink 
Plum 
Indian_RED 
Orange_RED 
Violet_RED 
Salmon 
Tan 
Turqoise 
Dark_TURQUOISE 
Violet 
Wheat 
Green_YELLOW 

Definition at line 32 of file callcpp.h.


Function Documentation

void c_clear_window ( void *  win)

Definition at line 105 of file callcpp.cpp.

                               {
  ScrollView* window = (ScrollView*) win;
  window->Clear();
}
ScrollView* c_create_window ( const char *  name,
inT16  xpos,
inT16  ypos,
inT16  xsize,
inT16  ysize,
double  xmin,
double  xmax,
double  ymin,
double  ymax 
)

Definition at line 56 of file callcpp.cpp.

                       {
   return new ScrollView(name, xpos, ypos, xsize, ysize, xmax - xmin, ymax - ymin, true);
}
void c_draw ( void *  win,
double  x,
double  y 
)

Definition at line 89 of file callcpp.cpp.

                      {
  ScrollView* window = (ScrollView*) win;
  window->DrawTo((int) x, (int) y);
}
void c_line_color_index ( void *  win,
C_COL  index 
)

Definition at line 71 of file callcpp.cpp.

                                     {
 // The colors are the same as the SV ones except that SV has COLOR:NONE --> offset of 1
 ScrollView* window = (ScrollView*) win;
 window->Pen((ScrollView::Color) (index + 1));
}
void c_make_current ( void *  win)

Definition at line 98 of file callcpp.cpp.

                               {
  ScrollView* window = (ScrollView*) win;
  window->Update();
}
void c_move ( void *  win,
double  x,
double  y 
)

Definition at line 80 of file callcpp.cpp.

                      {
  ScrollView* window = (ScrollView*) win;
  window->SetCursor((int) x, (int) y);
}
void cprintf ( const char *  format,
  ... 
)

Definition at line 41 of file callcpp.cpp.

  {
  va_list args;                  //variable args
  char msg[1000];

  va_start(args, format);  //variable list
  vsprintf(msg, format, args);  //Format into msg
  va_end(args);

  tprintf ("%s", msg);
}
void reverse16 ( void *  ptr)

Definition at line 141 of file callcpp.cpp.

                          {
  char tmp;
  char *cptr = (char *) ptr;

  tmp = *cptr;
  *cptr = *(cptr + 1);
  *(cptr + 1) = tmp;
}
void reverse32 ( void *  ptr)

Definition at line 128 of file callcpp.cpp.

                          {
  char tmp;
  char *cptr = (char *) ptr;

  tmp = *cptr;
  *cptr = *(cptr + 3);
  *(cptr + 3) = tmp;
  tmp = *(cptr + 1);
  *(cptr + 1) = *(cptr + 2);
  *(cptr + 2) = tmp;
}
char window_wait ( ScrollView win)

Definition at line 112 of file callcpp.cpp.

                                  {
  SVEvent* ev;
  // Wait till an input or click event (all others are thrown away)
  char ret = '\0';
  SVEventType ev_type = SVET_ANY;
  do {
    ev = win->AwaitEvent(SVET_ANY);
    ev_type = ev->type;
    if (ev_type == SVET_INPUT)
      ret = ev->parameter[0];
    delete ev;
  } while (ev_type != SVET_INPUT && ev_type != SVET_CLICK);
  return ret;
}