54 TPOINT(int16_t vx, int16_t vy) :
x(vx),
y(vy) {}
66 return x == other.
x &&
y == other.
y;
80 : next(nullptr), prev(nullptr), src_outline(nullptr), start_step(0), step_count(0) {
102 int x_dist = pos.x - other.
pos.
x;
103 int y_dist = pos.y - other.
pos.
y;
104 return x_dist * x_dist * x_factor + y_dist * y_dist;
111 TBOX box(pos.x, pos.y, pos.x, pos.y);
119 }
while (pt != end && pt !=
this);
126 const EDGEPT* pt = this->next;
131 }
while (pt != end && pt !=
this);
141 if (pt == end)
return true;
144 }
while (pt !=
this && count <= min_points);
156 return flags[0] != 0;
162 return flags[2] != 0;
183 TESSLINE() : is_hole(false), loop(nullptr), next(nullptr) {}
184 TESSLINE(
const TESSLINE& src) : loop(nullptr), next(nullptr) {
195 static TESSLINE* BuildFromOutlineList(
EDGEPT* outline);
197 void CopyFrom(
const TESSLINE& src);
203 void Rotate(
const FCOORD rotation);
205 void Move(
const ICOORD vec);
207 void Scale(
float factor);
211 void ComputeBoundingBox();
217 void MinMaxCrossProduct(
const TPOINT vec,
int* min_xp,
int* max_xp)
const;
219 TBOX bounding_box()
const;
226 if (Contains(pt1) && Contains(pt2)) {
231 }
while (pt != loop);
237 return topleft.x <= pt.
x && pt.
x <= botright.x &&
238 botright.y <= pt.
y && pt.
y <= topleft.y;
241 #ifndef GRAPHICS_DISABLED 244 #endif // GRAPHICS_DISABLED 248 EDGEPT* FindBestStartPt()
const;
252 return (botright.x - topleft.x) * (topleft.y - botright.y);
279 static TBLOB* PolygonalCopy(
bool allow_detailed_fx,
C_BLOB* src);
287 TBLOB* ClassifyNormalizeIfNeeded()
const;
290 void CopyFrom(
const TBLOB& src);
298 const DENORM* predecessor,
299 float x_origin,
float y_origin,
300 float x_scale,
float y_scale,
301 float final_xshift,
float final_yshift,
302 bool inverse, Pix* pix);
304 void Rotate(
const FCOORD rotation);
306 void Move(
const ICOORD vec);
308 void Scale(
float factor);
310 void ComputeBoundingBoxes();
313 int NumOutlines()
const;
315 TBOX bounding_box()
const;
319 for (
const TESSLINE* outline = outlines; outline !=
nullptr;
320 outline = outline->
next) {
321 if (outline->SegmentCrosses(pt1, pt2))
return true;
327 for (
const TESSLINE* outline = outlines; outline !=
nullptr;
328 outline = outline->
next) {
329 if (outline->Contains(pt))
return true;
336 void EliminateDuplicateOutlines();
340 void CorrectBlobOrder(
TBLOB* next);
346 #ifndef GRAPHICS_DISABLED 349 #endif // GRAPHICS_DISABLED 353 for (
TESSLINE* outline = outlines; outline !=
nullptr; outline = outline->
next)
354 total_area += outline->BBArea();
362 int ComputeMoments(
FCOORD* center,
FCOORD* second_moments)
const;
365 void GetPreciseBoundingBox(
TBOX* precise_box)
const;
375 void GetEdgeCoords(
const TBOX& box,
387 void CollectEdges(
const TBOX& box,
411 static TWERD* PolygonalCopy(
bool allow_detailed_fx,
WERD* src);
414 void BLNormalize(
const BLOCK* block,
const ROW* row, Pix* pix,
bool inverse,
415 float x_height,
float baseline_shift,
bool numeric_mode,
417 const TBOX* norm_box,
420 void CopyFrom(
const TWERD& src);
424 void ComputeBoundingBoxes();
430 TBOX bounding_box()
const;
434 void MergeBlobs(
int start,
int end);
EDGEPT & operator=(const EDGEPT &src)
bool EqualPos(const EDGEPT &other) const
bool Contains(const TPOINT &pt) const
int SegmentArea(const EDGEPT *end) const
void Normalize(float *Values)
GenericVector< TBLOB * > blobs
TESSLINE & operator=(const TESSLINE &src)
TESSLINE(const TESSLINE &src)
void operator+=(const TPOINT &other)
bool SegmentCrossesOutline(const TPOINT &pt1, const TPOINT &pt2) const
EDGEPT(const EDGEPT &src)
void CopyFrom(const EDGEPT &src)
TBLOB & operator=(const TBLOB &src)
TBOX SegmentBox(const EDGEPT *end) const
void divide_blobs(TBLOB *blob, TBLOB *other_blob, bool italic_blob, const TPOINT &location)
bool Contains(const TPOINT &pt) const
bool operator==(const TPOINT &other) const
TPOINT(int16_t vx, int16_t vy)
bool SameBox(const TESSLINE &other) const
bool ShortNonCircularSegment(int min_points, const EDGEPT *end) const
bool SegmentCrosses(const TPOINT &pt1, const TPOINT &pt2) const
void operator/=(int divisor)
TWERD & operator=(const TWERD &src)
const DENORM & denorm() const
static bool IsCrossed(const TPOINT &a0, const TPOINT &a1, const TPOINT &b0, const TPOINT &b1)
int WeightedDistance(const EDGEPT &other, int x_factor) const
CLISTIZEH(STRING) CLISTIZE(STRING) namespace tesseract
bool divisible_blob(TBLOB *blob, bool italic_blob, TPOINT *location)