#include <shapetable.h>
Public Member Functions | |
ShapeTable () | |
ShapeTable (const UNICHARSET &unicharset) | |
bool | Serialize (FILE *fp) const |
bool | DeSerialize (TFile *fp) |
int | NumShapes () const |
const UNICHARSET & | unicharset () 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 Shape & | GetShape (int shape_id) const |
Shape * | MutableShape (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 UNICHARSET * | unicharset_ |
PointerVector< Shape > | shape_table_ |
int | num_fonts_ |
tesseract::ShapeTable::ShapeTable | ( | ) |
|
explicit |
int tesseract::ShapeTable::AddShape | ( | int | unichar_id, |
int | font_id | ||
) |
int tesseract::ShapeTable::AddShape | ( | const Shape & | other | ) |
void tesseract::ShapeTable::AddShapeToResults | ( | const ShapeRating & | shape_rating, |
GenericVector< int > * | unichar_map, | ||
GenericVector< UnicharRating > * | results | ||
) | const |
void tesseract::ShapeTable::AddShapeToShape | ( | int | shape_id, |
const Shape & | other | ||
) |
void tesseract::ShapeTable::AddToShape | ( | int | shape_id, |
int | unichar_id, | ||
int | font_id | ||
) |
|
private |
bool tesseract::ShapeTable::AlreadyMerged | ( | int | shape_id1, |
int | shape_id2 | ||
) | const |
bool tesseract::ShapeTable::AnyMultipleUnichars | ( | ) | const |
void tesseract::ShapeTable::AppendMasterShapes | ( | const ShapeTable & | other, |
GenericVector< int > * | shape_map | ||
) |
int tesseract::ShapeTable::BuildFromShape | ( | const Shape & | shape, |
const ShapeTable & | master_shapes | ||
) |
bool tesseract::ShapeTable::CommonFont | ( | int | shape_id1, |
int | shape_id2 | ||
) | const |
bool tesseract::ShapeTable::CommonUnichars | ( | int | shape_id1, |
int | shape_id2 | ||
) | const |
STRING tesseract::ShapeTable::DebugStr | ( | int | shape_id | ) | const |
void tesseract::ShapeTable::DeleteShape | ( | int | shape_id | ) |
bool tesseract::ShapeTable::DeSerialize | ( | TFile * | fp | ) |
bool tesseract::ShapeTable::EqualUnichars | ( | int | shape_id1, |
int | shape_id2 | ||
) | const |
int tesseract::ShapeTable::FindShape | ( | int | unichar_id, |
int | font_id | ||
) | const |
void tesseract::ShapeTable::ForceFontMerges | ( | int | start, |
int | end | ||
) |
void tesseract::ShapeTable::GetFirstUnicharAndFont | ( | int | shape_id, |
int * | unichar_id, | ||
int * | font_id | ||
) | const |
|
inline |
int tesseract::ShapeTable::MasterDestinationIndex | ( | int | shape_id | ) | const |
int tesseract::ShapeTable::MasterFontCount | ( | int | shape_id | ) | const |
int tesseract::ShapeTable::MasterUnicharCount | ( | int | shape_id | ) | const |
int tesseract::ShapeTable::MaxNumUnichars | ( | ) | const |
int tesseract::ShapeTable::MergedUnicharCount | ( | int | shape_id1, |
int | shape_id2 | ||
) | const |
bool tesseract::ShapeTable::MergeEqualUnichars | ( | int | merge_id1, |
int | merge_id2, | ||
int | shape_id | ||
) | const |
void tesseract::ShapeTable::MergeShapes | ( | int | shape_id1, |
int | shape_id2 | ||
) |
bool tesseract::ShapeTable::MergeSubsetUnichar | ( | int | merge_id1, |
int | merge_id2, | ||
int | shape_id | ||
) | const |
|
inline |
int tesseract::ShapeTable::NumFonts | ( | ) | const |
int tesseract::ShapeTable::NumMasterShapes | ( | ) | const |
|
inline |
void tesseract::ShapeTable::ReMapClassIds | ( | const GenericVector< int > & | unicharset_map | ) |
bool tesseract::ShapeTable::Serialize | ( | FILE * | fp | ) | const |
|
inline |
bool tesseract::ShapeTable::SubsetUnichar | ( | int | shape_id1, |
int | shape_id2 | ||
) | const |
STRING tesseract::ShapeTable::SummaryStr | ( | ) | const |
void tesseract::ShapeTable::SwapShapes | ( | int | shape_id1, |
int | shape_id2 | ||
) |
|
inline |
|
mutableprivate |
|
private |
|
private |