Tesseract  3.02
tesseract-ocr/textord/drawedg.cpp File Reference
#include "mfcpch.h"
#include "drawedg.h"

Go to the source code of this file.

Defines

#define IMAGE_WIN_NAME   "Edges"
#define IMAGE_XPOS   250
#define IMAGE_YPOS   0
#define EXTERN

Functions

create_edges_window

Create the edges window.

Parameters:
page_trsize of image
ScrollViewcreate_edges_window (ICOORD page_tr)
draw_raw_edge

Draw the raw steps to the given window in the given colour.

Parameters:
fdwindow to draw in
startstart of loop
colourcolour to draw in
void draw_raw_edge (ScrollView *fd, CRACKEDGE *start, ScrollView::Color colour)

Define Documentation

#define EXTERN

Definition at line 36 of file drawedg.cpp.

#define IMAGE_WIN_NAME   "Edges"

title of window

Definition at line 31 of file drawedg.cpp.

#define IMAGE_XPOS   250

Definition at line 32 of file drawedg.cpp.

#define IMAGE_YPOS   0

default position

Definition at line 34 of file drawedg.cpp.


Function Documentation

ScrollView* create_edges_window ( ICOORD  page_tr)

Definition at line 45 of file drawedg.cpp.

                                                {
  ScrollView* image_win;              //image window

                                 //create the window
  image_win = new ScrollView (IMAGE_WIN_NAME, IMAGE_XPOS, IMAGE_YPOS, 0, 0, page_tr.x (),  page_tr.y ());
  return image_win;              //window
}
void draw_raw_edge ( ScrollView fd,
CRACKEDGE start,
ScrollView::Color  colour 
)

Definition at line 63 of file drawedg.cpp.

                                           {
  CRACKEDGE *edgept;             //current point

  fd->Pen(colour);
  edgept = start;
  fd->SetCursor(edgept->pos.x (), edgept->pos.y ());
  do {
    do
    edgept = edgept->next;
                                 //merge straight lines
    while (edgept != start && edgept->prev->stepx == edgept->stepx && edgept->prev->stepy == edgept->stepy);

                                 //draw lines
  fd->DrawTo(edgept->pos.x (), edgept->pos.y ());
  }
  while (edgept != start);
}