47 length_ = src.length_;
50 for (
int i = 0; i < length_; ++i)
59 boxword->length_ = tessword->
NumBlobs();
61 boxword->boxes_.reserve(boxword->length_);
63 for (
int b = 0; b < boxword->length_; ++b) {
67 outline = outline->
next) {
68 EDGEPT* edgept = outline->loop;
77 TBOX pt_box(pos, pos);
80 edgept = edgept->
next;
81 }
while (edgept != outline->loop);
83 boxword->boxes_.push_back(blob_box);
85 boxword->ComputeBoundingBox();
93 for (
int i = 0; i < length_; ++i) {
101 for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
102 TBOX blob_box = b_it.data()->bounding_box();
103 if (block !=
nullptr)
106 original_box += blob_box;
109 if (!original_box.null_box()) {
112 if (NearlyEqual<int>(original_box.right(), box.
right(),
116 box.
set_top(original_box.top());
117 if (NearlyEqual<int>(original_box.bottom(), box.
bottom(),
122 if (block !=
nullptr)
126 ComputeBoundingBox();
134 if (end <= start + 1)
136 for (
int i = start + 1; i < end; ++i) {
137 boxes_[start] += boxes_[i];
139 int shrinkage = end - 1 - start;
140 length_ -= shrinkage;
141 for (
int i = start + 1; i < length_; ++i)
142 boxes_[i] = boxes_[i + shrinkage];
150 boxes_.
insert(box, index);
153 length_ = boxes_.
size();
154 ComputeBoundingBox();
161 ComputeBoundingBox();
170 ComputeBoundingBox();
181 void BoxWord::ComputeBoundingBox() {
183 for (
int i = 0; i < length_; ++i)
191 std::function<
void(
int)> cb)
const {
192 for (
int i = 0; i < length_ && i < other.
NumBlobs(); ++i) {
193 TBOX blob_box = other.
blobs[i]->bounding_box();
194 if (blob_box == boxes_[i])