41 #include <visp3/core/vpRect.h>
60 vpRect::vpRect(
double l,
double t,
double w,
double h) : left(l), top(t), width(w), height(h) { }
71 : left(topLeft.get_u()), top(topLeft.get_v()), width(w), height(h)
79 : left(topLeft.get_u()), top(topLeft.get_v()), width(0), height(0)
81 this->left = topLeft.
get_u();
82 this->top = topLeft.
get_v();
101 this->width = r.width;
102 this->height = r.height;
111 vpRect::vpRect(
const std::vector<vpImagePoint> &ip) : left(0), top(0), width(0), height(0) {
set(ip); }
122 return ((ip.
get_i() <= this->getBottom()) && (ip.
get_i() >= this->getTop()) && (ip.
get_j() <= this->getRight()) &&
123 (ip.
get_j() >= this->getLeft()));
152 left = topLeft.
get_u();
153 top = topLeft.
get_v();
170 maxu = ip[0].get_u();
171 maxv = ip[0].get_v();
175 size_t ip_size = ip.size();
176 for (
size_t i = 1; i < ip_size; ++i) {
177 double u = ip[i].get_u();
178 double v = ip[i].get_v();
208 this->left = topLeft.
get_u();
209 this->top = topLeft.
get_v();
227 return ((std::fabs(top - r.top) <= (std::fabs(top) * std::numeric_limits<double>::epsilon())) &&
228 (std::fabs(left - r.left) <= (std::fabs(left) * std::numeric_limits<double>::epsilon())) &&
229 (std::fabs(width - r.width) <= (std::fabs(width) * std::numeric_limits<double>::epsilon())) &&
230 (std::fabs(height - r.height) <= (std::fabs(height) * std::numeric_limits<double>::epsilon())));
251 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)