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);
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)
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])
void ProcessMatchedBlobs(const TWERD &other, TessCallback1< int > *cb) const
void rotate(const FCOORD &vec)
FCOORD re_rotation() const
TBOX intersection(const TBOX &box) const
void set_x(int16_t xin)
rewrite function
void ClipToOriginalWord(const BLOCK *block, WERD *original_word)
TBOX bounding_box() const
void MergeBoxes(int start, int end)
BoxWord & operator=(const BoxWord &src)
void DeleteBox(int index)
void insert(const T &t, int index)
void DenormTransform(const DENORM *last_denorm, const TPOINT &pt, TPOINT *original) const
bool major_overlap(const TBOX &box) const
const int kBoxClipTolerance
static BoxWord * CopyFromNormalized(TWERD *tessword)
C_BLOB_LIST * cblob_list()
GenericVector< TBLOB * > blobs
void CopyFrom(const BoxWord &src)
void ChangeBox(int index, const TBOX &box)
const DENORM & denorm() const
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
void set_y(int16_t yin)
rewrite function
void InsertBox(int index, const TBOX &box)