bin class
Type for samples in a binary image. Can store 0 or 1. Occupies 1 byte.
Contents
Constructors, destructors, assignment and conversion operators
Operators
- auto operator bool() const -> bool constexpr
- A bin implicitly converts to bool
- auto operator uint8&() -> dip::uint8& explicit
- Allow explicit casting to a reference to the underlying type (uint8&) for binary image operations
- auto operator!() const -> dip::bin constexpr
- Negation operator
-
template<typename T>auto operator!=(T other) const -> bool constexpr
- Inequality operator
- auto operator&(dip::bin other) const -> dip::bin constexpr
- And operator, prefer to use this over
std::min - auto operator&=(dip::bin other) -> dip::bin& constexpr
- And compound operator
-
template<typename T>auto operator==(T other) const -> bool constexpr
- Equality operator
- auto operator^(dip::bin other) const -> dip::bin constexpr
- Exclusive-or operator
- auto operator^=(dip::bin other) -> dip::bin& constexpr
- Exclusive-or compound operator
- auto operator|(dip::bin other) const -> dip::bin constexpr
- Or operator, prefer to use this over
std::max - auto operator|=(dip::bin other) -> dip::bin& constexpr
- Or compound operator
- auto operator~() const -> dip::bin constexpr
- Bit-wise negation is the same as regular negation
Function documentation
bin( ) defaulted constexpr
The default value is 0 (false)
bin( bool v) constexpr
A bool implicitly converts to bin
template<typename T, typename <SFINAE>>
bin(
T v) explicit constexpr
Any arithmetic type converts to bin by comparing to zero
bool operator bool( ) const constexpr
A bin implicitly converts to bool
dip::bin& operator&=( dip::bin other) constexpr
And compound operator
dip::bin& operator|=( dip::bin other) constexpr
Or compound operator
dip::bin& operator^=( dip::bin other) constexpr
Exclusive-or compound operator
template<typename T>
bool
operator==(
T other) const constexpr
Equality operator
template<typename T>
bool
operator!=(
T other) const constexpr
Inequality operator
dip::uint8& operator uint8&( ) explicit
Allow explicit casting to a reference to the underlying type (uint8&) for binary image operations
std::ostream&
dip:: operator<<(
std::ostream& os, dip::bin const& v)
Writes the value as a bool to a stream.