50 length_ = src.length_;
53 for (
int i = 0; i < length_; ++i)
62 boxword->length_ = tessword->
NumBlobs();
64 boxword->boxes_.
reserve(boxword->length_);
66 for (
int b = 0; b < boxword->length_; ++b) {
70 outline = outline->
next) {
71 EDGEPT* edgept = outline->loop;
80 TBOX pt_box(pos, pos);
83 edgept = edgept->
next;
84 }
while (edgept != outline->loop);
88 boxword->ComputeBoundingBox();
96 for (
int i = 0; i < length_; ++i) {
104 for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
105 TBOX blob_box = b_it.data()->bounding_box();
109 original_box += blob_box;
112 if (!original_box.null_box()) {
115 if (NearlyEqual<int>(original_box.right(), box.
right(),
119 box.
set_top(original_box.top());
120 if (NearlyEqual<int>(original_box.bottom(), box.
bottom(),
129 ComputeBoundingBox();
137 if (end <= start + 1)
139 for (
int i = start + 1; i < end; ++i) {
140 boxes_[start] += boxes_[i];
142 int shrinkage = end - 1 - start;
143 length_ -= shrinkage;
144 for (
int i = start + 1; i < length_; ++i)
145 boxes_[i] = boxes_[i + shrinkage];
153 boxes_.
insert(box, index);
156 length_ = boxes_.
size();
157 ComputeBoundingBox();
164 ComputeBoundingBox();
173 ComputeBoundingBox();
184 void BoxWord::ComputeBoundingBox() {
186 for (
int i = 0; i < length_; ++i)
195 for (
int i = 0; i < length_ && i < other.
NumBlobs(); ++i) {
196 TBOX blob_box = other.
blobs[i]->bounding_box();
197 if (blob_box == boxes_[i])
void rotate(const FCOORD &vec)
GenericVector< TBLOB * > blobs
void InsertBox(int index, const TBOX &box)
void insert(T t, int index)
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
void DenormTransform(const DENORM *last_denorm, const TPOINT &pt, TPOINT *original) const
void ClipToOriginalWord(const BLOCK *block, WERD *original_word)
const int kBoxClipTolerance
FCOORD re_rotation() const
void ProcessMatchedBlobs(const TWERD &other, TessCallback1< int > *cb) const
const DENORM & denorm() const
void MergeBoxes(int start, int end)
BoxWord & operator=(const BoxWord &src)
void ChangeBox(int index, const TBOX &box)
void set_y(inT16 yin)
rewrite function
void set_x(inT16 xin)
rewrite function
bool major_overlap(const TBOX &box) const
void DeleteBox(int index)
static BoxWord * CopyFromNormalized(TWERD *tessword)
TBOX intersection(const TBOX &box) const
void CopyFrom(const BoxWord &src)
C_BLOB_LIST * cblob_list()
TBOX bounding_box() const