Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BLOB_CHOICE Class Reference

#include <ratngs.h>

Inheritance diagram for BLOB_CHOICE:
ELIST_LINK

Public Member Functions

 BLOB_CHOICE ()
 
 BLOB_CHOICE (UNICHAR_ID src_unichar_id, float src_rating, float src_cert, inT16 src_fontinfo_id, inT16 src_fontinfo_id2, int script_id, inT16 min_xheight, inT16 max_xheight, bool adapted)
 
 BLOB_CHOICE (const BLOB_CHOICE &other)
 
 ~BLOB_CHOICE ()
 
UNICHAR_ID unichar_id () const
 
float rating () const
 
float certainty () const
 
inT16 fontinfo_id () const
 
inT16 fontinfo_id2 () const
 
int script_id () const
 
void * language_model_state ()
 
inT16 xgap_before () const
 
inT16 xgap_after () const
 
inT16 min_xheight () const
 
inT16 max_xheight () const
 
bool adapted () const
 
void set_unichar_id (UNICHAR_ID newunichar_id)
 
void set_rating (float newrat)
 
void set_certainty (float newrat)
 
void set_fontinfo_id (inT16 newfont)
 
void set_fontinfo_id2 (inT16 newfont)
 
void set_script (int newscript_id)
 
void set_language_model_state (void *language_model_state)
 
void set_xgap_before (inT16 gap)
 
void set_xgap_after (inT16 gap)
 
void set_adapted (bool adapted)
 
void print (const UNICHARSET *unicharset)
 
- Public Member Functions inherited from ELIST_LINK
 ELIST_LINK ()
 
 ELIST_LINK (const ELIST_LINK &)
 
void operator= (const ELIST_LINK &)
 

Static Public Member Functions

static BLOB_CHOICEdeep_copy (const BLOB_CHOICE *src)
 

Detailed Description

Definition at line 32 of file ratngs.h.

Constructor & Destructor Documentation

BLOB_CHOICE::BLOB_CHOICE ( )
inline

Definition at line 35 of file ratngs.h.

35  {
36  unichar_id_ = INVALID_UNICHAR_ID;
37  fontinfo_id_ = -1;
38  fontinfo_id2_ = -1;
39  rating_ = MAX_FLOAT32;
40  certainty_ = -MAX_FLOAT32;
41  script_id_ = -1;
42  language_model_state_ = NULL;
43  min_xheight_ = 0;
44  max_xheight_ = 0;
45  adapted_ = false;
46  }
#define NULL
Definition: host.h:144
#define MAX_FLOAT32
Definition: host.h:124
BLOB_CHOICE::BLOB_CHOICE ( UNICHAR_ID  src_unichar_id,
float  src_rating,
float  src_cert,
inT16  src_fontinfo_id,
inT16  src_fontinfo_id2,
int  src_script_id,
inT16  min_xheight,
inT16  max_xheight,
bool  adapted 
)

BLOB_CHOICE::BLOB_CHOICE

Constructor to build a BLOB_CHOICE from a char, rating and certainty.

Definition at line 66 of file ratngs.cpp.

75  {
76  unichar_id_ = src_unichar_id;
77  rating_ = src_rating;
78  certainty_ = src_cert;
79  fontinfo_id_ = src_fontinfo_id;
80  fontinfo_id2_ = src_fontinfo_id2;
81  script_id_ = src_script_id;
82  language_model_state_ = NULL;
83  min_xheight_ = min_xheight;
84  max_xheight_ = max_xheight;
85  adapted_ = adapted;
86 }
#define NULL
Definition: host.h:144
inT16 max_xheight() const
Definition: ratngs.h:89
bool adapted() const
Definition: ratngs.h:92
inT16 min_xheight() const
Definition: ratngs.h:86
BLOB_CHOICE::BLOB_CHOICE ( const BLOB_CHOICE other)

BLOB_CHOICE::BLOB_CHOICE

Constructor to build a BLOB_CHOICE from another BLOB_CHOICE.

Definition at line 93 of file ratngs.cpp.

93  {
94  unichar_id_ = other.unichar_id();
95  rating_ = other.rating();
96  certainty_ = other.certainty();
97  fontinfo_id_ = other.fontinfo_id();
98  fontinfo_id2_ = other.fontinfo_id2();
99  script_id_ = other.script_id();
100  language_model_state_ = NULL;
101  min_xheight_ = other.min_xheight_;
102  max_xheight_ = other.max_xheight_;
103  adapted_ = other.adapted_;
104 }
inT16 fontinfo_id() const
Definition: ratngs.h:68
inT16 fontinfo_id2() const
Definition: ratngs.h:71
#define NULL
Definition: host.h:144
UNICHAR_ID unichar_id() const
Definition: ratngs.h:59
float certainty() const
Definition: ratngs.h:65
float rating() const
Definition: ratngs.h:62
int script_id() const
Definition: ratngs.h:74
BLOB_CHOICE::~BLOB_CHOICE ( )
inline

Definition at line 57 of file ratngs.h.

57 {}

Member Function Documentation

bool BLOB_CHOICE::adapted ( ) const
inline

Definition at line 92 of file ratngs.h.

92  {
93  return adapted_;
94  }
float BLOB_CHOICE::certainty ( ) const
inline

Definition at line 65 of file ratngs.h.

65  {
66  return certainty_;
67  }
static BLOB_CHOICE* BLOB_CHOICE::deep_copy ( const BLOB_CHOICE src)
inlinestatic

Definition at line 126 of file ratngs.h.

126  {
127  BLOB_CHOICE* choice = new BLOB_CHOICE;
128  *choice = *src;
129  return choice;
130  }
BLOB_CHOICE()
Definition: ratngs.h:35
inT16 BLOB_CHOICE::fontinfo_id ( ) const
inline

Definition at line 68 of file ratngs.h.

68  {
69  return fontinfo_id_;
70  }
inT16 BLOB_CHOICE::fontinfo_id2 ( ) const
inline

Definition at line 71 of file ratngs.h.

71  {
72  return fontinfo_id2_;
73  }
void* BLOB_CHOICE::language_model_state ( )
inline

Definition at line 77 of file ratngs.h.

77  {
78  return language_model_state_;
79  }
inT16 BLOB_CHOICE::max_xheight ( ) const
inline

Definition at line 89 of file ratngs.h.

89  {
90  return max_xheight_;
91  }
inT16 BLOB_CHOICE::min_xheight ( ) const
inline

Definition at line 86 of file ratngs.h.

86  {
87  return min_xheight_;
88  }
void BLOB_CHOICE::print ( const UNICHARSET unicharset)
inline

Definition at line 131 of file ratngs.h.

131  {
132  tprintf("r%.2f c%.2f : %d %s", rating_, certainty_, unichar_id_,
133  (unicharset == NULL) ? "" :
134  unicharset->debug_str(unichar_id_).string());
135  }
#define NULL
Definition: host.h:144
STRING debug_str(UNICHAR_ID id) const
Definition: unicharset.cpp:285
const char * string() const
Definition: strngs.cpp:156
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:41
float BLOB_CHOICE::rating ( ) const
inline

Definition at line 62 of file ratngs.h.

62  {
63  return rating_;
64  }
int BLOB_CHOICE::script_id ( ) const
inline

Definition at line 74 of file ratngs.h.

74  {
75  return script_id_;
76  }
void BLOB_CHOICE::set_adapted ( bool  adapted)
inline

Definition at line 123 of file ratngs.h.

123  {
124  adapted_ = adapted;
125  }
bool adapted() const
Definition: ratngs.h:92
void BLOB_CHOICE::set_certainty ( float  newrat)
inline

Definition at line 102 of file ratngs.h.

102  {
103  certainty_ = newrat;
104  }
void BLOB_CHOICE::set_fontinfo_id ( inT16  newfont)
inline

Definition at line 105 of file ratngs.h.

105  {
106  fontinfo_id_ = newfont;
107  }
void BLOB_CHOICE::set_fontinfo_id2 ( inT16  newfont)
inline

Definition at line 108 of file ratngs.h.

108  {
109  fontinfo_id2_ = newfont;
110  }
void BLOB_CHOICE::set_language_model_state ( void *  language_model_state)
inline

Definition at line 114 of file ratngs.h.

114  {
115  language_model_state_ = language_model_state;
116  }
void * language_model_state()
Definition: ratngs.h:77
void BLOB_CHOICE::set_rating ( float  newrat)
inline

Definition at line 99 of file ratngs.h.

99  {
100  rating_ = newrat;
101  }
void BLOB_CHOICE::set_script ( int  newscript_id)
inline

Definition at line 111 of file ratngs.h.

111  {
112  script_id_ = newscript_id;
113  }
void BLOB_CHOICE::set_unichar_id ( UNICHAR_ID  newunichar_id)
inline

Definition at line 96 of file ratngs.h.

96  {
97  unichar_id_ = newunichar_id;
98  }
void BLOB_CHOICE::set_xgap_after ( inT16  gap)
inline

Definition at line 120 of file ratngs.h.

120  {
121  xgap_after_ = gap;
122  }
void BLOB_CHOICE::set_xgap_before ( inT16  gap)
inline

Definition at line 117 of file ratngs.h.

117  {
118  xgap_before_ = gap;
119  }
UNICHAR_ID BLOB_CHOICE::unichar_id ( ) const
inline

Definition at line 59 of file ratngs.h.

59  {
60  return unichar_id_;
61  }
inT16 BLOB_CHOICE::xgap_after ( ) const
inline

Definition at line 83 of file ratngs.h.

83  {
84  return xgap_after_;
85  }
inT16 BLOB_CHOICE::xgap_before ( ) const
inline

Definition at line 80 of file ratngs.h.

80  {
81  return xgap_before_;
82  }

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