#include <blobs.h>
Definition at line 48 of file blobs.h.
◆ TPOINT() [1/3]
tesseract::TPOINT::TPOINT |
( |
| ) |
|
|
default |
◆ TPOINT() [2/3]
◆ TPOINT() [3/3]
tesseract::TPOINT::TPOINT |
( |
const ICOORD & |
ic | ) |
|
|
inline |
Definition at line 51 of file blobs.h.
51:
x(ic.x()),
y(ic.y()) {}
◆ cross()
int tesseract::TPOINT::cross |
( |
const TPOINT & |
other | ) |
const |
|
inline |
Definition at line 75 of file blobs.h.
75 {
76 return x * other.y -
y * other.x;
77 }
◆ diff()
void tesseract::TPOINT::diff |
( |
const TPOINT & |
p1, |
|
|
const TPOINT & |
p2 |
|
) |
| |
|
inline |
◆ dot()
int tesseract::TPOINT::dot |
( |
const TPOINT & |
other | ) |
const |
|
inline |
Definition at line 80 of file blobs.h.
80 {
81 return x * other.x +
y * other.y;
82 }
◆ IsCrossed()
Definition at line 65 of file blobs.cpp.
65 {
66 TPOINT b0a1, b0a0, a1b1, b0b1, a1a0;
67
68 b0a1.x = a1.x - b0.x;
69 b0a0.x = a0.x - b0.x;
70 a1b1.x = b1.x - a1.x;
71 b0b1.x = b1.x - b0.x;
72 a1a0.x = a0.x - a1.x;
73 b0a1.y = a1.y - b0.y;
74 b0a0.y = a0.y - b0.y;
75 a1b1.y = b1.y - a1.y;
76 b0b1.y = b1.y - b0.y;
77 a1a0.y = a0.y - a1.y;
78
79 int b0a1xb0b1 = b0a1.cross(b0b1);
80 int b0b1xb0a0 = b0b1.cross(b0a0);
81 int a1b1xa1a0 = a1b1.cross(a1a0);
82
83
84 int a1a0xa1b0 = -a1a0.cross(b0a1);
85
86 return ((b0a1xb0b1 > 0 && b0b1xb0a0 > 0) || (b0a1xb0b1 < 0 && b0b1xb0a0 < 0)) &&
87 ((a1b1xa1a0 > 0 && a1a0xa1b0 > 0) || (a1b1xa1a0 < 0 && a1a0xa1b0 < 0));
88}
◆ length()
int tesseract::TPOINT::length |
( |
| ) |
const |
|
inline |
◆ operator+=()
void tesseract::TPOINT::operator+= |
( |
const TPOINT & |
other | ) |
|
|
inline |
◆ operator/=()
void tesseract::TPOINT::operator/= |
( |
int |
divisor | ) |
|
|
inline |
◆ operator==()
bool tesseract::TPOINT::operator== |
( |
const TPOINT & |
other | ) |
const |
|
inline |
Definition at line 61 of file blobs.h.
61 {
62 return x == other.x &&
y == other.y;
63 }
The documentation for this struct was generated from the following files:
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/ccstruct/blobs.h
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/ccstruct/blobs.cpp