43 #include <visp3/core/vpDebug.h>
44 #include <visp3/core/vpRect.h>
62 vpRect::vpRect(
double l,
double t,
double w,
double h) : left(l), top(t), width(w), height(h) {}
73 : left(topLeft.get_u()), top(topLeft.get_v()), width(w), height(h)
82 : left(topLeft.get_u()), top(topLeft.get_v()), width(0), height(0)
84 this->left = topLeft.
get_u();
85 this->top = topLeft.
get_v();
104 this->width = r.width;
105 this->height = r.height;
114 vpRect::vpRect(
const std::vector<vpImagePoint> &ip) : left(0), top(0), width(0), height(0) {
set(ip); }
125 return (ip.
get_i() <= this->getBottom() && ip.
get_i() >= this->getTop() && ip.
get_j() <= this->getRight() &&
126 ip.
get_j() >= this->getLeft());
155 left = topLeft.
get_u();
156 top = topLeft.
get_v();
172 minu = maxu = ip[0].get_u();
173 minv = maxv = ip[0].get_v();
175 for (
size_t i = 1; i < ip.size(); i++) {
176 double u = ip[i].get_u();
177 double v = ip[i].get_v();
203 this->left = topLeft.
get_u();
204 this->top = topLeft.
get_v();
223 return (std::fabs(top - r.top) <= std::fabs(top) * std::numeric_limits<double>::epsilon() &&
224 std::fabs(left - r.left) <= std::fabs(left) * std::numeric_limits<double>::epsilon() &&
225 std::fabs(width - r.width) <= std::fabs(width) * std::numeric_limits<double>::epsilon() &&
226 std::fabs(height - r.height) <= std::fabs(height) * std::numeric_limits<double>::epsilon());
245 return !(*
this == r);
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Defines a rectangle in the plane.
bool isInside(const vpImagePoint &ip) const
void set(double left, double top, double width, double height)
vpRect & operator=(const vpRect &r)
bool operator==(const vpRect &r) const
bool operator!=(const vpRect &r) const
void setRight(double pos)
void setBottom(double pos)