tesseract  4.1.0
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

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 c_clear_window(void *win)
Definition: callcpp.cpp:96
void render_edgepts(void *window, EDGEPT *edgept, C_COL color)
Definition: render.cpp:90
ScrollView * edge_window
Definition: plotedges.cpp:35
Definition: callcpp.h:30
#define first_node(l)
Definition: oldlist.h:92
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
void draw_blob_edges ( TBLOB blob)

Definition at line 69 of file plotedges.cpp.

69  {
70  TESSLINE *ol;
71  LIST edge_list = NIL_LIST;
72 
74  for (ol = blob->outlines; ol != nullptr; ol = ol->next)
75  push_on (edge_list, ol->loop);
76  display_edgepts(edge_list);
77  destroy(edge_list);
78  }
79 }
TESSLINE * next
Definition: blobs.h:260
TESSLINE * outlines
Definition: blobs.h:379
EDGEPT * loop
Definition: blobs.h:259
#define NIL_LIST
Definition: oldlist.h:76
#define push_on(list, thing)
Definition: oldlist.h:110
LIST destroy(LIST list)
Definition: oldlist.cpp:142
bool wordrec_display_splits
Definition: split.cpp:41
void display_edgepts(LIST outlines)
Definition: plotedges.cpp:45
void mark_outline ( EDGEPT edgept)

Definition at line 87 of file plotedges.cpp.

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

Variable Documentation

ScrollView* edge_window = nullptr

Definition at line 35 of file plotedges.cpp.