tesseract  3.03
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 52 of file bbgrid.h.


Constructor & Destructor Documentation

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);
}

Definition at line 37 of file bbgrid.cpp.

                    {
}

Member Function Documentation

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

Definition at line 72 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 69 of file bbgrid.h.

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

Definition at line 63 of file bbgrid.h.

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

Definition at line 66 of file bbgrid.h.

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

Definition at line 75 of file bbgrid.h.

                               {
    return tright_;
  }

Member Data Documentation

Definition at line 90 of file bbgrid.h.

Definition at line 89 of file bbgrid.h.

Definition at line 88 of file bbgrid.h.

Definition at line 86 of file bbgrid.h.

Definition at line 87 of file bbgrid.h.

Definition at line 91 of file bbgrid.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines