56 length_ = src.length_;
59 for (
int i = 0; i < length_; ++i)
72 for (
TBLOB* tblob = tessword->
blobs; tblob !=
NULL; tblob = tblob->next)
75 boxword->boxes_.
reserve(boxword->length_);
77 for (
TBLOB* tblob = tessword->
blobs; tblob !=
NULL; tblob = tblob->next) {
79 for (
TESSLINE* outline = tblob->outlines; outline !=
NULL;
80 outline = outline->next) {
81 EDGEPT* edgept = outline->loop;
92 TBOX pt_box(pos, pos);
95 edgept = edgept->
next;
96 }
while (edgept != outline->loop);
100 boxword->ComputeBoundingBox();
114 for (
TBLOB* tblob = tessword->
blobs; tblob !=
NULL; tblob = tblob->next,
116 int class_id = best_choice->
unichar_id(blob_index);
117 TBOX blob_box = tblob->bounding_box();
118 int top = blob_box.
top();
119 int bottom = blob_box.
bottom();
120 int min_bottom, max_bottom, min_top, max_top;
125 }
else if (!small_caps) {
139 for (
int i = 0; i < length_; ++i) {
140 TBOX box = boxes_[i];
147 for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
148 TBOX blob_box = b_it.data()->bounding_box();
152 original_box += blob_box;
155 if (!original_box.null_box()) {
158 if (NearlyEqual<int>(original_box.right(), box.
right(),
162 box.
set_top(original_box.top());
163 if (NearlyEqual<int>(original_box.bottom(), box.
bottom(),
172 ComputeBoundingBox();
180 if (end <= start + 1)
182 for (
int i = start + 1; i < end; ++i) {
183 boxes_[start] += boxes_[i];
185 int shrinkage = end - 1 - start;
186 length_ -= shrinkage;
187 for (
int i = start + 1; i < length_; ++i)
188 boxes_[i] = boxes_[i + shrinkage];
196 boxes_.
insert(box, index);
199 length_ = boxes_.
size();
200 ComputeBoundingBox();
209 ComputeBoundingBox();
220 void BoxWord::ComputeBoundingBox() {
222 for (
int i = 0; i < length_; ++i)
232 for (
int i = 0; i < length_ && blob !=
NULL; ++i, blob = blob->
next) {
233 TBOX blob_box = blob->bounding_box();
234 if (blob_box == boxes_[i])
static BoxWord * CopyFromNormalized(const DENORM *denorm, TWERD *tessword)
void ProcessMatchedBlobs(const TWERD &other, TessCallback1< int > *cb) const
C_BLOB_LIST * cblob_list()
void CopyFrom(const BoxWord &src)
BoxWord & operator=(const BoxWord &src)
const int kMaxDropCapBottom
void ClipToOriginalWord(const BLOCK *block, WERD *original_word)
void MergeBoxes(int start, int end)
void SetScriptPositions(const UNICHARSET &unicharset, bool small_caps, TWERD *tessword, WERD_CHOICE *best_choice)
const int kBoxClipTolerance
void DeleteBox(int index)
void DenormTransform(const TPOINT &pt, TPOINT *original) const
void get_top_bottom(UNICHAR_ID unichar_id, int *min_bottom, int *max_bottom, int *min_top, int *max_top) const
void insert(T t, int index)
void set_y(inT16 yin)
rewrite function
void set_x(inT16 xin)
rewrite function
void InsertBox(int index, const TBOX &box)
const int kMinSuperscriptOffset
bool major_overlap(const TBOX &box) const
virtual void remove(int index)
void rotate(const FCOORD &vec)
TBOX intersection(const TBOX &box) const
FCOORD re_rotation() const
const int kMinSubscriptOffset
virtual void truncate(int size)
const UNICHAR_ID unichar_id(int index) const
void init_to_size(int size, T t)
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)