|
Tesseract
3.02
|
#include <shapetable.h>
Public Member Functions | |
| UnicharAndFonts () | |
| UnicharAndFonts (int uni_id, int font_id) | |
| bool | Serialize (FILE *fp) |
| bool | DeSerialize (bool swap, FILE *fp) |
Static Public Member Functions | |
| static int | SortByUnicharId (const void *v1, const void *v2) |
Public Attributes | |
| GenericVector< int > | font_ids |
| int | unichar_id |
Definition at line 36 of file shapetable.h.
| tesseract::UnicharAndFonts::UnicharAndFonts | ( | ) | [inline] |
Definition at line 37 of file shapetable.h.
: unichar_id(0) { }
| tesseract::UnicharAndFonts::UnicharAndFonts | ( | int | uni_id, |
| int | font_id | ||
| ) | [inline] |
Definition at line 39 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 40 of file shapetable.cpp.
{
inT32 uni_id;
if (fread(&uni_id, sizeof(uni_id), 1, fp) != 1) return false;
if (swap)
ReverseN(&uni_id, sizeof(uni_id));
unichar_id = uni_id;
if (!font_ids.DeSerialize(swap, fp)) return false;
return true;
}
| bool tesseract::UnicharAndFonts::Serialize | ( | FILE * | fp | ) |
Definition at line 32 of file shapetable.cpp.
{
inT32 uni_id = unichar_id;
if (fwrite(&uni_id, sizeof(uni_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 51 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 52 of file shapetable.h.
Definition at line 53 of file shapetable.h.