tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
tesseract::ShapeTable Class Reference

#include <shapetable.h>

Collaboration diagram for tesseract::ShapeTable:

Public Member Functions

 ShapeTable ()
 
 ShapeTable (const UNICHARSET &unicharset)
 
bool Serialize (FILE *fp) const
 
bool DeSerialize (TFile *fp)
 
int NumShapes () const
 
const UNICHARSETunicharset () const
 
int NumFonts () const
 
void set_unicharset (const UNICHARSET &unicharset)
 
void ReMapClassIds (const GenericVector< int > &unicharset_map)
 
STRING DebugStr (int shape_id) const
 
STRING SummaryStr () const
 
int AddShape (int unichar_id, int font_id)
 
int AddShape (const Shape &other)
 
void DeleteShape (int shape_id)
 
void AddToShape (int shape_id, int unichar_id, int font_id)
 
void AddShapeToShape (int shape_id, const Shape &other)
 
int FindShape (int unichar_id, int font_id) const
 
void GetFirstUnicharAndFont (int shape_id, int *unichar_id, int *font_id) const
 
const ShapeGetShape (int shape_id) const
 
ShapeMutableShape (int shape_id)
 
int BuildFromShape (const Shape &shape, const ShapeTable &master_shapes)
 
bool AlreadyMerged (int shape_id1, int shape_id2) const
 
bool AnyMultipleUnichars () const
 
int MaxNumUnichars () const
 
void ForceFontMerges (int start, int end)
 
int MasterUnicharCount (int shape_id) const
 
int MasterFontCount (int shape_id) const
 
int MergedUnicharCount (int shape_id1, int shape_id2) const
 
void MergeShapes (int shape_id1, int shape_id2)
 
void SwapShapes (int shape_id1, int shape_id2)
 
void AppendMasterShapes (const ShapeTable &other, GenericVector< int > *shape_map)
 
int NumMasterShapes () const
 
int MasterDestinationIndex (int shape_id) const
 
bool SubsetUnichar (int shape_id1, int shape_id2) const
 
bool MergeSubsetUnichar (int merge_id1, int merge_id2, int shape_id) const
 
bool EqualUnichars (int shape_id1, int shape_id2) const
 
bool MergeEqualUnichars (int merge_id1, int merge_id2, int shape_id) const
 
bool CommonUnichars (int shape_id1, int shape_id2) const
 
bool CommonFont (int shape_id1, int shape_id2) const
 
void AddShapeToResults (const ShapeRating &shape_rating, GenericVector< int > *unichar_map, GenericVector< UnicharRating > *results) const
 

Private Member Functions

int AddUnicharToResults (int unichar_id, float rating, GenericVector< int > *unichar_map, GenericVector< UnicharRating > *results) const
 

Private Attributes

const UNICHARSETunicharset_
 
PointerVector< Shapeshape_table_
 
int num_fonts_
 

Constructor & Destructor Documentation

◆ ShapeTable() [1/2]

tesseract::ShapeTable::ShapeTable ( )

◆ ShapeTable() [2/2]

tesseract::ShapeTable::ShapeTable ( const UNICHARSET unicharset)
explicit

Member Function Documentation

◆ AddShape() [1/2]

int tesseract::ShapeTable::AddShape ( int  unichar_id,
int  font_id 
)

◆ AddShape() [2/2]

int tesseract::ShapeTable::AddShape ( const Shape other)

◆ AddShapeToResults()

void tesseract::ShapeTable::AddShapeToResults ( const ShapeRating shape_rating,
GenericVector< int > *  unichar_map,
GenericVector< UnicharRating > *  results 
) const

◆ AddShapeToShape()

void tesseract::ShapeTable::AddShapeToShape ( int  shape_id,
const Shape other 
)

◆ AddToShape()

void tesseract::ShapeTable::AddToShape ( int  shape_id,
int  unichar_id,
int  font_id 
)

◆ AddUnicharToResults()

int tesseract::ShapeTable::AddUnicharToResults ( int  unichar_id,
float  rating,
GenericVector< int > *  unichar_map,
GenericVector< UnicharRating > *  results 
) const
private

◆ AlreadyMerged()

bool tesseract::ShapeTable::AlreadyMerged ( int  shape_id1,
int  shape_id2 
) const

◆ AnyMultipleUnichars()

bool tesseract::ShapeTable::AnyMultipleUnichars ( ) const

◆ AppendMasterShapes()

void tesseract::ShapeTable::AppendMasterShapes ( const ShapeTable other,
GenericVector< int > *  shape_map 
)

◆ BuildFromShape()

int tesseract::ShapeTable::BuildFromShape ( const Shape shape,
const ShapeTable master_shapes 
)

◆ CommonFont()

bool tesseract::ShapeTable::CommonFont ( int  shape_id1,
int  shape_id2 
) const

◆ CommonUnichars()

bool tesseract::ShapeTable::CommonUnichars ( int  shape_id1,
int  shape_id2 
) const

◆ DebugStr()

STRING tesseract::ShapeTable::DebugStr ( int  shape_id) const

◆ DeleteShape()

void tesseract::ShapeTable::DeleteShape ( int  shape_id)

◆ DeSerialize()

bool tesseract::ShapeTable::DeSerialize ( TFile fp)

◆ EqualUnichars()

bool tesseract::ShapeTable::EqualUnichars ( int  shape_id1,
int  shape_id2 
) const

◆ FindShape()

int tesseract::ShapeTable::FindShape ( int  unichar_id,
int  font_id 
) const

◆ ForceFontMerges()

void tesseract::ShapeTable::ForceFontMerges ( int  start,
int  end 
)

◆ GetFirstUnicharAndFont()

void tesseract::ShapeTable::GetFirstUnicharAndFont ( int  shape_id,
int *  unichar_id,
int *  font_id 
) const

◆ GetShape()

const Shape& tesseract::ShapeTable::GetShape ( int  shape_id) const
inline

◆ MasterDestinationIndex()

int tesseract::ShapeTable::MasterDestinationIndex ( int  shape_id) const

◆ MasterFontCount()

int tesseract::ShapeTable::MasterFontCount ( int  shape_id) const

◆ MasterUnicharCount()

int tesseract::ShapeTable::MasterUnicharCount ( int  shape_id) const

◆ MaxNumUnichars()

int tesseract::ShapeTable::MaxNumUnichars ( ) const

◆ MergedUnicharCount()

int tesseract::ShapeTable::MergedUnicharCount ( int  shape_id1,
int  shape_id2 
) const

◆ MergeEqualUnichars()

bool tesseract::ShapeTable::MergeEqualUnichars ( int  merge_id1,
int  merge_id2,
int  shape_id 
) const

◆ MergeShapes()

void tesseract::ShapeTable::MergeShapes ( int  shape_id1,
int  shape_id2 
)

◆ MergeSubsetUnichar()

bool tesseract::ShapeTable::MergeSubsetUnichar ( int  merge_id1,
int  merge_id2,
int  shape_id 
) const

◆ MutableShape()

Shape* tesseract::ShapeTable::MutableShape ( int  shape_id)
inline

◆ NumFonts()

int tesseract::ShapeTable::NumFonts ( ) const

◆ NumMasterShapes()

int tesseract::ShapeTable::NumMasterShapes ( ) const

◆ NumShapes()

int tesseract::ShapeTable::NumShapes ( ) const
inline

◆ ReMapClassIds()

void tesseract::ShapeTable::ReMapClassIds ( const GenericVector< int > &  unicharset_map)

◆ Serialize()

bool tesseract::ShapeTable::Serialize ( FILE *  fp) const

◆ set_unicharset()

void tesseract::ShapeTable::set_unicharset ( const UNICHARSET unicharset)
inline

◆ SubsetUnichar()

bool tesseract::ShapeTable::SubsetUnichar ( int  shape_id1,
int  shape_id2 
) const

◆ SummaryStr()

STRING tesseract::ShapeTable::SummaryStr ( ) const

◆ SwapShapes()

void tesseract::ShapeTable::SwapShapes ( int  shape_id1,
int  shape_id2 
)

◆ unicharset()

const UNICHARSET& tesseract::ShapeTable::unicharset ( ) const
inline

Member Data Documentation

◆ num_fonts_

int tesseract::ShapeTable::num_fonts_
mutableprivate

◆ shape_table_

PointerVector<Shape> tesseract::ShapeTable::shape_table_
private

◆ unicharset_

const UNICHARSET* tesseract::ShapeTable::unicharset_
private

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