|
msl 1.3.0
|
A two dimensional mask.
#include <Mask.h>
Public Types | |
| using | Point = Vector2l |
| 2D point, as (column, row), (x, y) or (ky,kz) | |
| using | Shape = Vector2l |
| Shape of the mask, as (column, row), (x, y) or (ky,kz) | |
| using | Points = std::vector< Point > |
| Container of Point. | |
Public Member Functions | |
| Mask (Shape const &shape={}, bool value=true) | |
| Create a constant mask. | |
| std::size_t | size () const |
| Return the total number of points in the mask. | |
| Shape const & | shape () const |
| Return the shape of the mask. | |
| 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. | |
Static Public Member Functions | |
| 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. | |
| using msl::Mask::Point = Vector2l |
2D point, as (column, row), (x, y) or (ky,kz)
| using msl::Mask::Shape = Vector2l |
Shape of the mask, as (column, row), (x, y) or (ky,kz)
| using msl::Mask::Points = std::vector<Point> |
Container of Point.
| msl::Mask::Mask | ( | Shape const & | shape = {}, |
| bool | value = true |
||
| ) |
Create a constant mask.
Compare points according to their x coordinate.
Compare points according to their ky coordinate.
Compare points according to their y coordinate.
Compare points according to their kz coordinate.
| std::size_t msl::Mask::size | ( | ) | const |
Return the total number of points in the mask.
| Shape const & msl::Mask::shape | ( | ) | const |
Return the shape of the mask.
| std::size_t msl::Mask::count | ( | ) | const |
Return the number of enabled points.
| bool msl::Mask::enabled | ( | Point const & | p | ) | const |
Check whether the point is enabled.
| Mask & msl::Mask::flip | ( | ) |
Switch the status of all points (enabled ↔ disabled)
| Points msl::Mask::enabledPoints | ( | ) | const |
Return a vector of enabled points.