dip::ChainCode::Code class

Encodes a single chain code, as used by dip::ChainCode.

Chain codes are between 0 and 3 for connectivity = 1, and between 0 and 7 for connectivity = 2. 0 means to the right in both cases. The border flag marks pixels at the border of the image.

Constructors, destructors, assignment and conversion operators

Code() defaulted
Default constructor
Code(unsigned int code, bool border = false)
Constructor

Functions

auto IsBorder() const -> bool
Returns whether the border flag is set
auto IsEven() const -> bool
Is it an even code?
auto IsOdd() const -> bool
Is it an off code?
auto Delta8() const -> dip::VertexInteger const&
The change in coordinates for an 8-connected chain code
auto Delta4() const -> dip::VertexInteger const&
The change in coordinates for a 4-connected chain code

Operators

auto operator unsigned() const -> unsigned int
Returns the chain code
auto operator==(dip::ChainCode::Code const& c2) const -> bool
Compare codes
auto operator!=(dip::ChainCode::Code const& c2) const -> bool
Compare codes