tesseract  5.0.0-alpha-619-ge9db
plotedges.cpp File Reference
#include "plotedges.h"
#include "render.h"
#include "split.h"

Go to the source code of this file.

Functions

void display_edgepts (LIST outlines)
 
void draw_blob_edges (TBLOB *blob)
 
void mark_outline (EDGEPT *edgept)
 

Variables

ScrollViewedge_window = nullptr
 

Function Documentation

◆ display_edgepts()

void display_edgepts ( LIST  outlines)

Definition at line 42 of file plotedges.cpp.

44  {
45  void *window;
46  /* Set up window */
47  if (edge_window == nullptr) {
48  edge_window = c_create_window ("Edges", 750, 150,
49  400, 128, -400.0, 400.0, 0.0, 256.0);
50  }
51  else {
53  }
54  /* Render the outlines */
55  window = edge_window;
56  /* Reclaim old memory */
57  iterate(outlines) {
58  render_edgepts (window, reinterpret_cast<EDGEPT *>first_node (outlines), White);

◆ draw_blob_edges()

void draw_blob_edges ( TBLOB blob)

Definition at line 65 of file plotedges.cpp.

68  {
70  LIST edge_list = NIL_LIST;
71  for (TESSLINE* ol = blob->outlines; ol != nullptr; ol = ol->next) {
72  edge_list = push(edge_list, ol->loop);
73  }
74  display_edgepts(edge_list);

◆ mark_outline()

void mark_outline ( EDGEPT edgept)

Definition at line 81 of file plotedges.cpp.

85  { /* Start of point list */
86  void *window = edge_window;
87  float x = edgept->pos.x;
88  float y = edgept->pos.y;
89 
90  c_line_color_index(window, Red);
91  c_move(window, x, y);
92 
93  x -= 4;
94  y -= 12;
95  c_draw(window, x, y);
96 
97  x -= 2;
98  y += 4;
99  c_draw(window, x, y);
100 
101  x -= 4;
102  y += 2;
103  c_draw(window, x, y);
104 
105  x += 10;
106  y += 6;

Variable Documentation

◆ edge_window

ScrollView* edge_window = nullptr

Definition at line 33 of file plotedges.cpp.

first_node
#define first_node(l)
Definition: oldlist.h:84
list_rec
Definition: oldlist.h:73
TBLOB::outlines
TESSLINE * outlines
Definition: blobs.h:398
TESSLINE
Definition: blobs.h:201
TESSLINE::next
TESSLINE * next
Definition: blobs.h:279
NIL_LIST
#define NIL_LIST
Definition: oldlist.h:68
c_move
void c_move(void *win, double x, double y)
Definition: callcpp.cpp:71
render_edgepts
void render_edgepts(void *window, EDGEPT *edgept, C_COL color)
Definition: render.cpp:81
TPOINT::x
int16_t x
Definition: blobs.h:91
Red
Definition: callcpp.h:29
TPOINT::y
int16_t y
Definition: blobs.h:92
c_clear_window
void c_clear_window(void *win)
Definition: callcpp.cpp:96
push
LIST push(LIST list, void *element)
Definition: oldlist.cpp:172
wordrec_display_splits
bool wordrec_display_splits
Definition: split.cpp:39
iterate
#define iterate(l)
Definition: oldlist.h:92
White
Definition: callcpp.h:28
c_create_window
ScrollView * c_create_window(const char *name, int16_t xpos, int16_t ypos, int16_t xsize, int16_t ysize, double xmin, double xmax, double ymin, double ymax)
Definition: callcpp.cpp:47
c_line_color_index
void c_line_color_index(void *win, C_COL index)
Definition: callcpp.cpp:62
c_draw
void c_draw(void *win, double x, double y)
Definition: callcpp.cpp:80
display_edgepts
void display_edgepts(LIST outlines)
Definition: plotedges.cpp:42
edge_window
ScrollView * edge_window
Definition: plotedges.cpp:33
EDGEPT::pos
TPOINT pos
Definition: blobs.h:184