#include <char_samp_set.h>
Definition at line 40 of file char_samp_set.h.
tesseract::CharSampSet::CharSampSet |
( |
| ) |
|
tesseract::CharSampSet::~CharSampSet |
( |
| ) |
|
bool tesseract::CharSampSet::Add |
( |
CharSamp * |
char_samp | ) |
|
Definition at line 55 of file char_samp_set.cpp.
58 CharSamp **new_samp_buff =
60 if (new_samp_buff ==
NULL) {
65 memcpy(new_samp_buff, samp_buff_, cnt_ *
sizeof(*samp_buff_));
68 samp_buff_ = new_samp_buff;
70 samp_buff_[cnt_++] = char_samp;
FILE * tesseract::CharSampSet::CreateCharDumpFile |
( |
string |
file_name | ) |
|
|
static |
Definition at line 125 of file char_samp_set.cpp.
129 fp = fopen(file_name.c_str(),
"wb");
135 if (fwrite(&val32, 1,
sizeof(val32), fp) !=
sizeof(val32)) {
bool tesseract::CharSampSet::EnumSamples |
( |
string |
file_name, |
|
|
CharSampEnum * |
enumerator |
|
) |
| |
|
static |
Definition at line 144 of file char_samp_set.cpp.
150 fp_in =
new CachedFile(file_name);
154 i64_size = fp_in->Size();
159 if (fp_in->Read(&val32,
sizeof(val32)) !=
sizeof(val32)) {
162 if (val32 != 0xfefeabd0) {
166 while (fp_in->eof() ==
false) {
168 i64_pos = fp_in->Tell();
169 if (new_samp !=
NULL) {
170 bool ret_flag = (enum_obj)->EnumCharSamp(new_samp,
171 (100.0f * i64_pos / i64_size));
173 if (ret_flag ==
false) {
static CharSamp * FromCharDumpFile(CachedFile *fp)
CharSampSet * tesseract::CharSampSet::FromCharDumpFile |
( |
string |
file_name | ) |
|
|
static |
Definition at line 93 of file char_samp_set.cpp.
97 fp = fopen(file_name.c_str(),
"rb");
102 if (fread(&val32, 1,
sizeof(val32), fp) !=
sizeof(val32)) {
106 if (val32 != 0xfefeabd0) {
112 if (samp_set ==
NULL) {
116 if (samp_set->LoadCharSamples(fp) ==
false) {
int tesseract::CharSampSet::SampleCount |
( |
| ) |
const |
|
inline |
CharSamp** tesseract::CharSampSet::Samples |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: