#include <char_samp_set.h>
Definition at line 40 of file char_samp_set.h.
◆ CharSampSet()
tesseract::CharSampSet::CharSampSet |
( |
| ) |
|
◆ ~CharSampSet()
tesseract::CharSampSet::~CharSampSet |
( |
| ) |
|
◆ Add()
bool tesseract::CharSampSet::Add |
( |
CharSamp * |
char_samp | ) |
|
Definition at line 53 of file char_samp_set.cpp.
56 CharSamp **new_samp_buff =
60 memcpy(new_samp_buff, samp_buff_, cnt_ *
sizeof(*samp_buff_));
63 samp_buff_ = new_samp_buff;
65 samp_buff_[cnt_++] = char_samp;
◆ CreateCharDumpFile()
FILE * tesseract::CharSampSet::CreateCharDumpFile |
( |
string |
file_name | ) |
|
|
static |
Definition at line 116 of file char_samp_set.cpp.
120 fp = fopen(file_name.c_str(),
"wb");
126 if (fwrite(&val32, 1,
sizeof(val32), fp) !=
sizeof(val32)) {
◆ EnumSamples()
bool tesseract::CharSampSet::EnumSamples |
( |
string |
file_name, |
|
|
CharSampEnum * |
enumerator |
|
) |
| |
|
static |
Definition at line 135 of file char_samp_set.cpp.
141 fp_in =
new CachedFile(file_name);
142 i64_size = fp_in->Size();
147 if (fp_in->Read(&val32,
sizeof(val32)) !=
sizeof(val32)) {
150 if (val32 != 0xfefeabd0) {
154 while (fp_in->eof() ==
false) {
156 i64_pos = fp_in->Tell();
157 if (new_samp != NULL) {
158 bool ret_flag = (enum_obj)->EnumCharSamp(new_samp,
159 (100.0f * i64_pos / i64_size));
161 if (ret_flag ==
false) {
static CharSamp * FromCharDumpFile(CachedFile *fp)
◆ FromCharDumpFile()
CharSampSet * tesseract::CharSampSet::FromCharDumpFile |
( |
string |
file_name | ) |
|
|
static |
Definition at line 88 of file char_samp_set.cpp.
92 fp = fopen(file_name.c_str(),
"rb");
97 if (fread(&val32, 1,
sizeof(val32), fp) !=
sizeof(val32)) {
101 if (val32 != 0xfefeabd0) {
107 if (samp_set->LoadCharSamples(fp) ==
false) {
◆ SampleCount()
int tesseract::CharSampSet::SampleCount |
( |
| ) |
const |
|
inline |
◆ Samples()
CharSamp** tesseract::CharSampSet::Samples |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: