Related functions for Simd::Rectangle structure. More...
Functions | |
| template<typename T > | |
| bool | operator== (const Rectangle< T > &r1, const Rectangle< T > &r2) |
| Compares two rectangles by all four sides. More... | |
| template<typename T > | |
| bool | operator!= (const Rectangle< T > &r1, const Rectangle< T > &r2) |
| Compares two rectangles by any differing side. More... | |
| template<class T1 , class T2 > | |
| Rectangle< T1 > | operator/ (const Rectangle< T1 > &rect, const T2 &value) |
| Divides every side by a scalar. More... | |
| template<class T1 , class T2 > | |
| Rectangle< T1 > | operator* (const Rectangle< T1 > &rect, const T2 &value) |
| Multiplies every side by a scalar. More... | |
| template<class T1 , class T2 > | |
| Rectangle< T1 > | operator* (const T2 &value, const Rectangle< T1 > &rect) |
| Multiplies a scalar by every side of a rectangle. More... | |
| template<typename T > | |
| Rectangle< T > | operator+ (const Rectangle< T > &r1, const Rectangle< T > &r2) |
| Adds the corresponding sides of two rectangles. More... | |
Detailed Description
Related functions for Simd::Rectangle structure.
Function Documentation
◆ operator==()
Compares two rectangles by all four sides.
left, top, right and bottom are compared independently. Two rectangles of equal width and height compare equal only when they also share the same origin.
- Parameters
-
[in] r1 - a first rectangle. [in] r2 - a second rectangle.
- Returns
- true when all four sides are equal.
◆ operator!=()
Compares two rectangles by any differing side.
The result is true when left, top, right or bottom differs.
- Parameters
-
[in] r1 - a first rectangle. [in] r2 - a second rectangle.
- Returns
- true when any side differs.
◆ operator/()
| template< class T1, class T2 > Rectangle< T1 > operator/ | ( | const Rectangle< T1 > & | rect, |
| const T2 & | value | ||
| ) |
Divides every side by a scalar.
The result is Rectangle<T1>(left / value, top / value, right / value, bottom / value). Construction converts each quotient back to T1, so Rectangle<ptrdiff_t> divided by a floating value is rounded to the nearest integer. Integer division truncates toward zero. TestResize builds the chroma rectangle as the luma rectangle / 2.
- Parameters
-
[in] rect - a rectangle. [in] value - a non-zero scalar.
- Returns
- the rectangle with divided sides.
◆ operator*() [1/2]
| template< class T1, class T2 > Rectangle< T1 > operator* | ( | const Rectangle< T1 > & | rect, |
| const T2 & | value | ||
| ) |
Multiplies every side by a scalar.
The result is Rectangle<T1>(left * value, top * value, right * value, bottom * value). A floating factor applied to Rectangle<ptrdiff_t> is rounded by the constructor. Motion debug drawing paints object.rect * scale on the full-resolution frame.
- Parameters
-
[in] rect - a rectangle. [in] value - a scalar factor.
- Returns
- the rectangle with multiplied sides.
◆ operator*() [2/2]
| template< class T1, class T2 > Rectangle< T1 > operator* | ( | const T2 & | value, |
| const Rectangle< T1 > & | rect | ||
| ) |
Multiplies a scalar by every side of a rectangle.
The result is the same as rect * value. A floating factor applied to Rectangle<ptrdiff_t> is rounded by the constructor.
- Parameters
-
[in] value - a scalar factor. [in] rect - a rectangle.
- Returns
- the rectangle with multiplied sides.
◆ operator+()
| template< typename T > Rectangle< T > operator+ | ( | const Rectangle< T > & | r1, |
| const Rectangle< T > & | r2 | ||
| ) |
Adds the corresponding sides of two rectangles.
The result is (r1.left + r2.left, r1.top + r2.top, r1.right + r2.right, r1.bottom + r2.bottom). This is the same sum as operator +=. The bounding union is operator |=. Motion accumulates this sum and then divides by the number of rectangles to average a box.
- Parameters
-
[in] r1 - a first rectangle. [in] r2 - a second rectangle.
- Returns
- the rectangle with summed sides.