Tesseract
3.02
|
#include <bbgrid.h>
Public Member Functions | |
GridBase () | |
GridBase (int gridsize, const ICOORD &bleft, const ICOORD &tright) | |
virtual | ~GridBase () |
void | Init (int gridsize, const ICOORD &bleft, const ICOORD &tright) |
int | gridsize () const |
int | gridwidth () const |
int | gridheight () const |
const ICOORD & | bleft () const |
const ICOORD & | tright () const |
void | GridCoords (int x, int y, int *grid_x, int *grid_y) const |
void | ClipGridCoords (int *x, int *y) const |
Protected Attributes | |
int | gridsize_ |
int | gridwidth_ |
int | gridheight_ |
int | gridbuckets_ |
ICOORD | bleft_ |
ICOORD | tright_ |
tesseract::GridBase::GridBase | ( | ) |
Definition at line 30 of file bbgrid.cpp.
{ }
Definition at line 33 of file bbgrid.cpp.
tesseract::GridBase::~GridBase | ( | ) | [virtual] |
Definition at line 37 of file bbgrid.cpp.
{ }
const ICOORD& tesseract::GridBase::bleft | ( | ) | const [inline] |
void tesseract::GridBase::ClipGridCoords | ( | int * | x, |
int * | y | ||
) | const |
Definition at line 61 of file bbgrid.cpp.
{ *x = ClipToRange(*x, 0, gridwidth_ - 1); *y = ClipToRange(*y, 0, gridheight_ - 1); }
void tesseract::GridBase::GridCoords | ( | int | x, |
int | y, | ||
int * | grid_x, | ||
int * | grid_y | ||
) | const |
Definition at line 54 of file bbgrid.cpp.
int tesseract::GridBase::gridheight | ( | ) | const [inline] |
Definition at line 74 of file bbgrid.h.
{ return gridheight_; }
int tesseract::GridBase::gridsize | ( | ) | const [inline] |
int tesseract::GridBase::gridwidth | ( | ) | const [inline] |
Definition at line 71 of file bbgrid.h.
{ return gridwidth_; }
Reimplemented in tesseract::BBGrid< BBC, BBC_CLIST, BBC_C_IT >, tesseract::BBGrid< ColSegment, ColSegment_CLIST, ColSegment_C_IT >, tesseract::BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT >, tesseract::BBGrid< ColPartition, ColPartition_CLIST, ColPartition_C_IT >, and tesseract::IntGrid.
Definition at line 42 of file bbgrid.cpp.
{ gridsize_ = gridsize; bleft_ = bleft; tright_ = tright; if (gridsize_ == 0) gridsize_ = 1; gridwidth_ = (tright.x() - bleft.x() + gridsize_ - 1) / gridsize_; gridheight_ = (tright.y() - bleft.y() + gridsize_ - 1) / gridsize_; gridbuckets_ = gridwidth_ * gridheight_; }
const ICOORD& tesseract::GridBase::tright | ( | ) | const [inline] |
ICOORD tesseract::GridBase::bleft_ [protected] |
int tesseract::GridBase::gridbuckets_ [protected] |
int tesseract::GridBase::gridheight_ [protected] |
int tesseract::GridBase::gridsize_ [protected] |
int tesseract::GridBase::gridwidth_ [protected] |
ICOORD tesseract::GridBase::tright_ [protected] |