#include <shapetable.h>
Definition at line 185 of file shapetable.h.
◆ Shape()
tesseract::Shape::Shape |
( |
| ) |
|
|
inline |
Definition at line 187 of file shapetable.h.
187 : destination_index_(-1) {}
◆ AddShape()
void tesseract::Shape::AddShape |
( |
const Shape & |
other | ) |
|
Definition at line 120 of file shapetable.cpp.
121 for (
int c = 0; c < other.unichars_.size(); ++c) {
122 for (
int f = 0; f < other.unichars_[c].font_ids.size(); ++f) {
124 other.unichars_[c].font_ids[f]);
127 unichars_sorted_ = unichars_.size() <= 1;
void AddToShape(int unichar_id, int font_id)
◆ AddToShape()
void tesseract::Shape::AddToShape |
( |
int |
unichar_id, |
|
|
int |
font_id |
|
) |
| |
Definition at line 101 of file shapetable.cpp.
102 for (
int c = 0; c < unichars_.size(); ++c) {
103 if (unichars_[c].unichar_id == unichar_id) {
106 for (
int f = 0; f < font_list.
size(); ++f) {
107 if (font_list[f] == font_id)
115 unichars_.push_back(UnicharAndFonts(unichar_id, font_id));
116 unichars_sorted_ = unichars_.size() <= 1;
◆ ContainsFont()
bool tesseract::Shape::ContainsFont |
( |
int |
font_id | ) |
const |
Definition at line 157 of file shapetable.cpp.
158 for (
int c = 0; c < unichars_.size(); ++c) {
160 for (
int f = 0; f < font_list.
size(); ++f) {
161 if (font_list[f] == font_id)
◆ ContainsFontProperties()
bool tesseract::Shape::ContainsFontProperties |
( |
const FontInfoTable & |
font_table, |
|
|
uint32_t |
properties |
|
) |
| const |
Definition at line 169 of file shapetable.cpp.
171 for (
int c = 0; c < unichars_.size(); ++c) {
173 for (
int f = 0; f < font_list.
size(); ++f) {
174 if (font_table.get(font_list[f]).properties == properties)
◆ ContainsMultipleFontProperties()
bool tesseract::Shape::ContainsMultipleFontProperties |
( |
const FontInfoTable & |
font_table | ) |
const |
Definition at line 182 of file shapetable.cpp.
184 uint32_t properties = font_table.get(unichars_[0].font_ids[0]).properties;
185 for (
int c = 0; c < unichars_.size(); ++c) {
187 for (
int f = 0; f < font_list.
size(); ++f) {
188 if (font_table.get(font_list[f]).properties != properties)
◆ ContainsUnichar()
bool tesseract::Shape::ContainsUnichar |
( |
int |
unichar_id | ) |
const |
Definition at line 147 of file shapetable.cpp.
148 for (
int c = 0; c < unichars_.size(); ++c) {
149 if (unichars_[c].unichar_id == unichar_id) {
◆ ContainsUnicharAndFont()
bool tesseract::Shape::ContainsUnicharAndFont |
( |
int |
unichar_id, |
|
|
int |
font_id |
|
) |
| const |
Definition at line 131 of file shapetable.cpp.
132 for (
int c = 0; c < unichars_.size(); ++c) {
133 if (unichars_[c].unichar_id == unichar_id) {
136 for (
int f = 0; f < font_list.
size(); ++f) {
137 if (font_list[f] == font_id)
◆ DeSerialize()
bool tesseract::Shape::DeSerialize |
( |
TFile * |
fp | ) |
|
Definition at line 92 of file shapetable.cpp.
94 if (!fp->DeSerialize(&sorted))
return false;
95 unichars_sorted_ = sorted != 0;
96 return unichars_.DeSerializeClasses(fp);
◆ destination_index()
int tesseract::Shape::destination_index |
( |
| ) |
const |
|
inline |
Definition at line 194 of file shapetable.h.
195 return destination_index_;
◆ IsEqualUnichars()
bool tesseract::Shape::IsEqualUnichars |
( |
Shape * |
other | ) |
|
Definition at line 217 of file shapetable.cpp.
218 if (unichars_.size() != other->unichars_.size())
return false;
219 if (!unichars_sorted_) SortUnichars();
220 if (!other->unichars_sorted_) other->SortUnichars();
221 for (
int c = 0; c < unichars_.size(); ++c) {
222 if (unichars_[c].unichar_id != other->unichars_[c].unichar_id)
◆ IsSubsetOf()
bool tesseract::Shape::IsSubsetOf |
( |
const Shape & |
other | ) |
const |
Definition at line 202 of file shapetable.cpp.
203 for (
int c = 0; c < unichars_.size(); ++c) {
204 int unichar_id = unichars_[c].unichar_id;
206 for (
int f = 0; f < font_list.
size(); ++f) {
207 if (!other.ContainsUnicharAndFont(unichar_id, font_list[f]))
◆ operator==()
bool tesseract::Shape::operator== |
( |
const Shape & |
other | ) |
const |
Definition at line 197 of file shapetable.cpp.
198 return IsSubsetOf(other) && other.IsSubsetOf(*
this);
bool IsSubsetOf(const Shape &other) const
◆ operator[]()
◆ Serialize()
bool tesseract::Shape::Serialize |
( |
FILE * |
fp | ) |
const |
Definition at line 86 of file shapetable.cpp.
87 uint8_t sorted = unichars_sorted_;
bool Serialize(FILE *fp, const char *data, size_t n)
◆ set_destination_index()
void tesseract::Shape::set_destination_index |
( |
int |
index | ) |
|
|
inline |
Definition at line 197 of file shapetable.h.
198 destination_index_ = index;
◆ SetUnicharId()
void tesseract::Shape::SetUnicharId |
( |
int |
index, |
|
|
int |
unichar_id |
|
) |
| |
|
inline |
Definition at line 209 of file shapetable.h.
210 unichars_[index].unichar_id = unichar_id;
◆ size()
int tesseract::Shape::size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: