tesseract  4.0.0-1-g2a2b
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 50 of file plotedges.cpp.

50  {
51  void *window;
52  /* Set up window */
53  if (edge_window == nullptr) {
54  edge_window = c_create_window ("Edges", 750, 150,
55  400, 128, -400.0, 400.0, 0.0, 256.0);
56  }
57  else {
59  }
60  /* Render the outlines */
61  window = edge_window;
62  /* Reclaim old memory */
63  iterate(outlines) {
64  render_edgepts (window, (EDGEPT *) first_node (outlines), White);
65  }
66 }
Definition: callcpp.h:31
void render_edgepts(void *window, EDGEPT *edgept, C_COL color)
Definition: render.cpp:95
void c_clear_window(void *win)
Definition: callcpp.cpp:97
Definition: blobs.h:83
#define first_node(l)
Definition: oldlist.h:141
ScrollView * edge_window
Definition: plotedges.cpp:40
#define iterate(l)
Definition: oldlist.h:161
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:48

◆ draw_blob_edges()

void draw_blob_edges ( TBLOB blob)

Definition at line 74 of file plotedges.cpp.

74  {
75  TESSLINE *ol;
76  LIST edge_list = NIL_LIST;
77 
79  for (ol = blob->outlines; ol != nullptr; ol = ol->next)
80  push_on (edge_list, ol->loop);
81  display_edgepts(edge_list);
82  destroy(edge_list);
83  }
84 }
TESSLINE * next
Definition: blobs.h:265
bool wordrec_display_splits
Definition: split.cpp:47
LIST destroy(LIST list)
Definition: oldlist.cpp:170
EDGEPT * loop
Definition: blobs.h:264
#define NIL_LIST
Definition: oldlist.h:127
#define push_on(list, thing)
Definition: oldlist.h:202
TESSLINE * outlines
Definition: blobs.h:384
void display_edgepts(LIST outlines)
Definition: plotedges.cpp:50

◆ mark_outline()

void mark_outline ( EDGEPT edgept)

Definition at line 92 of file plotedges.cpp.

92  { /* Start of point list */
93  void *window = edge_window;
94  float x = edgept->pos.x;
95  float y = edgept->pos.y;
96 
97  c_line_color_index(window, Red);
98  c_move(window, x, y);
99 
100  x -= 4;
101  y -= 12;
102  c_draw(window, x, y);
103 
104  x -= 2;
105  y += 4;
106  c_draw(window, x, y);
107 
108  x -= 4;
109  y += 2;
110  c_draw(window, x, y);
111 
112  x += 10;
113  y += 6;
114  c_draw(window, x, y);
115 
116  c_make_current(window);
117 }
TPOINT pos
Definition: blobs.h:170
void c_draw(void *win, double x, double y)
Definition: callcpp.cpp:81
Definition: callcpp.h:32
void c_move(void *win, double x, double y)
Definition: callcpp.cpp:72
int16_t x
Definition: blobs.h:78
ScrollView * edge_window
Definition: plotedges.cpp:40
void c_make_current(void *win)
Definition: callcpp.cpp:90
int16_t y
Definition: blobs.h:79
void c_line_color_index(void *win, C_COL index)
Definition: callcpp.cpp:63

Variable Documentation

◆ edge_window

ScrollView* edge_window = nullptr

Definition at line 40 of file plotedges.cpp.