tesseract  4.00.00dev
drawedg.cpp File Reference
#include "drawedg.h"

Go to the source code of this file.

Macros

#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)
 

Macro Definition Documentation

◆ EXTERN

#define EXTERN

Definition at line 36 of file drawedg.cpp.

◆ IMAGE_WIN_NAME

#define IMAGE_WIN_NAME   "Edges"

title of window

Definition at line 31 of file drawedg.cpp.

◆ IMAGE_XPOS

#define IMAGE_XPOS   250

Definition at line 32 of file drawedg.cpp.

◆ IMAGE_YPOS

#define IMAGE_YPOS   0

default position

Definition at line 34 of file drawedg.cpp.

Function Documentation

◆ create_edges_window()

ScrollView* create_edges_window ( ICOORD  page_tr)

Definition at line 45 of file drawedg.cpp.

45  {
46  ScrollView* image_win; //image window
47 
48  //create the window
49  image_win = new ScrollView (IMAGE_WIN_NAME, IMAGE_XPOS, IMAGE_YPOS, 0, 0, page_tr.x (), page_tr.y ());
50  return image_win; //window
51 }
inT16 x() const
access function
Definition: points.h:52
ScrollView * image_win
Definition: pgedit.cpp:107
#define IMAGE_WIN_NAME
Definition: drawedg.cpp:31
#define IMAGE_YPOS
Definition: drawedg.cpp:34
inT16 y() const
access_function
Definition: points.h:56
#define IMAGE_XPOS
Definition: drawedg.cpp:32

◆ draw_raw_edge()

void draw_raw_edge ( ScrollView fd,
CRACKEDGE start,
ScrollView::Color  colour 
)

Definition at line 63 of file drawedg.cpp.

65  {
66  CRACKEDGE *edgept; //current point
67 
68  fd->Pen(colour);
69  edgept = start;
70  fd->SetCursor(edgept->pos.x (), edgept->pos.y ());
71  do {
72  do
73  edgept = edgept->next;
74  //merge straight lines
75  while (edgept != start && edgept->prev->stepx == edgept->stepx && edgept->prev->stepy == edgept->stepy);
76 
77  //draw lines
78  fd->DrawTo(edgept->pos.x (), edgept->pos.y ());
79  }
80  while (edgept != start);
81 }
void DrawTo(int x, int y)
Definition: scrollview.cpp:531
inT16 x() const
access function
Definition: points.h:52
ICOORD pos
Definition: crakedge.h:30
inT8 stepx
Definition: crakedge.h:31
CRACKEDGE * prev
Definition: crakedge.h:34
void Pen(Color color)
Definition: scrollview.cpp:726
CRACKEDGE * next
Definition: crakedge.h:35
void SetCursor(int x, int y)
Definition: scrollview.cpp:525
inT16 y() const
access_function
Definition: points.h:56
inT8 stepy
Definition: crakedge.h:32