tesseract v5.3.3.20231005
|
#include <shapetable.h>
Public Member Functions | |
ShapeTable () | |
ShapeTable (const UNICHARSET &unicharset) | |
~ShapeTable () | |
bool | Serialize (FILE *fp) const |
bool | DeSerialize (TFile *fp) |
unsigned | NumShapes () const |
const UNICHARSET & | unicharset () const |
int | NumFonts () const |
void | set_unicharset (const UNICHARSET &unicharset) |
void | ReMapClassIds (const std::vector< int > &unicharset_map) |
std::string | DebugStr (unsigned shape_id) const |
std::string | SummaryStr () const |
unsigned | AddShape (int unichar_id, int font_id) |
unsigned | AddShape (const Shape &other) |
void | DeleteShape (unsigned shape_id) |
void | AddToShape (unsigned shape_id, int unichar_id, int font_id) |
void | AddShapeToShape (unsigned shape_id, const Shape &other) |
int | FindShape (int unichar_id, int font_id) const |
void | GetFirstUnicharAndFont (unsigned shape_id, int *unichar_id, int *font_id) const |
const Shape & | GetShape (unsigned shape_id) const |
Shape * | MutableShape (unsigned shape_id) |
int | BuildFromShape (const Shape &shape, const ShapeTable &master_shapes) |
bool | AlreadyMerged (unsigned shape_id1, unsigned shape_id2) const |
bool | AnyMultipleUnichars () const |
int | MaxNumUnichars () const |
void | ForceFontMerges (unsigned start, unsigned end) |
unsigned | MasterUnicharCount (unsigned shape_id) const |
int | MasterFontCount (unsigned shape_id) const |
int | MergedUnicharCount (unsigned shape_id1, unsigned shape_id2) const |
void | MergeShapes (unsigned shape_id1, unsigned shape_id2) |
void | SwapShapes (unsigned shape_id1, unsigned shape_id2) |
void | AppendMasterShapes (const ShapeTable &other, std::vector< int > *shape_map) |
int | NumMasterShapes () const |
unsigned | MasterDestinationIndex (unsigned shape_id) const |
bool | SubsetUnichar (unsigned shape_id1, unsigned shape_id2) const |
bool | MergeSubsetUnichar (int merge_id1, int merge_id2, unsigned shape_id) const |
bool | EqualUnichars (unsigned shape_id1, unsigned shape_id2) const |
bool | MergeEqualUnichars (int merge_id1, int merge_id2, unsigned shape_id) const |
bool | CommonUnichars (unsigned shape_id1, unsigned shape_id2) const |
bool | CommonFont (unsigned shape_id1, unsigned shape_id2) const |
void | AddShapeToResults (const ShapeRating &shape_rating, std::vector< int > *unichar_map, std::vector< UnicharRating > *results) const |
Definition at line 230 of file shapetable.h.
tesseract::ShapeTable::ShapeTable | ( | ) |
Definition at line 246 of file shapetable.cpp.
|
explicit |
Definition at line 247 of file shapetable.cpp.
|
inline |
Definition at line 236 of file shapetable.h.
unsigned tesseract::ShapeTable::AddShape | ( | const Shape & | other | ) |
Definition at line 362 of file shapetable.cpp.
unsigned tesseract::ShapeTable::AddShape | ( | int | unichar_id, |
int | font_id | ||
) |
Definition at line 351 of file shapetable.cpp.
void tesseract::ShapeTable::AddShapeToResults | ( | const ShapeRating & | shape_rating, |
std::vector< int > * | unichar_map, | ||
std::vector< UnicharRating > * | results | ||
) | const |
Definition at line 716 of file shapetable.cpp.
void tesseract::ShapeTable::AddShapeToShape | ( | unsigned | shape_id, |
const Shape & | other | ||
) |
Definition at line 390 of file shapetable.cpp.
void tesseract::ShapeTable::AddToShape | ( | unsigned | shape_id, |
int | unichar_id, | ||
int | font_id | ||
) |
Definition at line 383 of file shapetable.cpp.
bool tesseract::ShapeTable::AlreadyMerged | ( | unsigned | shape_id1, |
unsigned | shape_id2 | ||
) | const |
Definition at line 453 of file shapetable.cpp.
bool tesseract::ShapeTable::AnyMultipleUnichars | ( | ) | const |
Definition at line 458 of file shapetable.cpp.
void tesseract::ShapeTable::AppendMasterShapes | ( | const ShapeTable & | other, |
std::vector< int > * | shape_map | ||
) |
Definition at line 683 of file shapetable.cpp.
int tesseract::ShapeTable::BuildFromShape | ( | const Shape & | shape, |
const ShapeTable & | master_shapes | ||
) |
Definition at line 428 of file shapetable.cpp.
bool tesseract::ShapeTable::CommonFont | ( | unsigned | shape_id1, |
unsigned | shape_id2 | ||
) | const |
Definition at line 667 of file shapetable.cpp.
bool tesseract::ShapeTable::CommonUnichars | ( | unsigned | shape_id1, |
unsigned | shape_id2 | ||
) | const |
Definition at line 654 of file shapetable.cpp.
std::string tesseract::ShapeTable::DebugStr | ( | unsigned | shape_id | ) | const |
Definition at line 292 of file shapetable.cpp.
void tesseract::ShapeTable::DeleteShape | ( | unsigned | shape_id | ) |
Definition at line 376 of file shapetable.cpp.
bool tesseract::ShapeTable::DeSerialize | ( | TFile * | fp | ) |
Definition at line 255 of file shapetable.cpp.
bool tesseract::ShapeTable::EqualUnichars | ( | unsigned | shape_id1, |
unsigned | shape_id2 | ||
) | const |
Definition at line 609 of file shapetable.cpp.
int tesseract::ShapeTable::FindShape | ( | int | unichar_id, |
int | font_id | ||
) | const |
Definition at line 400 of file shapetable.cpp.
void tesseract::ShapeTable::ForceFontMerges | ( | unsigned | start, |
unsigned | end | ||
) |
Definition at line 485 of file shapetable.cpp.
void tesseract::ShapeTable::GetFirstUnicharAndFont | ( | unsigned | shape_id, |
int * | unichar_id, | ||
int * | font_id | ||
) | const |
Definition at line 420 of file shapetable.cpp.
|
inline |
Definition at line 292 of file shapetable.h.
unsigned tesseract::ShapeTable::MasterDestinationIndex | ( | unsigned | shape_id | ) | const |
Definition at line 548 of file shapetable.cpp.
int tesseract::ShapeTable::MasterFontCount | ( | unsigned | shape_id | ) | const |
Definition at line 509 of file shapetable.cpp.
unsigned tesseract::ShapeTable::MasterUnicharCount | ( | unsigned | shape_id | ) | const |
Definition at line 503 of file shapetable.cpp.
int tesseract::ShapeTable::MaxNumUnichars | ( | ) | const |
int tesseract::ShapeTable::MergedUnicharCount | ( | unsigned | shape_id1, |
unsigned | shape_id2 | ||
) | const |
Definition at line 520 of file shapetable.cpp.
bool tesseract::ShapeTable::MergeEqualUnichars | ( | int | merge_id1, |
int | merge_id2, | ||
unsigned | shape_id | ||
) | const |
Definition at line 628 of file shapetable.cpp.
void tesseract::ShapeTable::MergeShapes | ( | unsigned | shape_id1, |
unsigned | shape_id2 | ||
) |
Definition at line 530 of file shapetable.cpp.
bool tesseract::ShapeTable::MergeSubsetUnichar | ( | int | merge_id1, |
int | merge_id2, | ||
unsigned | shape_id | ||
) | const |
Definition at line 582 of file shapetable.cpp.
|
inline |
Definition at line 295 of file shapetable.h.
int tesseract::ShapeTable::NumFonts | ( | ) | const |
Definition at line 265 of file shapetable.cpp.
int tesseract::ShapeTable::NumMasterShapes | ( | ) | const |
Definition at line 699 of file shapetable.cpp.
|
inline |
Definition at line 248 of file shapetable.h.
void tesseract::ShapeTable::ReMapClassIds | ( | const std::vector< int > & | unicharset_map | ) |
Definition at line 283 of file shapetable.cpp.
bool tesseract::ShapeTable::Serialize | ( | FILE * | fp | ) | const |
Definition at line 250 of file shapetable.cpp.
|
inline |
Definition at line 259 of file shapetable.h.
bool tesseract::ShapeTable::SubsetUnichar | ( | unsigned | shape_id1, |
unsigned | shape_id2 | ||
) | const |
Definition at line 562 of file shapetable.cpp.
std::string tesseract::ShapeTable::SummaryStr | ( | ) | const |
Definition at line 325 of file shapetable.cpp.
void tesseract::ShapeTable::SwapShapes | ( | unsigned | shape_id1, |
unsigned | shape_id2 | ||
) |
Definition at line 540 of file shapetable.cpp.
|
inline |
Definition at line 251 of file shapetable.h.