tesseract v5.3.3.20231005
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)
 
static bool StdSortByUnicharId (const UnicharAndFonts &v1, const UnicharAndFonts &v2)
 

Public Attributes

std::vector< int32_t > font_ids
 
int32_t unichar_id
 

Detailed Description

Definition at line 129 of file shapetable.h.

Constructor & Destructor Documentation

◆ UnicharAndFonts() [1/2]

tesseract::UnicharAndFonts::UnicharAndFonts ( )
inline

Definition at line 130 of file shapetable.h.

130: unichar_id(0) {}

◆ UnicharAndFonts() [2/2]

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

Definition at line 131 of file shapetable.h.

131 : unichar_id(uni_id) {
132 font_ids.push_back(font_id);
133 }
std::vector< int32_t > font_ids
Definition: shapetable.h:144

Member Function Documentation

◆ DeSerialize()

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

Definition at line 70 of file shapetable.cpp.

70 {
71 return fp->DeSerialize(&unichar_id) && fp->DeSerialize(font_ids);
72}

◆ Serialize()

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

Definition at line 65 of file shapetable.cpp.

65 {
67}
bool Serialize(FILE *fp, const std::vector< T > &data)
Definition: helpers.h:236

◆ SortByUnicharId()

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

Definition at line 75 of file shapetable.cpp.

75 {
76 const auto *p1 = static_cast<const UnicharAndFonts *>(v1);
77 const auto *p2 = static_cast<const UnicharAndFonts *>(v2);
78 return p1->unichar_id - p2->unichar_id;
79}

◆ StdSortByUnicharId()

bool tesseract::UnicharAndFonts::StdSortByUnicharId ( const UnicharAndFonts v1,
const UnicharAndFonts v2 
)
static

Definition at line 81 of file shapetable.cpp.

81 {
82 return v1.unichar_id < v2.unichar_id;
83}

Member Data Documentation

◆ font_ids

std::vector<int32_t> tesseract::UnicharAndFonts::font_ids

Definition at line 144 of file shapetable.h.

◆ unichar_id

int32_t tesseract::UnicharAndFonts::unichar_id

Definition at line 145 of file shapetable.h.


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