KJB
|
Predicate functor tests whether a PixPoint is in a bounding box. More...
#include <pixpoint.h>
Public Member Functions | |
Is_inbounds (PixPoint min_min, PixPoint width_height) | |
Establish the boundaries of the box: LL corner and size. More... | |
bool | operator() (PixPoint querypoint) const |
Predicate test: is it inside the established boundaries? More... | |
bool | operator!= (const Is_inbounds &that_functor) const |
test whether this functor differs from another More... | |
Public Attributes | |
const PixPoint | m_min_min |
minimum in-bounds x and y coordinates More... | |
const PixPoint | m_width_height |
dimensions of bounding box More... | |
Predicate functor tests whether a PixPoint is in a bounding box.
Bounding box must be an axis-aligned rectangle.
This is a particularly useful functor if you must verify a container full of PixPoints is inbounds: instantiate once, test on everyone. There is example code here: Testing using PixPoint functor.
Establish the boundaries of the box: LL corner and size.
min_min | The point just barely within bounds, with the smallest legitimate x coordinate and y coordinate. |
width_height | Width of the box as x coordinate, height of the box as y coordinate. |
If either dimension of width_height is zero or negative, then the predicate will always return false.
|
inline |
test whether this functor differs from another
|
inline |
Predicate test: is it inside the established boundaries?
const PixPoint kjb::qd::PixPoint::Is_inbounds::m_min_min |
minimum in-bounds x and y coordinates
const PixPoint kjb::qd::PixPoint::Is_inbounds::m_width_height |
dimensions of bounding box