tesseract
3.03
|
#include <shapetable.h>
Public Member Functions | |
UnicharAndFonts () | |
UnicharAndFonts (int uni_id, int font_id) | |
bool | Serialize (FILE *fp) const |
bool | DeSerialize (bool swap, FILE *fp) |
Static Public Member Functions | |
static int | SortByUnicharId (const void *v1, const void *v2) |
Public Attributes | |
GenericVector< inT32 > | font_ids |
inT32 | unichar_id |
Definition at line 145 of file shapetable.h.
tesseract::UnicharAndFonts::UnicharAndFonts | ( | ) | [inline] |
Definition at line 146 of file shapetable.h.
: unichar_id(0) { }
tesseract::UnicharAndFonts::UnicharAndFonts | ( | int | uni_id, |
int | font_id | ||
) | [inline] |
Definition at line 148 of file shapetable.h.
: unichar_id(uni_id) { font_ids.push_back(font_id); }
bool tesseract::UnicharAndFonts::DeSerialize | ( | bool | swap, |
FILE * | fp | ||
) |
Definition at line 74 of file shapetable.cpp.
{ if (fread(&unichar_id, sizeof(unichar_id), 1, fp) != 1) return false; if (swap) ReverseN(&unichar_id, sizeof(unichar_id)); if (!font_ids.DeSerialize(swap, fp)) return false; return true; }
bool tesseract::UnicharAndFonts::Serialize | ( | FILE * | fp | ) | const |
Definition at line 67 of file shapetable.cpp.
{ if (fwrite(&unichar_id, sizeof(unichar_id), 1, fp) != 1) return false; if (!font_ids.Serialize(fp)) return false; return true; }
int tesseract::UnicharAndFonts::SortByUnicharId | ( | const void * | v1, |
const void * | v2 | ||
) | [static] |
Definition at line 83 of file shapetable.cpp.
{ const UnicharAndFonts* p1 = reinterpret_cast<const UnicharAndFonts*>(v1); const UnicharAndFonts* p2 = reinterpret_cast<const UnicharAndFonts*>(v2); return p1->unichar_id - p2->unichar_id; }
Definition at line 161 of file shapetable.h.
Definition at line 162 of file shapetable.h.