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 Delta4() const -> dip::VertexInteger const&
The change in coordinates for a 4-connected chain code
auto Delta8() const -> dip::VertexInteger const&
The change in coordinates for an 8-connected chain code
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?

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

Function documentation

Code( ) defaulted

Default constructor

Code( unsigned int code, bool border = false)

Constructor

bool IsBorder( ) const

Returns whether the border flag is set

bool IsEven( ) const

Is it an even code?

bool IsOdd( ) const

Is it an off code?

dip::VertexInteger const& Delta8( ) const

The change in coordinates for an 8-connected chain code

dip::VertexInteger const& Delta4( ) const

The change in coordinates for a 4-connected chain code

unsigned int operator unsigned( ) const

Returns the chain code

bool operator==( dip::ChainCode::Code const& c2) const

Compare codes

bool operator!=( dip::ChainCode::Code const& c2) const

Compare codes