65 Rect32f(
float x,
float y,
float width,
float height):
66 x(x),y(y),width(width),height(height){
70 this->height = height;
77 this->width = s.
width;
85 this->width = r.
width;
93 width((float)
rect.width),
94 height((float)
rect.height){
98 bool isNull()
const {
return (*
this)==
null; }
102 return x==s.
x && y==s.
y && width==s.
width && height==s.
height;
107 return x!=s.
x || y!= s.
y || width!=s.
width || height!=s.
height;
112 return Rect32f(d*x,d*y,d*width,d*height);
117 return Rect32f(d/x,d/y,d/width,d/height);
132 x+=p.
x; y+=p.
y;
return *
this;
137 x-=p.
x; y-=p.
y;
return *
this;
157 float getDim()
const {
return width*height;}
164 if (result.
width > 0 && result.
height > 0)
return result;
198 return x<=r.
x && y <= r.
y && right() >= r.
right() && bottom() >= r.
bottom();
203 return this->x<=x && right()>=x && this->y<=y && bottom()>=y;
213 x-=k; y-=k; width+=2*k; height+=2*k;
242 float left()
const {
return x; }
245 float right()
const {
return x+width; }
248 float bottom()
const {
return y+height; }
251 float top()
const {
return y; }
258 return Point32f(x+width/2,y+height/2);
263 return Rect32f(x*xfac,y*yfac,width*xfac,height*yfac);
float top() const
returns the position of the upper border
Definition: Rect32f.h:251
Rect32f(const Rect32f &r)
create a deep copy of a rect
Definition: Rect32f.h:82
undocument this line if you encounter any issues!
Definition: Any.h:37
Rect32f & operator&=(const Rect32f &r)
inplace intersection of two rects
Definition: Rect32f.h:169
Point32f center() const
returns the center point of the rect
Definition: Rect32f.h:257
float y
y position of this point
Definition: Point32f.h:48
float y
!< x pos (upper left)
Definition: Rect32f.h:49
Rect32f operator/(double d) const
scales all parameters of the rect by a double value
Definition: Rect32f.h:116
Point32f lr() const
returns lower right point of the rect
Definition: Rect32f.h:237
float right() const
returns the right border position
Definition: Rect32f.h:245
#define ICLUtils_API
this macros are important for creating dll's
Definition: CompatMacros.h:171
Rect32f & operator-=(const Size32f &s)
substracs a size to the rects size
Definition: Rect32f.h:126
bool operator==(const Rect32f &s) const
checks if two rects are equal
Definition: Rect32f.h:101
Rect32f(const Rect &rect)
create a floating point rect from given int-valued rect
Definition: Rect32f.h:90
bool contains(const Rect32f &r) const
returns if a Rect32f containes another rect
Definition: Rect32f.h:197
#define iclMin(A, B)
Definition: Macros.h:204
Rect32f()
default constructor
Definition: Rect32f.h:57
Rect32f & operator+=(const Size32f &s)
adds a size to the rects size
Definition: Rect32f.h:121
bool operator!=(const Rect32f &s) const
checks if two rects are not equal
Definition: Rect32f.h:106
Rect32f operator|(const Rect32f &r) const
union of two Rect32fs
Definition: Rect32f.h:175
float x
Definition: Rect32f.h:48
Rect32f & operator/=(double d)
scales all rect params inplace
Definition: Rect32f.h:149
Floating point precision implementation of the Rect class.
Definition: Rect32f.h:45
bool contains(float x, float y) const
returns if the Rect32f contains a given point
Definition: Rect32f.h:202
bool isNull() const
checks wether the object instance is null, i.e. all elements are zero
Definition: Rect32f.h:98
Size32f getSize() const
returns the size of the rect
Definition: Rect32f.h:254
float height
!< width of the rect
Definition: Rect32f.h:51
FixedMatrix< T, V_COLS, M_ROWS_AND_COLS > & operator *=(FixedMatrix< T, V_COLS, M_ROWS_AND_COLS > &v, const FixedMatrix< T, M_ROWS_AND_COLS, M_ROWS_AND_COLS > &m)
Matrix multiplication (inplace)
Definition: FixedMatrix.h:959
Rect32f(const Point32f &p, const Size32f &s)
creates a new Rect32f with specified offset and size
Definition: Rect32f.h:74
Rect32f enlarged(float k) const
returns an enlarged instance of this rect
Definition: Rect32f.h:219
Rect32f & enlarge(float k)
let the rect grow by k pixles into each direction
Definition: Rect32f.h:212
Point32f ur() const
returns upper right point of the rect
Definition: Rect32f.h:233
#define iclMax(A, B)
Definition: Macros.h:207
ICLUtils_API std::ostream & operator<<(std::ostream &s, const ConfigFile &cf)
Default ostream operator to put a ConfigFile into a stream.
ICLUtils_API std::istream & operator>>(std::istream &s, Point &p)
istream operator
float bottom() const
returns the position of the bottom border
Definition: Rect32f.h:248
Point32f ul() const
returns upper left point of the rect
Definition: Rect32f.h:225
ICLQt_API ImgQ operator *(const ImgQ &a, const ImgQ &b)
multiplies two images pixel-wise
float getDim() const
returns width*height
Definition: Rect32f.h:157
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
Rect32f & operator+=(const Point32f &p)
adds a Point to the rects offset
Definition: Rect32f.h:131
Rect32f & operator-=(const Point32f &p)
substracts a Point to the rects offset
Definition: Rect32f.h:136
Rect32f & operator|=(const Rect32f &r)
inplace union of two rects
Definition: Rect32f.h:182
Rect32f(float x, float y, float width, float height)
creates a defined Rect32f
Definition: Rect32f.h:65
Point32f ll() const
returns lower left point of the rect
Definition: Rect32f.h:229
float x
x position of this point
Definition: Point32f.h:45
float height
Definition: Size32f.h:47
float width
!< y pos (upper left)
Definition: Rect32f.h:50
ICLQt_API void rect(ImgQ &image, int x, int y, int w, int h, int rounding=0)
draws a rect into an image
Rect32f normalized() const
rects with negative sizes are normalized to Positive sizes
Definition: Rect32f.h:189
Size32f class of the ICL (float valued)
Definition: Size32f.h:40
float width
Definition: Size32f.h:44
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Definition: Rect.h:95
Rect32f transform(double xfac, double yfac) const
multiplies the rect's x and width by xfac and y and height by yfac
Definition: Rect32f.h:262
float left() const
returns the left border position
Definition: Rect32f.h:242