tesseract
5.0.0-alpha-619-ge9db
|
Go to the documentation of this file.
61 void set_x(int16_t xin) {
65 void set_y(int16_t yin) {
148 int* major,
int* minor)
const;
214 void set_x(
float xin) {
218 void set_y(
float yin) {
223 float sqlength()
const {
224 return xcoord * xcoord + ycoord * ycoord;
228 float length()
const {
229 return std::sqrt(sqlength());
233 float pt_to_pt_sqdist(
const FCOORD &pt)
const {
236 gap.xcoord = xcoord - pt.xcoord;
237 gap.ycoord = ycoord - pt.ycoord;
242 float pt_to_pt_dist(
const FCOORD &pt)
const {
243 return std::sqrt(pt_to_pt_sqdist(pt));
247 float angle()
const {
248 return std::atan2(ycoord, xcoord);
252 uint8_t to_direction()
const;
254 void from_direction(uint8_t direction);
259 static uint8_t binary_angle_plus_pi(
double angle);
262 static double angle_from_direction(uint8_t direction);
268 const FCOORD& dir_vector)
const;
275 return xcoord == other.xcoord && ycoord == other.ycoord;
279 return xcoord != other.xcoord || ycoord != other.ycoord;
308 void rotate(
const FCOORD vec);
311 void unrotate(
const FCOORD &vec);
538 auto tmp = static_cast<int16_t>(std::floor(
xcoord * vec.
x() -
558 result.xcoord = -src.ycoord;
559 result.ycoord = src.xcoord;
576 result.xcoord = -src.xcoord;
577 result.ycoord = -src.ycoord;
594 sum.xcoord = op1.xcoord + op2.xcoord;
595 sum.ycoord = op1.ycoord + op2.ycoord;
610 op1.xcoord += op2.xcoord;
611 op1.ycoord += op2.ycoord;
628 sum.xcoord = op1.xcoord - op2.xcoord;
629 sum.ycoord = op1.ycoord - op2.ycoord;
644 op1.xcoord -= op2.xcoord;
645 op1.ycoord -= op2.ycoord;
660 return op1.xcoord * op2.xcoord + op1.ycoord * op2.ycoord;
673 return op1.xcoord * op2.ycoord - op1.ycoord * op2.xcoord;
688 result.xcoord = op1.xcoord * scale;
689 result.ycoord = op1.ycoord * scale;
700 result.xcoord = op1.xcoord * scale;
701 result.ycoord = op1.ycoord * scale;
734 result.xcoord = op1.xcoord / scale;
735 result.ycoord = op1.ycoord / scale;
767 tmp = xcoord * vec.
x () - ycoord * vec.
y ();
768 ycoord = ycoord * vec.
x () + xcoord * vec.
y ();
void unrotate(const FCOORD &vec)
float angle() const
find angle
void set_x(int16_t xin)
rewrite function
friend ICOORD & operator-=(ICOORD &, const ICOORD &)
subtract
friend ICOORD & operator/=(ICOORD &, int16_t)
divide
ICOORD operator-(const ICOORD &src)
ICOORD & operator+=(ICOORD &op1, const ICOORD &op2)
bool DeSerialize(bool swap, FILE *fp)
float sqlength() const
find sq length
bool operator!=(const ICOORD &other) const
test inequality
void rotate(const FCOORD &vec)
friend int32_t operator%(const ICOORD &, const ICOORD &)
scalar product
friend ICOORD operator/(const ICOORD &, int16_t)
divide
float length() const
find length
int16_t x() const
access function
ICOORD operator/(const ICOORD &op1, int16_t scale)
bool operator==(const ICOORD &other) const
test equality
void set_y(int16_t yin)
rewrite function
#define ELISTIZEH(CLASSNAME)
ICOORD & operator*=(ICOORD &op1, int16_t scale)
void setup_render(ICOORD *major_step, ICOORD *minor_step, int *major, int *minor) const
float pt_to_pt_sqdist(const ICOORD &pt) const
sq dist between pts
int32_t operator%(const ICOORD &op1, const ICOORD &op2)
friend int32_t operator*(const ICOORD &, const ICOORD &)
cross product
bool Serialize(FILE *fp) const
friend ICOORD & operator+=(ICOORD &, const ICOORD &)
add
void rotate(const FCOORD vec)
int32_t operator*(const ICOORD &op1, const ICOORD &op2)
float pt_to_pt_dist(const ICOORD &pt) const
Distance between pts.
friend ICOORD operator!(const ICOORD &)
rotate 90 deg anti
FCOORD()=default
empty constructor
ICOORD operator+(const ICOORD &op1, const ICOORD &op2)
friend ICOORD & operator*=(ICOORD &, int16_t)
multiply
friend ICOORD operator-(const ICOORD &)
unary minus
ICOORD & operator-=(ICOORD &op1, const ICOORD &op2)
void set_with_shrink(int x, int y)
Set from the given x,y, shrinking the vector to fit if needed.
float sqlength() const
find sq length
~ICOORD()=default
destructor
bool operator==(const UnicodeText &lhs, const UnicodeText &rhs)
bool operator!=(const UnicodeText &lhs, const UnicodeText &rhs)
ICOORD operator!(const ICOORD &src)
ICOORD()
empty constructor
friend ICOORD operator+(const ICOORD &, const ICOORD &)
add
ICOORD & operator/=(ICOORD &op1, int16_t scale)
int16_t y() const
access_function