40 #ifndef VP_IMAGE_POINT_H
41 #define VP_IMAGE_POINT_H
43 #include <visp3/core/vpConfig.h>
114 inline double get_i()
const {
return i; }
125 inline double get_j()
const {
return j; }
136 inline double get_u()
const {
return j; }
147 inline double get_v()
const {
return i; }
149 bool inRectangle(
const vpRect &rect)
const;
164 bool cond11 = ((end.
get_j() >= start.
get_j()) && (end.
get_j() >= this->j) && (this->j >= start.
get_j()));
165 bool cond12 = ((end.
get_j() <= start.
get_j()) && (end.
get_j() <= this->j) && (this->j <= start.
get_j()));
166 bool cond21 = ((end.
get_i() >= start.
get_i()) && (end.
get_i() >= this->i) && (this->i >= start.
get_i()));
167 bool cond22 = ((end.
get_i() <= start.
get_i()) && (end.
get_i() <= this->i) && (this->i <= start.
get_i()));
168 return (cond11 || cond12) && (cond21 || cond22);
223 if (fabs(end.
get_j() - this->j) > fabs(end.
get_i() - this->i)) {
224 double j_ = (end.
get_j() > this->j ? (this->j + 1) : (this->j - 1));
225 #if ((__cplusplus >= 201103L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L)))
226 return { end.
get_i() - (line_slope * (end.
get_j() - j_)), j_ };
232 double i_ = (end.
get_i() > this->i ? (this->i + 1) : (this->i - 1));
233 #if ((__cplusplus >= 201103L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L)))
234 return { i_, end.
get_j() - ((end.
get_i() - i_) / line_slope) };
251 #if ((__cplusplus >= 201103L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L)))
255 inline vpImagePoint &operator=(const vpImagePoint &&ip) noexcept
298 inline void set_i(
double ii) { this->i = ii; }
309 inline void set_j(
double jj) { this->j = jj; }
335 inline void set_u(
double u) { j = u; }
346 inline void set_v(
double v) { i = v; }
364 static vpRect getBBox(
const std::vector<vpImagePoint> &ipVec);
380 friend VISP_EXPORT std::ostream &operator<<(std::ostream &os,
const vpImagePoint &ip);
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
vpImagePoint(double ii, double jj)
vpImagePoint & operator=(const vpImagePoint &ip)
void set_ij(double ii, double jj)
virtual ~vpImagePoint()
Destructor.
vpImagePoint nextInSegment(const vpImagePoint &start, const vpImagePoint &end) const
void set_uv(double u, double v)
vpImagePoint & operator*=(double scale)
vpImagePoint(const vpImagePoint &ip)
vpImagePoint & operator-=(const vpImagePoint &ip)
bool inSegment(const vpImagePoint &start, const vpImagePoint &end) const
Defines a rectangle in the plane.
std::vector< char > & operator+=(std::vector< char > &lhs, const T rhs)
vpMatrix operator*(const double &x, const vpMatrix &A)