tesseract  4.1.1
render.h File Reference
#include "callcpp.h"
#include "params.h"

Go to the source code of this file.

Macros

#define NUM_COLORS   6
 

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
 
C_COL color_list []
 
bool wordrec_display_all_blobs = 0
 
bool wordrec_blob_pause = 0
 

Macro Definition Documentation

◆ NUM_COLORS

#define NUM_COLORS   6

Definition at line 43 of file render.h.

Function Documentation

◆ display_blob()

void display_blob ( TBLOB blob,
C_COL  color 
)

Definition at line 52 of file render.cpp.

52  {
53  /* Size of drawable */
54  if (blob_window == nullptr) {
55  blob_window = c_create_window ("Blobs", 520, 10,
56  500, 256, -1000.0, 1000.0, 0.0, 256.0);
57  }
58  else {
60  }
61 
62  render_blob(blob_window, blob, color);
63 }

◆ render_blob()

void render_blob ( void *  window,
TBLOB blob,
C_COL  color 
)

Definition at line 71 of file render.cpp.

71  {
72  /* No outline */
73  if (!blob)
74  return;
75 
76  render_outline (window, blob->outlines, color);
77 }

◆ render_edgepts()

void render_edgepts ( void *  window,
EDGEPT edgept,
C_COL  color 
)

Definition at line 86 of file render.cpp.

86  {
87  if (!edgept)
88  return;
89 
90  float x = edgept->pos.x;
91  float y = edgept->pos.y;
92  EDGEPT *this_edge = edgept;
93 
94  c_line_color_index(window, color);
95  c_move(window, x, y);
96  do {
97  this_edge = this_edge->next;
98  x = this_edge->pos.x;
99  y = this_edge->pos.y;
100  c_draw(window, x, y);
101  }
102  while (edgept != this_edge);
103 }

◆ render_outline()

void render_outline ( void *  window,
TESSLINE outline,
C_COL  color 
)

Definition at line 112 of file render.cpp.

114  {
115  /* No outline */
116  if (!outline)
117  return;
118  /* Draw Compact outline */
119  if (outline->loop)
120  render_edgepts (window, outline->loop, color);
121  /* Add on next outlines */
122  render_outline (window, outline->next, color);
123 }

Variable Documentation

◆ blob_window

ScrollView* blob_window

Definition at line 33 of file render.cpp.

◆ color_list

C_COL color_list[]

Definition at line 35 of file render.cpp.

◆ wordrec_blob_pause

bool wordrec_blob_pause = 0

"Blob pause"

Definition at line 41 of file render.cpp.

◆ wordrec_display_all_blobs

bool wordrec_display_all_blobs = 0

"Display Blobs"

Definition at line 39 of file render.cpp.

c_create_window
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
c_line_color_index
void c_line_color_index(void *win, C_COL index)
Definition: callcpp.cpp:62
EDGEPT
Definition: blobs.h:99
render_edgepts
void render_edgepts(void *window, EDGEPT *edgept, C_COL color)
Definition: render.cpp:86
TPOINT::y
int16_t y
Definition: blobs.h:94
blob_window
ScrollView * blob_window
Definition: render.cpp:33
TESSLINE::loop
EDGEPT * loop
Definition: blobs.h:280
render_outline
void render_outline(void *window, TESSLINE *outline, C_COL color)
Definition: render.cpp:112
TESSLINE::next
TESSLINE * next
Definition: blobs.h:281
TPOINT::x
int16_t x
Definition: blobs.h:93
EDGEPT::pos
TPOINT pos
Definition: blobs.h:186
EDGEPT::next
EDGEPT * next
Definition: blobs.h:192
c_clear_window
void c_clear_window(void *win)
Definition: callcpp.cpp:96
render_blob
void render_blob(void *window, TBLOB *blob, C_COL color)
Definition: render.cpp:71
c_move
void c_move(void *win, double x, double y)
Definition: callcpp.cpp:71
c_draw
void c_draw(void *win, double x, double y)
Definition: callcpp.cpp:80
TBLOB::outlines
TESSLINE * outlines
Definition: blobs.h:400