Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tesseract::GridBase Class Reference

#include <bbgrid.h>

Inheritance diagram for tesseract::GridBase:
tesseract::BBGrid< BLOBNBOX, BLOBNBOX_CLIST, BLOBNBOX_C_IT > tesseract::BBGrid< ColPartition, ColPartition_CLIST, ColPartition_C_IT > tesseract::BBGrid< BBC, BBC_CLIST, BBC_C_IT > tesseract::IntGrid tesseract::BlobGrid tesseract::ColPartitionGrid tesseract::AlignedBlob tesseract::CCNonTextDetect tesseract::StrokeWidth tesseract::TabFind tesseract::ColumnFinder

List of all members.

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 ICOORDbleft () const
const ICOORDtright () 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_

Detailed Description

Definition at line 57 of file bbgrid.h.


Constructor & Destructor Documentation

tesseract::GridBase::GridBase ( )

Definition at line 30 of file bbgrid.cpp.

{
}
tesseract::GridBase::GridBase ( int  gridsize,
const ICOORD bleft,
const ICOORD tright 
)

Definition at line 33 of file bbgrid.cpp.

{
Init(gridsize, bleft, tright);
}
tesseract::GridBase::~GridBase ( )
virtual

Definition at line 37 of file bbgrid.cpp.

{
}

Member Function Documentation

const ICOORD& tesseract::GridBase::bleft ( ) const
inline

Definition at line 77 of file bbgrid.h.

{
return bleft_;
}
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.

{
*grid_x = (x - bleft_.x()) / gridsize_;
*grid_y = (y - bleft_.y()) / gridsize_;
ClipGridCoords(grid_x, grid_y);
}
int tesseract::GridBase::gridheight ( ) const
inline

Definition at line 74 of file bbgrid.h.

{
return gridheight_;
}
int tesseract::GridBase::gridsize ( ) const
inline

Definition at line 68 of file bbgrid.h.

{
return gridsize_;
}
int tesseract::GridBase::gridwidth ( ) const
inline

Definition at line 71 of file bbgrid.h.

{
return gridwidth_;
}
const ICOORD& tesseract::GridBase::tright ( ) const
inline

Definition at line 80 of file bbgrid.h.

{
return tright_;
}

Member Data Documentation

ICOORD tesseract::GridBase::bleft_
protected

Definition at line 95 of file bbgrid.h.

int tesseract::GridBase::gridbuckets_
protected

Definition at line 94 of file bbgrid.h.

int tesseract::GridBase::gridheight_
protected

Definition at line 93 of file bbgrid.h.

int tesseract::GridBase::gridsize_
protected

Definition at line 91 of file bbgrid.h.

int tesseract::GridBase::gridwidth_
protected

Definition at line 92 of file bbgrid.h.

ICOORD tesseract::GridBase::tright_
protected

Definition at line 96 of file bbgrid.h.


The documentation for this class was generated from the following files: