tesseract  4.00.00dev
render.cpp File Reference
#include "render.h"
#include "blobs.h"
#include <math.h>
#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 = NULL
 
C_COL color_list []
 
bool wordrec_display_all_blobs = 0
 
bool wordrec_display_all_words = 0
 
bool wordrec_blob_pause = 0
 

Function Documentation

◆ display_blob()

void display_blob ( TBLOB blob,
C_COL  color 
)

Definition at line 64 of file render.cpp.

64  {
65  /* Size of drawable */
66  if (blob_window == NULL) {
67  blob_window = c_create_window ("Blobs", 520, 10,
68  500, 256, -1000.0, 1000.0, 0.0, 256.0);
69  }
70  else {
72  }
73 
74  render_blob(blob_window, blob, color);
75 }
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 render_blob(void *window, TBLOB *blob, C_COL color)
Definition: render.cpp:83
void c_clear_window(void *win)
Definition: callcpp.cpp:104
ScrollView * blob_window
Definition: render.cpp:43

◆ render_blob()

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

Definition at line 83 of file render.cpp.

83  {
84  /* No outline */
85  if (!blob)
86  return;
87 
88  render_outline (window, blob->outlines, color);
89 }
TESSLINE * outlines
Definition: blobs.h:377
void render_outline(void *window, TESSLINE *outline, C_COL color)
Definition: render.cpp:124

◆ render_edgepts()

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

Definition at line 98 of file render.cpp.

98  {
99  if (!edgept)
100  return;
101 
102  float x = edgept->pos.x;
103  float y = edgept->pos.y;
104  EDGEPT *this_edge = edgept;
105 
106  c_line_color_index(window, color);
107  c_move(window, x, y);
108  do {
109  this_edge = this_edge->next;
110  x = this_edge->pos.x;
111  y = this_edge->pos.y;
112  c_draw(window, x, y);
113  }
114  while (edgept != this_edge);
115 }
TPOINT pos
Definition: blobs.h:163
void c_move(void *win, double x, double y)
Definition: callcpp.cpp:79
void c_draw(void *win, double x, double y)
Definition: callcpp.cpp:88
inT16 x
Definition: blobs.h:71
EDGEPT * next
Definition: blobs.h:169
Definition: blobs.h:76
void c_line_color_index(void *win, C_COL index)
Definition: callcpp.cpp:70
inT16 y
Definition: blobs.h:72

◆ render_outline()

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

Definition at line 124 of file render.cpp.

126  {
127  /* No outline */
128  if (!outline)
129  return;
130  /* Draw Compact outline */
131  if (outline->loop)
132  render_edgepts (window, outline->loop, color);
133  /* Add on next outlines */
134  render_outline (window, outline->next, color);
135 }
TESSLINE * next
Definition: blobs.h:258
void render_edgepts(void *window, EDGEPT *edgept, C_COL color)
Definition: render.cpp:98
void render_outline(void *window, TESSLINE *outline, C_COL color)
Definition: render.cpp:124
EDGEPT * loop
Definition: blobs.h:257

Variable Documentation

◆ blob_window

ScrollView* blob_window = NULL

Definition at line 43 of file render.cpp.

◆ color_list

C_COL color_list[]
Initial value:
= {
}
Definition: callcpp.h:34
Definition: callcpp.h:38
Definition: callcpp.h:39
Definition: callcpp.h:36
Definition: callcpp.h:37
Definition: callcpp.h:35

Definition at line 45 of file render.cpp.

◆ wordrec_blob_pause

bool wordrec_blob_pause = 0

"Blob pause"

Definition at line 53 of file render.cpp.

◆ wordrec_display_all_blobs

bool wordrec_display_all_blobs = 0

"Display Blobs"

Definition at line 49 of file render.cpp.

◆ wordrec_display_all_words

bool wordrec_display_all_words = 0

"Display Words"

Definition at line 51 of file render.cpp.