|
ITK
6.0.0
Insight Toolkit
|
Go to the documentation of this file.
18 #ifndef itkFixedArray_h
19 #define itkFixedArray_h
52 template <
typename TValue,
unsigned int VLength = 3>
57 static constexpr
unsigned int Length = VLength;
63 using ValueType = TValue;
74 class ConstReverseIterator;
208 explicit FixedArray(
const std::array<ValueType, VLength> & stdArray)
210 std::copy_n(stdArray.cbegin(), VLength, m_InternalArray);
214 template <
typename TFixedArrayValueType>
219 for (
auto & element : m_InternalArray)
221 element = static_cast<TValue>(*input++);
225 template <
typename TScalarValue>
228 std::copy_n(r, VLength, m_InternalArray);
237 template <
typename TFixedArrayValueType>
243 for (
auto & element : m_InternalArray)
245 element = static_cast<TValue>(*input++);
251 operator=(
const ValueType r[VLength]);
259 ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(
FixedArray);
266 ITK_GCC_SUPPRESS_Warray_bounds
276 m_InternalArray[index] = value;
281 return m_InternalArray[index];
289 return m_InternalArray;
295 return m_InternalArray;
301 return m_InternalArray;
307 return m_InternalArray;
327 itkLegacyMacro(ReverseIterator rBegin();)
330 itkLegacyMacro(ConstReverseIterator rBegin()
const;)
333 itkLegacyMacro(ReverseIterator rEnd();)
336 itkLegacyMacro(ConstReverseIterator rEnd()
const;)
338 constexpr const_iterator
341 return m_InternalArray;
347 return m_InternalArray;
350 constexpr const_iterator
353 return this->cbegin();
356 constexpr const_iterator
359 return m_InternalArray + VLength;
365 return m_InternalArray + VLength;
368 constexpr const_iterator
380 const_reverse_iterator
386 const_reverse_iterator
389 return this->crbegin();
398 const_reverse_iterator
404 const_reverse_iterator
407 return this->crend();
422 Fill(
const ValueType &);
439 return MakeFilled<FixedArray>(value);
444 template <
typename TValue,
unsigned int VLength>
446 operator<<(std::ostream & os,
const FixedArray<TValue, VLength> & arr);
449 template <
typename TValue,
unsigned int VLength>
458 #ifndef ITK_MANUAL_INSTANTIATION
459 # include "itkFixedArray.hxx"
const_reverse_iterator rend() const
constexpr const_iterator cbegin() const noexcept
FixedArray(const TScalarValue *r)
Represent a n-dimensional size (bounds) of a n-dimensional image.
ValueType[VLength] CArray
const ValueType * data() const
ReverseIterator operator--(int)
constexpr SizeType size() const
const ValueType & const_reference
constexpr const_iterator begin() const noexcept
A const reverse iterator through an array.
FixedArray(const FixedArray< TFixedArrayValueType, VLength > &r)
ConstReverseIterator operator++(int)
A reverse iterator through an array.
ITK_GCC_PRAGMA_POP void SetElement(unsigned int index, const_reference value)
ImageBaseType::SizeType SizeType
ConstReverseIterator(const ReverseIterator &rit)
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
const_reference GetElement(unsigned int index) const
constexpr iterator end() noexcept
FixedArray & operator=(const FixedArray< TFixedArrayValueType, VLength > &r)
constexpr const_reference operator[](unsigned int index) const
ValueType * GetDataPointer()
ReverseIterator(Iterator i)
const ValueType * ConstIterator
ConstReverseIterator operator--(int)
ConstReverseIterator(ConstIterator i)
const ValueType * GetDataPointer() const
ReverseIterator operator--()
ConstIterator operator->() const
ReverseIterator operator++(int)
const ValueType * const_pointer
constexpr const_iterator cend() const noexcept
ReverseIterator operator++()
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
ConstReverseIterator operator--()
Simulate a standard C array with copy semantics.
ValueType & operator*() const
std::reverse_iterator< iterator > reverse_iterator
void swap(FixedArray< TValue, VLength > &a, FixedArray< TValue, VLength > &b)
constexpr const_iterator end() const noexcept
void swap(Array< T > &a, Array< T > &b) noexcept
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
const_reverse_iterator crbegin() const
ConstReverseIterator operator++()
reverse_iterator rbegin()
Iterator operator->() const
constexpr iterator begin() noexcept
void swap(FixedArray &other)
ITK_GCC_PRAGMA_PUSH constexpr ITK_GCC_SUPPRESS_Warray_bounds reference operator[](unsigned int index)
const ValueType & operator*() const
static constexpr FixedArray Filled(const ValueType &value)
bool operator==(const ReverseIterator &rit) const
bool operator==(const ConstReverseIterator &rit) const
const ValueType * const_iterator
constexpr unsigned int Dimension
const_reverse_iterator crend() const
const_reverse_iterator rbegin() const
std::reverse_iterator< const_iterator > const_reverse_iterator
FixedArray(const std::array< ValueType, VLength > &stdArray)