81 #include <visp/vpException.h>
82 #include <visp/vpImagePoint.h>
90 vpRect(
double left,
double top,
double width,
double height);
94 vpRect(
const std::vector<vpImagePoint> &ip);
103 inline double getBottom()
const {
return (this->top + this->height - 1.0); };
110 bottomRight.
set_u( getRight() );
111 bottomRight.
set_v( getBottom() );
127 x = this->left + this->width / 2.0 - 0.5;
128 y = this->top + this->height / 2.0 - 0.5;
143 center.
set_u( this->left + this->width / 2.0 - 0.5 );
144 center.
set_v( this->top + this->height / 2.0 - 0.5 );
155 inline double getHeight()
const {
return this->height; };
161 inline double getLeft()
const {
return this->left; };
167 inline double getRight()
const {
return (this->left + this->width - 1.0); };
174 inline double getTop()
const {
return this->top; };
182 topLeft.
set_u( this->left );
183 topLeft.
set_v( this->top );
193 inline double getWidth()
const {
return this->width; };
196 friend VISP_EXPORT std::ostream& operator<< (std::ostream &os,
const vpRect& r);
197 void set(
const std::vector<vpImagePoint> &ip);
207 inline void setBottom(
double pos) { this->height = pos - this->top + 1.0; };
216 this->height = bottomRight.
get_v() - this->top + 1.0;
217 this->width = bottomRight.
get_u() - this->left + 1.0;
236 inline void setLeft(
double pos) { this->left = pos; };
246 inline void setRect(
double l,
double t,
double w,
double h) {
261 inline void setRight(
double pos) { this->width = pos - this->left + 1.0; };
270 inline void setTop(
double pos) { this->top = pos; };
280 this->left = topLeft.
get_u();
281 this->top = topLeft.
get_v();
290 inline void setWidth(
double w) { this->width = w; }
301 this->left = x - this->width/2 + 0.5;
302 this->top = y - this->height/2 + 0.5;
void getCenter(double &x, double &y) const
vpImagePoint getTopLeft() const
void set_u(const double u)
vpImagePoint getBottomRight() const
void set_v(const double v)
void moveCenter(double x, double y)
void setTopLeft(const vpImagePoint &topLeft)
void setRight(double pos)
Defines a rectangle in the plane.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
vpImagePoint getCenter() const
void setRect(double l, double t, double w, double h)
void setBottomRight(const vpImagePoint &bottomRight)
void setBottom(double pos)