64 return x == other.
x &&
y == other.
y;
78 : next(NULL), prev(NULL), src_outline(NULL), start_step(0), step_count(0) {
100 int x_dist = pos.x - other.
pos.
x;
101 int y_dist = pos.y - other.
pos.
y;
102 return x_dist * x_dist * x_factor + y_dist * y_dist;
109 TBOX box(pos.x, pos.y, pos.x, pos.y);
117 }
while (pt != end && pt !=
this);
124 const EDGEPT* pt = this->next;
129 }
while (pt != end && pt !=
this);
139 if (pt == end)
return true;
142 }
while (pt !=
this && count <= min_points);
154 return flags[0] != 0;
160 return flags[2] != 0;
181 TESSLINE() : is_hole(false), loop(NULL), next(NULL) {}
201 void Rotate(
const FCOORD rotation);
203 void Move(
const ICOORD vec);
205 void Scale(
float factor);
209 void ComputeBoundingBox();
215 void MinMaxCrossProduct(
const TPOINT vec,
int* min_xp,
int* max_xp)
const;
217 TBOX bounding_box()
const;
224 if (Contains(pt1) && Contains(pt2)) {
229 }
while (pt != loop);
235 return topleft.x <= pt.
x && pt.
x <= botright.x &&
236 botright.y <= pt.
y && pt.
y <= topleft.y;
239 #ifndef GRAPHICS_DISABLED 242 #endif // GRAPHICS_DISABLED 246 EDGEPT* FindBestStartPt()
const;
250 return (botright.x - topleft.x) * (topleft.y - botright.y);
277 static TBLOB* PolygonalCopy(
bool allow_detailed_fx,
C_BLOB* src);
285 TBLOB* ClassifyNormalizeIfNeeded()
const;
288 void CopyFrom(
const TBLOB& src);
296 const DENORM* predecessor,
297 float x_origin,
float y_origin,
298 float x_scale,
float y_scale,
299 float final_xshift,
float final_yshift,
300 bool inverse, Pix* pix);
302 void Rotate(
const FCOORD rotation);
304 void Move(
const ICOORD vec);
306 void Scale(
float factor);
308 void ComputeBoundingBoxes();
311 int NumOutlines()
const;
313 TBOX bounding_box()
const;
317 for (
const TESSLINE* outline = outlines; outline != NULL;
318 outline = outline->
next) {
319 if (outline->SegmentCrosses(pt1, pt2))
return true;
325 for (
const TESSLINE* outline = outlines; outline != NULL;
326 outline = outline->
next) {
327 if (outline->Contains(pt))
return true;
334 void EliminateDuplicateOutlines();
338 void CorrectBlobOrder(
TBLOB* next);
344 #ifndef GRAPHICS_DISABLED 347 #endif // GRAPHICS_DISABLED 351 for (
TESSLINE* outline = outlines; outline != NULL; outline = outline->
next)
352 total_area += outline->BBArea();
360 int ComputeMoments(
FCOORD* center,
FCOORD* second_moments)
const;
363 void GetPreciseBoundingBox(
TBOX* precise_box)
const;
373 void GetEdgeCoords(
const TBOX& box,
385 void CollectEdges(
const TBOX& box,
409 static TWERD* PolygonalCopy(
bool allow_detailed_fx,
WERD* src);
412 void BLNormalize(
const BLOCK* block,
const ROW* row, Pix* pix,
bool inverse,
413 float x_height,
float baseline_shift,
bool numeric_mode,
415 const TBOX* norm_box,
418 void CopyFrom(
const TWERD& src);
422 void ComputeBoundingBoxes();
428 TBOX bounding_box()
const;
432 void MergeBlobs(
int start,
int end);
bool operator==(const TPOINT &other) const
TBOX SegmentBox(const EDGEPT *end) const
bool SegmentCrosses(const TPOINT &pt1, const TPOINT &pt2) const
void Normalize(float *Values)
bool Contains(const TPOINT &pt) const
bool SameBox(const TESSLINE &other) const
EDGEPT(const EDGEPT &src)
bool SegmentCrossesOutline(const TPOINT &pt1, const TPOINT &pt2) const
TESSLINE(const TESSLINE &src)
void operator/=(int divisor)
void CopyFrom(const EDGEPT &src)
TPOINT(inT16 vx, inT16 vy)
int WeightedDistance(const EDGEPT &other, int x_factor) const
TESSLINE & operator=(const TESSLINE &src)
const DENORM & denorm() const
bool Contains(const TPOINT &pt) const
void divide_blobs(TBLOB *blob, TBLOB *other_blob, bool italic_blob, const TPOINT &location)
bool EqualPos(const EDGEPT &other) const
GenericVector< TBLOB * > blobs
TWERD & operator=(const TWERD &src)
bool ShortNonCircularSegment(int min_points, const EDGEPT *end) const
EDGEPT & operator=(const EDGEPT &src)
void operator+=(const TPOINT &other)
static bool IsCrossed(const TPOINT &a0, const TPOINT &a1, const TPOINT &b0, const TPOINT &b1)
int SegmentArea(const EDGEPT *end) const
bool divisible_blob(TBLOB *blob, bool italic_blob, TPOINT *location)
TBLOB & operator=(const TBLOB &src)