![]() |
Image Component Library (ICL)
|
Rectangle class of the ICL used e.g. for the Images ROI-rect. More...
#include <Rect.h>
Public Member Functions | |
| Rect () | |
| default constructor More... | |
| Rect (int x, int y, int width, int height) | |
| creates a defined Rect More... | |
| Rect (const Point &p, const Size &s) | |
| creates a new Rect with specified offset and size More... | |
| Rect (const Rect &r) | |
| create a deep copy of a rect More... | |
| Rect (const Rect32f &other) | |
| creates a Rect from given Rect32f instance More... | |
| bool | isNull () const |
| checks wether the object instance is null, i.e. all elements are zero More... | |
| bool | operator== (const Rect &s) const |
| checks if two rects are equal More... | |
| bool | operator!= (const Rect &s) const |
| checks if two rects are not equal More... | |
| Rect | operator * (double d) const |
| scales all parameters of the rect by a double value More... | |
| Rect | operator/ (double d) const |
| scales all parameters of the rect by a double value More... | |
| Rect | operator+ (const Size &s) const |
| adds a size to the rects size More... | |
| Rect | operator- (const Size &s) const |
| substracts a size for the rects size More... | |
| Rect & | operator+= (const Size &s) |
| adds a size to the rects size More... | |
| Rect & | operator-= (const Size &s) |
| substracs a size from the rects size More... | |
| Rect | operator+ (const Point &p) const |
| adds a Point to the rects offset More... | |
| Rect | operator- (const Point &p) const |
| substracts a Point from the rects offset More... | |
| Rect & | operator+= (const Point &p) |
| adds a Point to the rects offset More... | |
| Rect & | operator-= (const Point &p) |
| substracts a Point from the rects offset More... | |
| Rect & | operator *= (double d) |
| scales all rect params inplace More... | |
| Rect & | operator/= (double d) |
| scales all rect params inplace More... | |
| int | getDim () const |
| returns width*height More... | |
| Rect | operator & (const Rect &r) const |
| intersection of two Rects More... | |
| Rect & | operator&= (const Rect &r) |
| inplace intersection of two rects More... | |
| Rect | operator| (const Rect &r) const |
| union of two Rects More... | |
| Rect & | operator|= (const Rect &r) |
| inplace union of two rects More... | |
| Rect | normalized () const |
| rects with negative sizes are normalized to Positive sizes More... | |
| bool | contains (const Rect &r) const |
| returns if a Rect containes another rect More... | |
| bool | contains (int x, int y) const |
| returns if the Rect contains a given point (pixel-based) More... | |
| Rect & | enlarge (int k) |
| let the rect grow by k pixles into each direction More... | |
| Rect | enlarged (int k) const |
| returns an enlarged instance of this rect More... | |
| Point | ul () const |
| returns upper left point of the rect More... | |
| Point | ll () const |
| returns lower left point of the rect More... | |
| Point | ur () const |
| returns upper right point of the rect More... | |
| Point | lr () const |
| returns lower right point of the rect More... | |
| Point | center () const |
| returns the center Point of the rect More... | |
| int | left () const |
| returns the left border position More... | |
| int | right () const |
| returns the right border position More... | |
| int | bottom () const |
| returns the position of the bottom border More... | |
| int | top () const |
| returns the position of the upper border More... | |
| Size | getSize () const |
| returns the size of the rect More... | |
| Rect | transform (double xfac, double yfac) const |
Static Public Attributes | |
| static const Rect | null |
| null Rect is w=0, h=0, x=0, y=0 More... | |
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Please take care of the following conventions when using Rects in the ICL library:
|------ width ------>|
............................
............................
origin(x,y)---->Xooooooooooooooooooooo.... ___
..oooooooooooooooooooooo.... /|\
..oooooooooooooooooooooo.... |
..oooooooooooooooooooooo.... height
..oooooooooooooooooooooo.... |
..oooooooooooooooooooooo.... _|_
............................
............................
Please note, that a rect fits a discrete set of points: For instance the Rect (x=2,y=1,width=3,height=4) contains exactly 3x4=12 points i.e. those ones with
and
. Hence a full image roi of an image of size 640x480 has an offset of (0,0), a size of 640x480, but it contains only x-values within the range 0-639 and y-values within range 0-479.
|
inline |
default constructor
|
inline |
creates a defined Rect
creates a new Rect with specified offset and size
|
inline |
create a deep copy of a rect
|
inline |
returns the position of the bottom border
|
inline |
returns if a Rect containes another rect
|
inline |
returns if the Rect contains a given point (pixel-based)
Note: We are talking here in terms of pixel-based rects: The rect x=5,y=5,width=10,height=20 contains the x-indices withing the interval [5,15[ (half-opened interval). In terms of discrete X-values, the intervall meets the set {5,6,...13,14}. The same is true for Y-values.
|
inline |
let the rect grow by k pixles into each direction
if k<0 the rect becomes smaller E.g. Rect(10,10,90,90).enlarge(10) creates a Rect (0,0,100,100)
| k | amount of pixel the rectangle is enlarged by |
|
inline |
returns an enlarged instance of this rect
|
inline |
returns width*height
|
inline |
returns the size of the rect
|
inline |
checks wether the object instance is null, i.e. all elements are zero
|
inline |
returns the left border position
|
inline |
returns lower left point of the rect
|
inline |
returns lower right point of the rect
|
inline |
rects with negative sizes are normalized to Positive sizes
e.g. the rect (5,5,-5,-5) is normalized to (0,0,5,5)
|
inline |
scales all parameters of the rect by a double value
|
inline |
scales all rect params inplace
|
inline |
checks if two rects are not equal
substracts a size for the rects size
substracts a Point from the rects offset
substracts a Point from the rects offset
|
inline |
scales all parameters of the rect by a double value
|
inline |
scales all rect params inplace
|
inline |
checks if two rects are equal
|
inline |
returns the right border position
|
inline |
returns the position of the upper border
|
inline |
|
inline |
returns upper left point of the rect
|
inline |
returns upper right point of the rect
1.8.15