|
bool | isEmpty () const |
|
bool | isSorted () const |
|
float | x () const |
|
float | y () const |
|
float | left () const |
|
float | top () const |
|
float | right () const |
|
float | bottom () const |
|
float | width () const |
|
float | height () const |
|
float | centerX () const |
|
float | centerY () const |
|
void | setEmpty () |
|
void | set (float left, float top, float right, float bottom) |
|
void | setLTRB (float left, float top, float right, float bottom) |
|
void | iset (int left, int top, int right, int bottom) |
|
void | isetWH (int width, int height) |
|
void | setXYWH (float x, float y, float width, float height) |
|
void | setWH (float width, float height) |
|
Rect | makeOffset (float dx, float dy) const |
|
Rect | makeInset (float dx, float dy) const |
|
Rect | makeOutset (float dx, float dy) const |
|
void | offset (float dx, float dy) |
|
void | offsetTo (float newX, float newY) |
|
void | inset (float dx, float dy) |
|
void | outset (float dx, float dy) |
|
bool | intersect (const Rect &r) |
|
bool | intersect (float left, float top, float right, float bottom) |
|
bool | intersect (const Rect &a, const Rect &b) |
|
bool | intersects (float left, float top, float right, float bottom) const |
|
bool | intersects (const Rect &r) const |
|
void | join (float left, float top, float right, float bottom) |
|
void | join (const Rect &r) |
|
void | joinNonEmptyArg (const Rect &r) |
|
void | joinPossiblyEmptyRect (const Rect &r) |
|
bool | contains (float x, float y) const |
|
void | sort () |
|
Rect | makeSorted () const |
|
const float * | asScalars () const |
|
Rect holds four float coordinates describing the upper and lower bounds of a rectangle. Rect may be created from outer bounds or from position, width, and height. Rect describes an area; if its right is less than or equal to its left, or if its bottom is less than or equal to its top, it is considered empty.
bool MNN::CV::Rect::intersect |
( |
float |
left, |
|
|
float |
top, |
|
|
float |
right, |
|
|
float |
bottom |
|
) |
| |
Constructs Rect to intersect from (left, top, right, bottom). Does not sort construction.
Returns true if Rect intersects construction, and sets Rect to intersection. Returns false if Rect does not intersect construction, and leaves Rect unchanged.
Returns false if either construction or Rect is empty, leaving Rect unchanged.
- 参数
-
left | x-axis minimum of constructed Rect |
top | y-axis minimum of constructed Rect |
right | x-axis maximum of constructed Rect |
bottom | y-axis maximum of constructed Rect |
- 返回
- true if construction and Rect have area in common
void MNN::CV::Rect::join |
( |
float |
left, |
|
|
float |
top, |
|
|
float |
right, |
|
|
float |
bottom |
|
) |
| |
Constructs Rect to intersect from (left, top, right, bottom). Does not sort construction.
Sets Rect to the union of itself and the construction.
Has no effect if construction is empty. Otherwise, if Rect is empty, sets Rect to construction.
- 参数
-
left | x-axis minimum of constructed Rect |
top | y-axis minimum of constructed Rect |
right | x-axis maximum of constructed Rect |
bottom | y-axis maximum of constructed Rect |
Rect MNN::CV::Rect::makeInset |
( |
float |
dx, |
|
|
float |
dy |
|
) |
| const |
|
inline |
Returns Rect, inset by (dx, dy).
If dx is negative, Rect returned is wider. If dx is positive, Rect returned is narrower. If dy is negative, Rect returned is taller. If dy is positive, Rect returned is shorter.
- 参数
-
dx | added to fLeft and subtracted from fRight |
dy | added to fTop and subtracted from fBottom |
- 返回
- Rect inset symmetrically left and right, top and bottom
Rect MNN::CV::Rect::makeOffset |
( |
float |
dx, |
|
|
float |
dy |
|
) |
| const |
|
inline |
Returns Rect offset by (dx, dy).
If dx is negative, Rect returned is moved to the left. If dx is positive, Rect returned is moved to the right. If dy is negative, Rect returned is moved upward. If dy is positive, Rect returned is moved downward.
- 参数
-
dx | added to fLeft and fRight |
dy | added to fTop and fBottom |
- 返回
- Rect offset on axes, with original width and height
Rect MNN::CV::Rect::makeOutset |
( |
float |
dx, |
|
|
float |
dy |
|
) |
| const |
|
inline |
Returns Rect, outset by (dx, dy).
If dx is negative, Rect returned is narrower. If dx is positive, Rect returned is wider. If dy is negative, Rect returned is shorter. If dy is positive, Rect returned is taller.
- 参数
-
dx | subtracted to fLeft and added from fRight |
dy | subtracted to fTop and added from fBottom |
- 返回
- Rect outset symmetrically left and right, top and bottom
void MNN::CV::Rect::offset |
( |
float |
dx, |
|
|
float |
dy |
|
) |
| |
|
inline |
Offsets Rect by adding dx to fLeft, fRight; and by adding dy to fTop, fBottom.
If dx is negative, moves Rect to the left. If dx is positive, moves Rect to the right. If dy is negative, moves Rect upward. If dy is positive, moves Rect downward.
- 参数
-
dx | offset added to fLeft and fRight |
dy | offset added to fTop and fBottom |
void MNN::CV::Rect::setEmpty |
( |
| ) |
|
|
inline |
Sets Rect to (0, 0, 0, 0).
Many other rectangles are empty; if left is equal to or greater than right, or if top is equal to or greater than bottom. Setting all members to zero is a convenience, but does not designate a special empty rectangle.