#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 122 of file char_samp_set.cpp.
126 fp = fopen(file_name.c_str(),
"wb");
132 if (fwrite(&val32, 1,
sizeof(val32), fp) !=
sizeof(val32)) {
| bool tesseract::CharSampSet::EnumSamples |
( |
string |
file_name, |
|
|
CharSampEnum * |
enumerator |
|
) |
| |
|
static |
Definition at line 140 of file char_samp_set.cpp.
146 fp_in =
new CachedFile(file_name);
150 i64_size = fp_in->Size();
155 if (fp_in->Read(&val32,
sizeof(val32)) !=
sizeof(val32)) {
158 if (val32 != 0xfefeabd0) {
162 while (fp_in->eof() ==
false) {
164 i64_pos = fp_in->Tell();
165 if (new_samp !=
NULL) {
166 bool ret_flag = (enum_obj)->EnumCharSamp(new_samp,
167 (100.0
f * i64_pos / i64_size));
169 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)) {
105 if (val32 != 0xfefeabd0) {
110 if (samp_set ==
NULL) {
113 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: