#include <pdblock.h>
Definition at line 116 of file pdblock.h.
◆ BLOCK_RECT_IT()
tesseract::BLOCK_RECT_IT::BLOCK_RECT_IT |
( |
PDBLK * |
blkptr | ) |
|
constructor
- Parameters
-
Definition at line 267 of file pdblock.cpp.
271 : left_it(&blkptr->leftside), right_it(&blkptr->rightside) {
272 block = blkptr;
273
274 if (!blkptr->leftside.empty()) {
276 }
277}
void start_block()
start iteration
◆ bounding_box()
void tesseract::BLOCK_RECT_IT::bounding_box |
( |
ICOORD & |
bleft, |
|
|
ICOORD & |
tright |
|
) |
| |
|
inline |
current rectangle
- Parameters
-
bleft | bottom left |
tright | top right |
Definition at line 140 of file pdblock.h.
140 {
141
142 bleft = ICOORD(left_it.data()->x(), ymin);
143
144 tright = ICOORD(right_it.data()->x(), ymax);
145 }
◆ cycled_rects()
bool tesseract::BLOCK_RECT_IT::cycled_rects |
( |
| ) |
const |
|
inline |
test end
Definition at line 133 of file pdblock.h.
133 {
134 return left_it.cycled_list() && right_it.cycled_list();
135 }
◆ forward()
void tesseract::BLOCK_RECT_IT::forward |
( |
| ) |
|
next rectangle
Definition at line 321 of file pdblock.cpp.
321 {
322 if (!left_it.empty()) {
323 if (left_it.data_relative(1)->y() == ymax) {
324 left_it.forward();
325 }
326 if (right_it.data_relative(1)->y() == ymax) {
327 right_it.forward();
328 }
329
330 if (left_it.at_last() || right_it.at_last()) {
331 left_it.move_to_first();
332 right_it.move_to_first();
333
334 ymin = left_it.data()->y();
335 } else {
336 ymin = ymax;
337 }
338
339 ymax = left_it.data_relative(1)->y();
340 if (right_it.data_relative(1)->y() < ymax) {
341
342 ymax = right_it.data_relative(1)->y();
343 }
344 }
345}
◆ set_to_block()
void tesseract::BLOCK_RECT_IT::set_to_block |
( |
PDBLK * |
blkptr | ) |
|
start (new) block
Definition at line 285 of file pdblock.cpp.
286 {
287 block = blkptr;
288
289 left_it.set_to_list(&blkptr->leftside);
290 right_it.set_to_list(&blkptr->rightside);
291 if (!blkptr->leftside.empty()) {
293 }
294}
◆ start_block()
void tesseract::BLOCK_RECT_IT::start_block |
( |
| ) |
|
start iteration
Definition at line 302 of file pdblock.cpp.
302 {
303 left_it.move_to_first();
304 right_it.move_to_first();
305 left_it.mark_cycle_pt();
306 right_it.mark_cycle_pt();
307 ymin = left_it.data()->y();
308 ymax = left_it.data_relative(1)->y();
309 if (right_it.data_relative(1)->y() < ymax) {
310
311 ymax = right_it.data_relative(1)->y();
312 }
313}
The documentation for this class was generated from the following files:
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/ccstruct/pdblock.h
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/ccstruct/pdblock.cpp