Pixel data types module
#include "diplib.h"
dip::bin class

Type for samples in a binary image. Can store 0 or 1. Occupies 1 byte.

Constructors, destructors, assignment and conversion operators

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


auto operator bool() const -> bool constexpr
A bin implicitly converts to bool
auto operator!() const -> dip::bin constexpr
Negation operator
auto operator~() const -> dip::bin constexpr
Bit-wise negation is the same as regular negation
auto operator&(dip::bin other) const -> dip::bin constexpr
And operator, prefer to use this over std::min
auto operator|(dip::bin other) const -> dip::bin constexpr
Or operator, prefer to use this over std::max
auto operator^(dip::bin other) const -> dip::bin constexpr
Exclusive-or operator
auto operator&=(dip::bin other) -> dip::bin& constexpr
And compound operator
auto operator|=(dip::bin other) -> dip::bin& constexpr
Or compound operator
auto operator^=(dip::bin other) -> dip::bin& constexpr
Exclusive-or compound operator
template<typename T>
auto operator==(T other) const -> bool constexpr
Equality operator
template<typename T>
auto operator!=(T other) const -> bool constexpr
Inequality operator
auto operator uint8&() -> dip::uint8& explicit
Allow explicit casting to a reference to the underlying type (uint8&) for binary image operations