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); };
173 inline double getSize()
const {
return (this->width * this->height); };
180 inline double getTop()
const {
return this->top; };
188 topLeft.
set_u( this->left );
189 topLeft.
set_v( this->top );
199 inline double getWidth()
const {
return this->width; };
202 friend VISP_EXPORT std::ostream& operator<< (std::ostream &os,
const vpRect& r);
203 void set(
double left,
double top,
double width,
double height);
204 void set(
const vpImagePoint &topLeft,
double width,
double height);
206 void set(
const vpRect& r);
207 void set(
const std::vector<vpImagePoint> &ip);
217 inline void setBottom(
double pos) { this->height = pos - this->top + 1.0; };
226 this->height = bottomRight.
get_v() - this->top + 1.0;
227 this->width = bottomRight.
get_u() - this->left + 1.0;
246 inline void setLeft(
double pos) { this->left = pos; };
256 inline void setRect(
double l,
double t,
double w,
double h) {
271 inline void setRight(
double pos) { this->width = pos - this->left + 1.0; };
280 inline void setTop(
double pos) { this->top = pos; };
290 this->left = topLeft.
get_u();
291 this->top = topLeft.
get_v();
300 inline void setWidth(
double w) { this->width = w; }
311 this->left = x - this->width/2 + 0.5;
312 this->top = y - this->height/2 + 0.5;
324 this->left = center.
get_u() - this->width/2 + 0.5;
325 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)