tesseract  5.0.0-alpha-619-ge9db
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 159 of file shapetable.h.

Constructor & Destructor Documentation

◆ UnicharAndFonts() [1/2]

tesseract::UnicharAndFonts::UnicharAndFonts ( )
inline

Definition at line 160 of file shapetable.h.

160  : unichar_id(0) {
161  }

◆ UnicharAndFonts() [2/2]

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

Definition at line 162 of file shapetable.h.

162  : unichar_id(uni_id) {
163  font_ids.push_back(font_id);
164  }

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 }

◆ Serialize()

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

Definition at line 69 of file shapetable.cpp.

69  {
71 }

◆ SortByUnicharId()

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

Definition at line 79 of file shapetable.cpp.

79  {
80  const auto* p1 = static_cast<const UnicharAndFonts*>(v1);
81  const auto* 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 174 of file shapetable.h.

◆ unichar_id

int32_t tesseract::UnicharAndFonts::unichar_id

Definition at line 175 of file shapetable.h.


The documentation for this struct was generated from the following files:
GenericVector::Serialize
bool Serialize(FILE *fp) const
Definition: genericvector.h:929
GenericVector::push_back
int push_back(T object)
Definition: genericvector.h:799
tesseract::UnicharAndFonts::unichar_id
int32_t unichar_id
Definition: shapetable.h:175
GenericVector::DeSerialize
bool DeSerialize(bool swap, FILE *fp)
Definition: genericvector.h:954
tesseract::Serialize
bool Serialize(FILE *fp, const char *data, size_t n=1)
Definition: serialis.cpp:73
tesseract::UnicharAndFonts::font_ids
GenericVector< int32_t > font_ids
Definition: shapetable.h:174