tesseract  4.1.0
render.cpp File Reference
#include "render.h"
#include "blobs.h"
#include <cmath>
#include "vecfuncs.h"

Go to the source code of this file.

Functions

void display_blob (TBLOB *blob, C_COL color)
 
void render_blob (void *window, TBLOB *blob, C_COL color)
 
void render_edgepts (void *window, EDGEPT *edgept, C_COL color)
 
void render_outline (void *window, TESSLINE *outline, C_COL color)
 

Variables

ScrollViewblob_window = nullptr
 
C_COL color_list []
 
bool wordrec_display_all_blobs = 0
 
bool wordrec_display_all_words = 0
 
bool wordrec_blob_pause = 0
 

Function Documentation

void display_blob ( TBLOB blob,
C_COL  color 
)

Definition at line 56 of file render.cpp.

56  {
57  /* Size of drawable */
58  if (blob_window == nullptr) {
59  blob_window = c_create_window ("Blobs", 520, 10,
60  500, 256, -1000.0, 1000.0, 0.0, 256.0);
61  }
62  else {
64  }
65 
66  render_blob(blob_window, blob, color);
67 }
void c_clear_window(void *win)
Definition: callcpp.cpp:96
ScrollView * blob_window
Definition: render.cpp:35
void render_blob(void *window, TBLOB *blob, C_COL color)
Definition: render.cpp:75
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
void render_blob ( void *  window,
TBLOB blob,
C_COL  color 
)

Definition at line 75 of file render.cpp.

75  {
76  /* No outline */
77  if (!blob)
78  return;
79 
80  render_outline (window, blob->outlines, color);
81 }
TESSLINE * outlines
Definition: blobs.h:379
void render_outline(void *window, TESSLINE *outline, C_COL color)
Definition: render.cpp:116
void render_edgepts ( void *  window,
EDGEPT edgept,
C_COL  color 
)

Definition at line 90 of file render.cpp.

90  {
91  if (!edgept)
92  return;
93 
94  float x = edgept->pos.x;
95  float y = edgept->pos.y;
96  EDGEPT *this_edge = edgept;
97 
98  c_line_color_index(window, color);
99  c_move(window, x, y);
100  do {
101  this_edge = this_edge->next;
102  x = this_edge->pos.x;
103  y = this_edge->pos.y;
104  c_draw(window, x, y);
105  }
106  while (edgept != this_edge);
107 }
int16_t x
Definition: blobs.h:73
EDGEPT * next
Definition: blobs.h:171
TPOINT pos
Definition: blobs.h:165
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: blobs.h:78
void c_line_color_index(void *win, C_COL index)
Definition: callcpp.cpp:62
void render_outline ( void *  window,
TESSLINE outline,
C_COL  color 
)

Definition at line 116 of file render.cpp.

118  {
119  /* No outline */
120  if (!outline)
121  return;
122  /* Draw Compact outline */
123  if (outline->loop)
124  render_edgepts (window, outline->loop, color);
125  /* Add on next outlines */
126  render_outline (window, outline->next, color);
127 }
TESSLINE * next
Definition: blobs.h:260
EDGEPT * loop
Definition: blobs.h:259
void render_edgepts(void *window, EDGEPT *edgept, C_COL color)
Definition: render.cpp:90
void render_outline(void *window, TESSLINE *outline, C_COL color)
Definition: render.cpp:116

Variable Documentation

ScrollView* blob_window = nullptr

Definition at line 35 of file render.cpp.

C_COL color_list[]
Initial value:
= {
}
Definition: callcpp.h:30
Definition: callcpp.h:34
Definition: callcpp.h:35
Definition: callcpp.h:33
Definition: callcpp.h:31
Definition: callcpp.h:32

Definition at line 37 of file render.cpp.

bool wordrec_blob_pause = 0

"Blob pause"

Definition at line 45 of file render.cpp.

bool wordrec_display_all_blobs = 0

"Display Blobs"

Definition at line 41 of file render.cpp.

bool wordrec_display_all_words = 0

"Display Words"

Definition at line 43 of file render.cpp.