4#ifndef _a4690364_ec62_4b06_aebc_5b4dc3f92f29
5#define _a4690364_ec62_4b06_aebc_5b4dc3f92f29
9#include <boost/dynamic_bitset.hpp>
A two dimensional mask.
Definition Mask.h:18
std::vector< Point > Points
Definition Mask.h:25
std::size_t size() const
Return the total number of points in the mask.
Shape _shape
Definition Mask.h:67
Mask & operator|=(Mask const &right)
In-place union of two masks.
Vector2l Point
2D point, as (column, row)
Definition Mask.h:21
Shape const & shape() const
Return the shape of the mask.
static bool lessX(Point const &p, Point const &q)
Compare points according to their x coordinate.
Definition Mask.h:28
Mask & enable(Point const &p)
Enable a point.
Mask(Shape const &shape={}, bool value=true)
Create a constant mask.
Mask & disable(Point const &p)
Disable a point.
Mask & operator&=(Mask const &right)
In-place intersection of two masks.
Mask & flip()
Switch the status of all points (enabled ↔ disabled)
Points enabledPoints() const
Return a vector of enabled points.
Vector2l Shape
Shape of the mask, as (column, row)
Definition Mask.h:23
boost::dynamic_bitset _mask
Definition Mask.h:68
std::size_t count() const
Return the number of enabled points.
std::size_t _index(Point const &p) const
Return the linear index corresponding to a point.
static bool lessY(Point const &p, Point const &q)
Compare points according to their y coordinate.
Definition Mask.h:31
bool enabled(Point const &p) const
Check whether the point is enabled.
Definition acceleration.h:17
Vector< 2, long > Vector2l
2D vector of longs
Definition Vector.h:104
Mask operator&(Mask left, Mask const &right)
Intersection of two masks.
Mask operator!(Mask mask)
Retrun a switched mask (enabled ↔ disabled)
Mask operator|(Mask left, Mask const &right)
Union of two masks.