Public Member Functions | |
BBox | clamp (const BBox &clampBox) const |
Clamp a bounding box based on a restricting clamp box. More... | |
size_t | getWidth () const |
size_t | getHeight () const |
bool | isValid () const |
Checks if the bounding box is valid. More... | |
std::pair< int, int > | getCenter () const |
Returns the center of the bounding box. More... | |
BBox | scale (float scaleW, float scaleH) const |
Scales bounding box based along the width and height retaining the same center. More... | |
BBox | squarify (const BBox &clampBox) const |
Resizes bounding box to a square bounding box based on the longest edge and clamps the bounding box based on the limits provided. More... | |
Data Fields | |
int | xmin {0} |
minimum x coordinate. More... | |
int | ymin {0} |
minimum y coordinate. More... | |
int | xmax {0} |
maximum x coordinate. More... | |
int | ymax {0} |
maximum y coordinate. More... | |
|
inline |
Returns the center of the bounding box.
Definition at line 74 of file BBox.h.
References getHeight(), getWidth(), xmin, and ymin.
Referenced by scale().
|
inline |
Definition at line 57 of file BBox.h.
Referenced by getCenter(), isValid(), scale(), and squarify().
|
inline |
Definition at line 49 of file BBox.h.
Referenced by getCenter(), isValid(), scale(), and squarify().
|
inline |
Checks if the bounding box is valid.
Definition at line 65 of file BBox.h.
References getHeight(), getWidth(), xmax, xmin, ymax, and ymin.
Referenced by squarify().
|
inline |
Scales bounding box based along the width and height retaining the same center.
Scale | in X direction along the width |
Scale | in Y direction along the height |
Definition at line 87 of file BBox.h.
References getCenter(), getHeight(), getWidth(), xmax, xmin, ymax, and ymin.
Referenced by squarify().
Resizes bounding box to a square bounding box based on the longest edge and clamps the bounding box based on the limits provided.
Clamping | bounding box (xmin, ymin, xmax, ymax) |
Definition at line 107 of file BBox.h.
References clamp(), getHeight(), getWidth(), isValid(), scale(), xmax, xmin, ymax, and ymin.
int cvcore::BBox::xmax {0} |
maximum x coordinate.
Definition at line 28 of file BBox.h.
Referenced by clamp(), getWidth(), isValid(), scale(), and squarify().
int cvcore::BBox::xmin {0} |
minimum x coordinate.
Definition at line 26 of file BBox.h.
Referenced by clamp(), getCenter(), getWidth(), isValid(), scale(), and squarify().
int cvcore::BBox::ymax {0} |
maximum y coordinate.
Definition at line 29 of file BBox.h.
Referenced by clamp(), getHeight(), isValid(), scale(), and squarify().
int cvcore::BBox::ymin {0} |
minimum y coordinate.
Definition at line 27 of file BBox.h.
Referenced by clamp(), getCenter(), getHeight(), isValid(), scale(), and squarify().