tesseract  4.00.00dev
plotedges.h File Reference
#include "callcpp.h"
#include "oldlist.h"
#include "blobs.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 57 of file plotedges.h.

◆ update_edge_window

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

Definition at line 45 of file plotedges.h.

Function Documentation

◆ display_edgepts()

void display_edgepts ( LIST  outlines)

Definition at line 53 of file plotedges.cpp.

53  {
54  void *window;
55  /* Set up window */
56  if (edge_window == NULL) {
57  edge_window = c_create_window ("Edges", 750, 150,
58  400, 128, -400.0, 400.0, 0.0, 256.0);
59  }
60  else {
62  }
63  /* Render the outlines */
64  window = edge_window;
65  /* Reclaim old memory */
66  iterate(outlines) {
67  render_edgepts (window, (EDGEPT *) first_node (outlines), White);
68  }
69 }
Definition: callcpp.h:34
void render_edgepts(void *window, EDGEPT *edgept, C_COL color)
Definition: render.cpp:98
ScrollView * c_create_window(const char *name, inT16 xpos, inT16 ypos, inT16 xsize, inT16 ysize, double xmin, double xmax, double ymin, double ymax)
Definition: callcpp.cpp:55
void c_clear_window(void *win)
Definition: callcpp.cpp:104
Definition: blobs.h:76
#define first_node(l)
Definition: oldlist.h:139
#define iterate(l)
Definition: oldlist.h:159
ScrollView * edge_window
Definition: plotedges.cpp:43

◆ draw_blob_edges()

void draw_blob_edges ( TBLOB blob)

Definition at line 77 of file plotedges.cpp.

77  {
78  TESSLINE *ol;
79  LIST edge_list = NIL_LIST;
80 
82  for (ol = blob->outlines; ol != NULL; ol = ol->next)
83  push_on (edge_list, ol->loop);
84  display_edgepts(edge_list);
85  destroy(edge_list);
86  }
87 }
void display_edgepts(LIST outlines)
Definition: plotedges.cpp:53
TESSLINE * next
Definition: blobs.h:258
LIST destroy(LIST list)
Definition: oldlist.cpp:182
bool wordrec_display_splits
Definition: split.cpp:49
TESSLINE * outlines
Definition: blobs.h:377
#define NIL_LIST
Definition: oldlist.h:126
EDGEPT * loop
Definition: blobs.h:257
#define push_on(list, thing)
Definition: oldlist.h:200

◆ mark_outline()

void mark_outline ( EDGEPT edgept)

Definition at line 95 of file plotedges.cpp.

95  { /* Start of point list */
96  void *window = edge_window;
97  float x = edgept->pos.x;
98  float y = edgept->pos.y;
99 
100  c_line_color_index(window, Red);
101  c_move(window, x, y);
102 
103  x -= 4;
104  y -= 12;
105  c_draw(window, x, y);
106 
107  x -= 2;
108  y += 4;
109  c_draw(window, x, y);
110 
111  x -= 4;
112  y += 2;
113  c_draw(window, x, y);
114 
115  x += 10;
116  y += 6;
117  c_draw(window, x, y);
118 
119  c_make_current(window);
120 }
TPOINT pos
Definition: blobs.h:163
void c_move(void *win, double x, double y)
Definition: callcpp.cpp:79
Definition: callcpp.h:35
void c_draw(void *win, double x, double y)
Definition: callcpp.cpp:88
inT16 x
Definition: blobs.h:71
void c_line_color_index(void *win, C_COL index)
Definition: callcpp.cpp:70
inT16 y
Definition: blobs.h:72
void c_make_current(void *win)
Definition: callcpp.cpp:97
ScrollView * edge_window
Definition: plotedges.cpp:43

Variable Documentation

◆ edge_window

ScrollView* edge_window

Definition at line 43 of file plotedges.cpp.