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])