tesseract  4.0.0-1-g2a2b
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
 

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

◆ 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 43 of file drawedg.cpp.

43  {
44  ScrollView* image_win; //image window
45 
46  //create the window
47  image_win = new ScrollView (IMAGE_WIN_NAME, IMAGE_XPOS, IMAGE_YPOS, 0, 0, page_tr.x (), page_tr.y ());
48  return image_win; //window
49 }
#define IMAGE_WIN_NAME
Definition: drawedg.cpp:31
int16_t y() const
access_function
Definition: points.h:57
int16_t x() const
access function
Definition: points.h:53
#define IMAGE_XPOS
Definition: drawedg.cpp:32
#define IMAGE_YPOS
Definition: drawedg.cpp:34

◆ draw_raw_edge()

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

Definition at line 61 of file drawedg.cpp.

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