tesseract  4.0.0-1-g2a2b
tesseract::UnicharAndFonts Struct Reference

#include <shapetable.h>

Public Member Functions

 UnicharAndFonts ()
 
 UnicharAndFonts (int uni_id, int font_id)
 
bool Serialize (FILE *fp) const
 
bool DeSerialize (TFile *fp)
 

Static Public Member Functions

static int SortByUnicharId (const void *v1, const void *v2)
 

Public Attributes

GenericVector< int32_t > font_ids
 
int32_t unichar_id
 

Detailed Description

Definition at line 160 of file shapetable.h.

Constructor & Destructor Documentation

◆ UnicharAndFonts() [1/2]

tesseract::UnicharAndFonts::UnicharAndFonts ( )
inline

Definition at line 161 of file shapetable.h.

161  : unichar_id(0) {
162  }

◆ UnicharAndFonts() [2/2]

tesseract::UnicharAndFonts::UnicharAndFonts ( int  uni_id,
int  font_id 
)
inline

Definition at line 163 of file shapetable.h.

163  : unichar_id(uni_id) {
164  font_ids.push_back(font_id);
165  }
int push_back(T object)
GenericVector< int32_t > font_ids
Definition: shapetable.h:175

Member Function Documentation

◆ DeSerialize()

bool tesseract::UnicharAndFonts::DeSerialize ( TFile fp)

Definition at line 74 of file shapetable.cpp.

74  {
75  return fp->DeSerialize(&unichar_id) && font_ids.DeSerialize(fp);
76 }
bool DeSerialize(bool swap, FILE *fp)
GenericVector< int32_t > font_ids
Definition: shapetable.h:175

◆ Serialize()

bool tesseract::UnicharAndFonts::Serialize ( FILE *  fp) const

Definition at line 69 of file shapetable.cpp.

69  {
71 }
bool Serialize(FILE *fp, const char *data, size_t n)
Definition: serialis.cpp:59
bool Serialize(FILE *fp) const
GenericVector< int32_t > font_ids
Definition: shapetable.h:175

◆ SortByUnicharId()

int tesseract::UnicharAndFonts::SortByUnicharId ( const void *  v1,
const void *  v2 
)
static

Definition at line 79 of file shapetable.cpp.

79  {
80  const UnicharAndFonts* p1 = static_cast<const UnicharAndFonts*>(v1);
81  const UnicharAndFonts* p2 = static_cast<const UnicharAndFonts*>(v2);
82  return p1->unichar_id - p2->unichar_id;
83 }

Member Data Documentation

◆ font_ids

GenericVector<int32_t> tesseract::UnicharAndFonts::font_ids

Definition at line 175 of file shapetable.h.

◆ unichar_id

int32_t tesseract::UnicharAndFonts::unichar_id

Definition at line 176 of file shapetable.h.


The documentation for this struct was generated from the following files: