#include <char_samp_set.h>
List of all members.
Detailed Description
Definition at line 40 of file char_samp_set.h.
Constructor & Destructor Documentation
tesseract::CharSampSet::CharSampSet |
( |
| ) |
|
tesseract::CharSampSet::~CharSampSet |
( |
| ) |
|
Member Function Documentation
bool tesseract::CharSampSet::Add |
( |
CharSamp * |
char_samp | ) |
|
Definition at line 55 of file char_samp_set.cpp.
{
CharSamp **new_samp_buff =
if (new_samp_buff ==
NULL) {
return false;
}
if (cnt_ > 0) {
memcpy(new_samp_buff, samp_buff_, cnt_ * sizeof(*samp_buff_));
delete []samp_buff_;
}
samp_buff_ = new_samp_buff;
}
samp_buff_[cnt_++] = char_samp;
return true;
}
FILE * tesseract::CharSampSet::CreateCharDumpFile |
( |
string |
file_name | ) |
|
|
static |
Definition at line 122 of file char_samp_set.cpp.
{
FILE *fp;
unsigned int val32;
fp = fopen(file_name.c_str(), "wb");
if (!fp) {
}
val32 = 0xfefeabd0;
if (fwrite(&val32, 1, sizeof(val32), fp) != sizeof(val32)) {
}
return fp;
}
bool tesseract::CharSampSet::EnumSamples |
( |
string |
file_name, |
|
|
CharSampEnum * |
enumerator |
|
) |
| |
|
static |
Definition at line 140 of file char_samp_set.cpp.
{
CachedFile *fp_in;
unsigned int val32;
long i64_size,
i64_pos;
fp_in = new CachedFile(file_name);
return false;
}
i64_size = fp_in->Size();
if (i64_size < 1) {
return false;
}
if (fp_in->Read(&val32, sizeof(val32)) != sizeof(val32)) {
return false;
}
if (val32 != 0xfefeabd0) {
return false;
}
while (fp_in->eof() == false) {
i64_pos = fp_in->Tell();
bool ret_flag = (enum_obj)->EnumCharSamp(new_samp,
(100.0
f * i64_pos / i64_size));
delete new_samp;
if (ret_flag == false) {
break;
}
}
}
delete fp_in;
return true;
}
CharSampSet * tesseract::CharSampSet::FromCharDumpFile |
( |
string |
file_name | ) |
|
|
static |
Definition at line 93 of file char_samp_set.cpp.
{
FILE *fp;
unsigned int val32;
fp = fopen(file_name.c_str(), "rb");
}
if (fread(&val32, 1, sizeof(val32), fp) != sizeof(val32)) {
}
if (val32 != 0xfefeabd0) {
}
}
if (samp_set->LoadCharSamples(fp) == false) {
delete samp_set;
}
fclose(fp);
return samp_set;
}
int tesseract::CharSampSet::SampleCount |
( |
| ) |
const |
|
inline |
CharSamp** tesseract::CharSampSet::Samples |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: