|
msl 1.3.0
|
A two dimensional binary mask.
#include <Mask.h>
Public Member Functions | |
| Mask (Shape const &shape={}, bool value=true) | |
| Create a constant mask. | |
| Mask (Mask const &)=default | |
| Mask (Mask &&)=default | |
| Mask & | operator= (Mask const &)=default |
| Mask & | operator= (Mask &&)=default |
| std::size_t | count () const |
| Return the number of enabled points. | |
| Mask & | enable (Point const &p) |
| Enable a point. | |
| Mask & | disable (Point const &p) |
| Disable a point. | |
| bool | enabled (Point const &p) const |
| Check whether the point is enabled. | |
| Mask & | flip () |
| Switch the status of all points (enabled ↔ disabled). | |
| Mask & | operator|= (Mask const &right) |
| In-place union of two masks. | |
| Mask & | operator&= (Mask const &right) |
| In-place intersection of two masks. | |
| Points | enabledPoints () const |
| Return a vector of enabled points. | |
| Public Member Functions inherited from msl::MaskBase< bool > | |
| MaskBase (Shape const &shape={}, bool value=bool()) | |
| Create a constant mask. | |
| MaskBase & | operator= (MaskBase const &)=default |
| std::size_t | size () const |
| Return the total number of points in the mask. | |
| Shape const & | shape () const |
| Return the shape of the mask. | |
| void | fill (bool value) |
| Fill all points of mask with value. | |
| bool const & | operator[] (Point const &p) const |
| Read-only access to a mask item. | |
Additional Inherited Members | |
| Public Types inherited from msl::MaskBase< bool > | |
| using | Point |
| 2D point, as (column, row), (x, y) or (ky,kz) | |
| using | Shape |
| Shape of the mask, as (column, row), (x, y) or (ky,kz). | |
| using | Points |
| Container of Point. | |
| Static Public Member Functions inherited from msl::MaskBase< bool > | |
| static bool | lessX (Point const &p, Point const &q) |
| Compare points according to their x coordinate. | |
| static bool | lessKy (Point const &p, Point const &q) |
| Compare points according to their ky coordinate. | |
| static bool | lessY (Point const &p, Point const &q) |
| Compare points according to their y coordinate. | |
| static bool | lessKz (Point const &p, Point const &q) |
| Compare points according to their kz coordinate. | |
| Protected Member Functions inherited from msl::MaskBase< bool > | |
| std::size_t | _index (Point const &p) const |
| Return the linear index corresponding to a point. | |
| Protected Attributes inherited from msl::MaskBase< bool > | |
| Shape | _shape |
| Shape of the mask. | |
| std::vector< bool > | _mask |
| Linear container of mask points. | |