#include <shapetable.h>
Definition at line 62 of file shapetable.h.
| tesseract::Shape::Shape |
( |
| ) |
|
|
inline |
Definition at line 64 of file shapetable.h.
64 : destination_index_(-1) {}
| void tesseract::Shape::AddShape |
( |
const Shape & |
other | ) |
|
Definition at line 94 of file shapetable.cpp.
95 for (
int c = 0; c < other.unichars_.size(); ++c) {
96 for (
int f = 0;
f < other.unichars_[c].font_ids.size(); ++
f) {
98 other.unichars_[c].font_ids[
f]);
101 unichars_sorted_ = unichars_.size() <= 1;
void AddToShape(int unichar_id, int font_id)
| void tesseract::Shape::AddToShape |
( |
int |
unichar_id, |
|
|
int |
font_id |
|
) |
| |
Definition at line 75 of file shapetable.cpp.
76 for (
int c = 0; c < unichars_.size(); ++c) {
77 if (unichars_[c].unichar_id == unichar_id) {
80 for (
int f = 0;
f < font_list.
size(); ++
f) {
81 if (font_list[
f] == font_id)
89 unichars_.push_back(UnicharAndFonts(unichar_id, font_id));
90 unichars_sorted_ = unichars_.size() <= 1;
| bool tesseract::Shape::ContainsFont |
( |
int |
font_id | ) |
const |
Definition at line 131 of file shapetable.cpp.
132 for (
int c = 0; c < unichars_.size(); ++c) {
134 for (
int f = 0;
f < font_list.
size(); ++
f) {
135 if (font_list[
f] == font_id)
| bool tesseract::Shape::ContainsUnichar |
( |
int |
unichar_id | ) |
const |
Definition at line 121 of file shapetable.cpp.
122 for (
int c = 0; c < unichars_.size(); ++c) {
123 if (unichars_[c].unichar_id == unichar_id) {
| bool tesseract::Shape::ContainsUnicharAndFont |
( |
int |
unichar_id, |
|
|
int |
font_id |
|
) |
| const |
Definition at line 105 of file shapetable.cpp.
106 for (
int c = 0; c < unichars_.size(); ++c) {
107 if (unichars_[c].unichar_id == unichar_id) {
110 for (
int f = 0;
f < font_list.
size(); ++
f) {
111 if (font_list[
f] == font_id)
| bool tesseract::Shape::DeSerialize |
( |
bool |
swap, |
|
|
FILE * |
fp |
|
) |
| |
Definition at line 64 of file shapetable.cpp.
66 if (fread(&sorted,
sizeof(sorted), 1, fp) != 1)
68 unichars_sorted_ = sorted != 0;
69 if (!unichars_.DeSerializeClasses(swap, fp))
return false;
| int tesseract::Shape::destination_index |
( |
| ) |
const |
|
inline |
Definition at line 72 of file shapetable.h.
73 return destination_index_;
| bool tesseract::Shape::IsEqualUnichars |
( |
Shape * |
other | ) |
|
Definition at line 158 of file shapetable.cpp.
159 if (unichars_.size() != other->unichars_.size())
return false;
160 if (!unichars_sorted_) SortUnichars();
161 if (!other->unichars_sorted_) other->SortUnichars();
162 for (
int c = 0; c < unichars_.size(); ++c) {
163 if (unichars_[c].unichar_id != other->unichars_[c].unichar_id)
| bool tesseract::Shape::IsSubsetOf |
( |
const Shape & |
other | ) |
const |
Definition at line 143 of file shapetable.cpp.
144 for (
int c = 0; c < unichars_.size(); ++c) {
145 int unichar_id = unichars_[c].unichar_id;
147 for (
int f = 0;
f < font_list.
size(); ++
f) {
148 if (!other.ContainsUnicharAndFont(unichar_id, font_list[
f]))
Definition at line 83 of file shapetable.h.
84 return unichars_[index];
| bool tesseract::Shape::Serialize |
( |
FILE * |
fp | ) |
const |
Definition at line 55 of file shapetable.cpp.
56 uinT8 sorted = unichars_sorted_;
57 if (fwrite(&sorted,
sizeof(sorted), 1, fp) != 1)
59 if (!unichars_.SerializeClasses(fp))
return false;
| void tesseract::Shape::set_destination_index |
( |
int |
index | ) |
|
|
inline |
Definition at line 75 of file shapetable.h.
76 destination_index_ = index;
| int tesseract::Shape::size |
( |
| ) |
const |
|
inline |
Definition at line 78 of file shapetable.h.
79 return unichars_.size();
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/classify/shapetable.h
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/classify/shapetable.cpp