|
tesseract 3.04.01
|
#include <fontinfo.h>
Public Member Functions | |
| FontInfoTable () | |
| ~FontInfoTable () | |
| bool | Serialize (FILE *fp) const |
| bool | DeSerialize (bool swap, FILE *fp) |
| bool | SetContainsFontProperties (int font_id, const GenericVector< ScoredFont > &font_set) const |
| bool | SetContainsMultipleFontProperties (const GenericVector< ScoredFont > &font_set) const |
| void | MoveSpacingInfoFrom (FontInfoTable *other) |
| void | MoveTo (UnicityTable< FontInfo > *target) |
Definition at line 146 of file fontinfo.h.
| tesseract::FontInfoTable::FontInfoTable | ( | ) |
Definition at line 40 of file fontinfo.cpp.
| tesseract::FontInfoTable::~FontInfoTable | ( | ) |
Definition at line 45 of file fontinfo.cpp.
{
}
| bool tesseract::FontInfoTable::DeSerialize | ( | bool | swap, |
| FILE * | fp | ||
| ) |
Reimplemented from GenericVector< FontInfo >.
Definition at line 54 of file fontinfo.cpp.
{
truncate(0);
return this->DeSerializeClasses(swap, fp);
}
| void tesseract::FontInfoTable::MoveSpacingInfoFrom | ( | FontInfoTable * | other | ) |
Definition at line 85 of file fontinfo.cpp.
{
set_compare_callback(NewPermanentTessCallback(CompareFontInfo));
set_clear_callback(NewPermanentTessCallback(FontInfoDeleteCallback));
for (int i = 0; i < other->size(); ++i) {
GenericVector<FontSpacingInfo*>* spacing_vec = other->get(i).spacing_vec;
if (spacing_vec != NULL) {
int target_index = get_index(other->get(i));
if (target_index < 0) {
// Bit copy the FontInfo and steal all the pointers.
push_back(other->get(i));
other->get(i).name = NULL;
} else {
delete [] get(target_index).spacing_vec;
get(target_index).spacing_vec = other->get(i).spacing_vec;
}
other->get(i).spacing_vec = NULL;
}
}
}
| void tesseract::FontInfoTable::MoveTo | ( | UnicityTable< FontInfo > * | target | ) |
Definition at line 106 of file fontinfo.cpp.
{
target->clear();
target->set_compare_callback(NewPermanentTessCallback(CompareFontInfo));
target->set_clear_callback(NewPermanentTessCallback(FontInfoDeleteCallback));
for (int i = 0; i < size(); ++i) {
// Bit copy the FontInfo and steal all the pointers.
target->push_back(get(i));
get(i).name = NULL;
get(i).spacing_vec = NULL;
}
}
| bool tesseract::FontInfoTable::Serialize | ( | FILE * | fp | ) | const |
Reimplemented from GenericVector< FontInfo >.
Definition at line 49 of file fontinfo.cpp.
{
return this->SerializeClasses(fp);
}
| bool tesseract::FontInfoTable::SetContainsFontProperties | ( | int | font_id, |
| const GenericVector< ScoredFont > & | font_set | ||
| ) | const |
Definition at line 61 of file fontinfo.cpp.
| bool tesseract::FontInfoTable::SetContainsMultipleFontProperties | ( | const GenericVector< ScoredFont > & | font_set | ) | const |
Definition at line 72 of file fontinfo.cpp.