BLOCK_LINE_IT Class Reference

#include <pdblock.h>

List of all members.


Detailed Description

Class for dealing with PDBLK blocks.

Definition at line 170 of file pdblock.h.

Public Member Functions

Private Attributes


Constructor & Destructor Documentation

BLOCK_LINE_IT::BLOCK_LINE_IT ( PDBLK blkptr  )  [inline]

Definition at line 173 of file pdblock.h.

00175     :rect_it (blkptr) {
00176       block = blkptr;            // remember block
00177     }


Member Function Documentation

INT16 BLOCK_LINE_IT::get_line ( INT16  y,
INT16 xext 
)

Get a line.

Get the the start and width of a line in the block.

Definition at line 308 of file pdblock.cpp.

References ABORT, BADBLOCKLINE, block, BLOCK_RECT_IT::bounding_box(), BLOCK_RECT_IT::cycled_rects(), ERRCODE::error(), BLOCK_RECT_IT::forward(), LOSTBLOCKLINE, rect_it, BLOCK_RECT_IT::start_block(), and ICOORD::y().

Referenced by make_margins(), and whiteout_block().

00311                                {
00312   ICOORD bleft;                  //bounding box
00313   ICOORD tright;                 //of block & rect
00314 
00315                                  //get block box
00316   block->bounding_box (bleft, tright);
00317   if (y < bleft.y () || y >= tright.y ()) {
00318     //              block->print(stderr,FALSE);
00319     BADBLOCKLINE.error ("BLOCK_LINE_IT::get_line", ABORT, "Y=%d", y);
00320   }
00321 
00322                                  //get rectangle box
00323   rect_it.bounding_box (bleft, tright);
00324                                  //inside rectangle
00325   if (y >= bleft.y () && y < tright.y ()) {
00326                                  //width of line
00327     xext = tright.x () - bleft.x ();
00328     return bleft.x ();           //start of line
00329   }
00330   for (rect_it.start_block (); !rect_it.cycled_rects (); rect_it.forward ()) {
00331                                  //get rectangle box
00332     rect_it.bounding_box (bleft, tright);
00333                                  //inside rectangle
00334     if (y >= bleft.y () && y < tright.y ()) {
00335                                  //width of line
00336       xext = tright.x () - bleft.x ();
00337       return bleft.x ();         //start of line
00338     }
00339   }
00340   LOSTBLOCKLINE.error ("BLOCK_LINE_IT::get_line", ABORT, "Y=%d", y);
00341   return 0;                      //dummy to stop warning
00342 }

BLOCK_LINE_IT::NEWDELETE2 ( BLOCK_LINE_IT   )  [inline]

Definition at line 179 of file pdblock.h.

00180                     {            // block to start
00181       block = blkptr;            // remember block
00182                                  // set iterator
00183       rect_it.set_to_block (blkptr);
00184     }


Member Data Documentation

PDBLK* BLOCK_LINE_IT::block [private]

block to iterate

Definition at line 192 of file pdblock.h.

Referenced by get_line().

BLOCK_RECT_IT BLOCK_LINE_IT::rect_it [private]

rectangle iterator

Definition at line 194 of file pdblock.h.

Referenced by get_line().


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 19:49:30 2007 for Tesseract by  doxygen 1.5.1