tesseract  5.0.0-alpha-619-ge9db
BLOCK_RECT_IT Class Reference

#include <pdblock.h>

Public Member Functions

 BLOCK_RECT_IT (PDBLK *blkptr)
 
void set_to_block (PDBLK *blkptr)
 start (new) block More...
 
void start_block ()
 start iteration More...
 
void forward ()
 next rectangle More...
 
bool cycled_rects ()
 test end More...
 
void bounding_box (ICOORD &bleft, ICOORD &tright)
 

Detailed Description

Definition at line 101 of file pdblock.h.

Constructor & Destructor Documentation

◆ BLOCK_RECT_IT()

BLOCK_RECT_IT::BLOCK_RECT_IT ( PDBLK blkptr)

constructor

Parameters
blkptrblock to iterate

Definition at line 254 of file pdblock.cpp.

265  :left_it (&blkptr->leftside), right_it (&blkptr->rightside) {

Member Function Documentation

◆ bounding_box()

void BLOCK_RECT_IT::bounding_box ( ICOORD bleft,
ICOORD tright 
)
inline

current rectangle

Parameters
bleftbottom left
trighttop right

Definition at line 126 of file pdblock.h.

128  {
129  //bottom left
130  bleft = ICOORD (left_it.data ()->x (), ymin);
131  //top right
132  tright = ICOORD (right_it.data ()->x (), ymax);

◆ cycled_rects()

bool BLOCK_RECT_IT::cycled_rects ( )
inline

test end

Definition at line 119 of file pdblock.h.

120  {
121  return left_it.cycled_list() && right_it.cycled_list();

◆ forward()

void BLOCK_RECT_IT::forward ( )

next rectangle

Definition at line 305 of file pdblock.cpp.

316  { //next rectangle
317  if (!left_it.empty ()) { //non-empty list
318  if (left_it.data_relative (1)->y () == ymax)
319  left_it.forward (); //move to meet top
320  if (right_it.data_relative (1)->y () == ymax)
321  right_it.forward ();
322  //last is special
323  if (left_it.at_last () || right_it.at_last ()) {
324  left_it.move_to_first (); //restart
325  right_it.move_to_first ();
326  //now at bottom
327  ymin = left_it.data ()->y ();

◆ set_to_block()

void BLOCK_RECT_IT::set_to_block ( PDBLK blkptr)

start (new) block

Definition at line 271 of file pdblock.cpp.

◆ start_block()

void BLOCK_RECT_IT::start_block ( )

start iteration

Definition at line 287 of file pdblock.cpp.

297  { //start (new) block

The documentation for this class was generated from the following files:
ICOORD
integer coordinate
Definition: points.h:30
PDBLK::rightside
ICOORDELT_LIST rightside
right side vertices
Definition: pdblock.h:96
PDBLK::leftside
ICOORDELT_LIST leftside
left side vertices
Definition: pdblock.h:95