tesseract  4.1.1
plotedges.h File Reference
#include "oldlist.h"

Go to the source code of this file.

Macros

#define update_edge_window()
 
#define edge_window_wait()   if (wordrec_display_splits) window_wait (edge_window)
 

Functions

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

Variables

ScrollViewedge_window
 

Macro Definition Documentation

◆ edge_window_wait

#define edge_window_wait ( )    if (wordrec_display_splits) window_wait (edge_window)

Definition at line 56 of file plotedges.h.

◆ update_edge_window

#define update_edge_window ( )
Value:
c_make_current (edge_window); \
}
bool wordrec_display_splits
Definition: split.cpp:41
ScrollView * edge_window
Definition: plotedges.cpp:35

Definition at line 44 of file plotedges.h.

Function Documentation

◆ display_edgepts()

void display_edgepts ( LIST  outlines)

Definition at line 45 of file plotedges.cpp.

45  {
46  void *window;
47  /* Set up window */
48  if (edge_window == nullptr) {
49  edge_window = c_create_window ("Edges", 750, 150,
50  400, 128, -400.0, 400.0, 0.0, 256.0);
51  }
52  else {
54  }
55  /* Render the outlines */
56  window = edge_window;
57  /* Reclaim old memory */
58  iterate(outlines) {
59  render_edgepts (window, reinterpret_cast<EDGEPT *>first_node (outlines), White);
60  }
61 }
void render_edgepts(void *window, EDGEPT *edgept, C_COL color)
Definition: render.cpp:86
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
#define iterate(l)
Definition: oldlist.h:101
Definition: callcpp.h:29
void c_clear_window(void *win)
Definition: callcpp.cpp:96
ScrollView * edge_window
Definition: plotedges.cpp:35
#define first_node(l)
Definition: oldlist.h:92

◆ draw_blob_edges()

void draw_blob_edges ( TBLOB blob)

Definition at line 69 of file plotedges.cpp.

69  {
71  LIST edge_list = NIL_LIST;
72  for (TESSLINE* ol = blob->outlines; ol != nullptr; ol = ol->next) {
73  edge_list = push(edge_list, ol->loop);
74  }
75  display_edgepts(edge_list);
76  destroy(edge_list);
77  }
78 }
void display_edgepts(LIST outlines)
Definition: plotedges.cpp:45
TESSLINE * outlines
Definition: blobs.h:400
TESSLINE * next
Definition: blobs.h:281
LIST push(LIST list, void *element)
Definition: oldlist.cpp:213
bool wordrec_display_splits
Definition: split.cpp:41
#define NIL_LIST
Definition: oldlist.h:76
LIST destroy(LIST list)
Definition: oldlist.cpp:141

◆ mark_outline()

void mark_outline ( EDGEPT edgept)

Definition at line 86 of file plotedges.cpp.

86  { /* Start of point list */
87  void *window = edge_window;
88  float x = edgept->pos.x;
89  float y = edgept->pos.y;
90 
91  c_line_color_index(window, Red);
92  c_move(window, x, y);
93 
94  x -= 4;
95  y -= 12;
96  c_draw(window, x, y);
97 
98  x -= 2;
99  y += 4;
100  c_draw(window, x, y);
101 
102  x -= 4;
103  y += 2;
104  c_draw(window, x, y);
105 
106  x += 10;
107  y += 6;
108  c_draw(window, x, y);
109 
110  c_make_current(window);
111 }
void c_line_color_index(void *win, C_COL index)
Definition: callcpp.cpp:62
int16_t x
Definition: blobs.h:93
Definition: callcpp.h:30
int16_t y
Definition: blobs.h:94
void c_move(void *win, double x, double y)
Definition: callcpp.cpp:71
void c_draw(void *win, double x, double y)
Definition: callcpp.cpp:80
void c_make_current(void *win)
Definition: callcpp.cpp:89
ScrollView * edge_window
Definition: plotedges.cpp:35
TPOINT pos
Definition: blobs.h:186

Variable Documentation

◆ edge_window

ScrollView* edge_window

Definition at line 35 of file plotedges.cpp.