tesseract  4.0.0-1-g2a2b
drawedg.h File Reference
#include "scrollview.h"
#include "crakedge.h"

Go to the source code of this file.

Functions

ScrollViewcreate_edges_window (ICOORD page_tr)
 
void draw_raw_edge (ScrollView *fd, CRACKEDGE *start, ScrollView::Color colour)
 

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