40#include <visp3/core/vpRect.h>
59vpRect::vpRect(
double l,
double t,
double w,
double h) : left(l), top(t), width(w), height(h) { }
70 : left(topLeft.get_u()), top(topLeft.get_v()), width(w), height(h)
78 : left(topLeft.get_u()), top(topLeft.get_v()), width(0), height(0)
80 this->left = topLeft.
get_u();
81 this->top = topLeft.
get_v();
100 this->width = r.width;
101 this->height = r.height;
110vpRect::vpRect(
const std::vector<vpImagePoint> &ip) : left(0), top(0), width(0), height(0) {
set(ip); }
121 return ((ip.
get_i() <= this->getBottom()) && (ip.
get_i() >= this->getTop()) && (ip.
get_j() <= this->getRight()) &&
122 (ip.
get_j() >= this->getLeft()));
151 left = topLeft.
get_u();
152 top = topLeft.
get_v();
169 maxu = ip[0].get_u();
170 maxv = ip[0].get_v();
174 size_t ip_size = ip.size();
175 for (
size_t i = 1; i < ip_size; ++i) {
176 double u = ip[i].get_u();
177 double v = ip[i].get_v();
207 this->left = topLeft.
get_u();
208 this->top = topLeft.
get_v();
226 return ((std::fabs(top - r.top) <= (std::fabs(top) * std::numeric_limits<double>::epsilon())) &&
227 (std::fabs(left - r.left) <= (std::fabs(left) * std::numeric_limits<double>::epsilon())) &&
228 (std::fabs(width - r.width) <= (std::fabs(width) * std::numeric_limits<double>::epsilon())) &&
229 (std::fabs(height - r.height) <= (std::fabs(height) * std::numeric_limits<double>::epsilon())));
250 return !(*
this == r);
269 os << r.getLeft() <<
", " << r.getTop() <<
", " << r.getWidth() <<
", " << r.getHeight();
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 ...
friend VISP_EXPORT bool inRectangle(const vpImagePoint &ip, const vpRect &rect)
bool isInside(const vpImagePoint &ip) const
void set(double left, double top, double width, double height)
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpRect &r)
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)