31 #if defined(Labels_RECURSES)
32 #error Recursive header files inclusion detected in Labels.h
33 #else // defined(Labels_RECURSES)
35 #define Labels_RECURSES
45 #include "DGtal/base/Common.h"
46 #include "DGtal/kernel/CUnsignedNumber.h"
47 #include "DGtal/kernel/CIntegralNumber.h"
70 template <
unsigned int L,
typename TWord = DGtal::u
int8_t>
83 #define __DGTAL_WORD_NBDIGITS ( sizeof( Word ) * 8 )
84 #define __DGTAL_LABELS_NBWORDS ( (L-1) / __DGTAL_WORD_NBDIGITS + 1 )
85 #define __DGTAL_LABEL_WORD_INDEX( label ) ( label / __DGTAL_WORD_NBDIGITS )
86 #define __DGTAL_LABEL_DIGIT_INDEX( label ) ( label % __DGTAL_WORD_NBDIGITS )
334 template <
unsigned int L,
typename TWord>
343 #include "DGtal/base/Labels.ih"
348 #endif // !defined Labels_h
350 #undef Labels_RECURSES
351 #endif // else defined(Labels_RECURSES)
ConstEnumerator(const Word *address, SizeType firstWord)
Aim: Concept checking for Unsigned numbers. Models of this concept should be listed in NumberTraits c...
SizeType index(Label l) const
BOOST_STATIC_ASSERT((L >=1))
Pointer operator->() const
Word myWord
current word (modified until 0).
ConstIterator begin() const
static SizeType _word(Label l)
Returns the word in which is the label l.
Self & set(Label l, bool val=true)
BOOST_CONCEPT_ASSERT((concepts::CUnsignedNumber< TWord >))
DGtal is the top-level namespace which contains all DGtal functions and types.
void getLabels(std::vector< Label > &labels) const
static Word _mask(Label l)
Returns the mask for the label l (1 << _digit( l )).
ConstEnumerator ConstIterator
Label myWordLabel
index of first label of the current word.
Word myLabels[__DGTAL_LABELS_NBWORDS]
Stores the labels as bits. The bit of index l is set if l is in the set.
ConstIterator end() const
const Word * myWordAddress
current address of word
static SizeType _digit(Label l)
Returns the bit at which is the label l.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
std::ptrdiff_t DifferenceType
only positive offsets allowed.
bool operator!=(const Self &other) const
Self & operator=(const Self &other)
BOOST_CONCEPT_ASSERT((concepts::CIntegralNumber< TWord >))
Self & operator=(const Self &other)
bool operator==(const Self &other) const
Labels(const Self &other)
ConstIterator const_iterator
Aim: Concept checking for Integral Numbers. Models of this concept should be listed in NumberTraits c...
Label myLabel
current label
DifferenceType difference_type
ConstEnumerator(const ConstEnumerator &other)
void selfDisplay(std::ostream &out) const
Reference operator*() const
Aim: Stores a set of labels in {O..L-1} as a sequence of bits.
std::forward_iterator_tag iterator_category