77 #include <visp3/core/vpException.h>
78 #include <visp3/core/vpImagePoint.h>
86 vpRect(
double left,
double top,
double width,
double height);
90 vpRect(
const std::vector<vpImagePoint> &ip);
99 inline double getBottom()
const {
return (this->top + this->height - 1.0); };
106 bottomRight.
set_u( getRight() );
107 bottomRight.
set_v( getBottom() );
123 x = this->left + this->width / 2.0 - 0.5;
124 y = this->top + this->height / 2.0 - 0.5;
139 center.
set_u( this->left + this->width / 2.0 - 0.5 );
140 center.
set_v( this->top + this->height / 2.0 - 0.5 );
151 inline double getHeight()
const {
return this->height; };
157 inline double getLeft()
const {
return this->left; };
163 inline double getRight()
const {
return (this->left + this->width - 1.0); };
169 inline double getSize()
const {
return (this->width * this->height); };
176 inline double getTop()
const {
return this->top; };
184 topLeft.
set_u( this->left );
185 topLeft.
set_v( this->top );
195 inline double getWidth()
const {
return this->width; };
198 friend VISP_EXPORT std::ostream& operator<< (std::ostream &os,
const vpRect& r);
199 void set(
double left,
double top,
double width,
double height);
200 void set(
const vpImagePoint &topLeft,
double width,
double height);
202 void set(
const vpRect& r);
203 void set(
const std::vector<vpImagePoint> &ip);
213 inline void setBottom(
double pos) { this->height = pos - this->top + 1.0; };
222 this->height = bottomRight.
get_v() - this->top + 1.0;
223 this->width = bottomRight.
get_u() - this->left + 1.0;
242 inline void setLeft(
double pos) { this->left = pos; };
252 inline void setRect(
double l,
double t,
double w,
double h) {
267 inline void setRight(
double pos) { this->width = pos - this->left + 1.0; };
276 inline void setTop(
double pos) { this->top = pos; };
286 this->left = topLeft.
get_u();
287 this->top = topLeft.
get_v();
296 inline void setWidth(
double w) { this->width = w; }
307 this->left = x - this->width/2 + 0.5;
308 this->top = y - this->height/2 + 0.5;
320 this->left = center.
get_u() - this->width/2 + 0.5;
321 this->top = center.
get_v() - 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 moveCenter(const vpImagePoint ¢er)
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)