msl 1.3.0
Loading...
Searching...
No Matches
msl::Mask Class Reference

Detailed Description

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.
 
Maskenable (Point const &p)
 Enable a point.
 
Maskdisable (Point const &p)
 Disable a point.
 
bool enabled (Point const &p) const
 Check whether the point is enabled.
 
Maskflip ()
 Switch the status of all points (enabled ↔ disabled)
 
Maskoperator|= (Mask const &right)
 In-place union of two masks.
 
Maskoperator&= (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.
 

Member Typedef Documentation

◆ Point

2D point, as (column, row), (x, y) or (ky,kz)

◆ Shape

Shape of the mask, as (column, row), (x, y) or (ky,kz)

◆ Points

using msl::Mask::Points = std::vector<Point>

Container of Point.

Constructor & Destructor Documentation

◆ Mask()

msl::Mask::Mask ( Shape const &  shape = {},
bool  value = true 
)

Create a constant mask.

Member Function Documentation

◆ lessX()

static bool msl::Mask::lessX ( Point const &  p,
Point const &  q 
)
inlinestatic

Compare points according to their x coordinate.

◆ lessKy()

static bool msl::Mask::lessKy ( Point const &  p,
Point const &  q 
)
inlinestatic

Compare points according to their ky coordinate.

◆ lessY()

static bool msl::Mask::lessY ( Point const &  p,
Point const &  q 
)
inlinestatic

Compare points according to their y coordinate.

◆ lessKz()

static bool msl::Mask::lessKz ( Point const &  p,
Point const &  q 
)
inlinestatic

Compare points according to their kz coordinate.

◆ size()

std::size_t msl::Mask::size ( ) const

Return the total number of points in the mask.

◆ shape()

Shape const & msl::Mask::shape ( ) const

Return the shape of the mask.

◆ count()

std::size_t msl::Mask::count ( ) const

Return the number of enabled points.

◆ enable()

Mask & msl::Mask::enable ( Point const &  p)

Enable a point.

◆ disable()

Mask & msl::Mask::disable ( Point const &  p)

Disable a point.

◆ enabled()

bool msl::Mask::enabled ( Point const &  p) const

Check whether the point is enabled.

◆ flip()

Mask & msl::Mask::flip ( )

Switch the status of all points (enabled ↔ disabled)

◆ operator|=()

Mask & msl::Mask::operator|= ( Mask const &  right)

In-place union of two masks.

◆ operator&=()

Mask & msl::Mask::operator&= ( Mask const &  right)

In-place intersection of two masks.

◆ enabledPoints()

Points msl::Mask::enabledPoints ( ) const

Return a vector of enabled points.


The documentation for this class was generated from the following file: