21 #ifndef otbArrayTraits_h
22 #define otbArrayTraits_h
24 #include "itkDefaultConvertPixelTraits.h"
25 #include "itkVariableLengthVector.h"
26 #include "itkFixedArray.h"
46 template <
typename T,
unsigned int N>
47 constexpr std::true_type
is_array_f(itk::FixedArray<T, N>
const*);
52 template <
typename... T>
55 static_assert(decltype(
internals::is_array_f(std::declval<itk::FixedArray<int, 1>*>()))::value,
"it::FixedArray should be matched");
77 : decltype(internals::is_array_f(std::declval<T*>()))
92 template <
typename TExpr1,
typename TExpr2,
typename TBinaryOp>
93 struct is_array<
itk::VariableLengthVectorExpression<TExpr1, TExpr2,TBinaryOp>>
113 template <
typename T>
119 static_assert(
is_array_v<itk::FixedArray<double, 42>>,
"");
120 static_assert(
is_array_v<itk::FixedArray<std::complex<double>, 42>>,
"");
121 static_assert(
is_array_v<itk::VariableLengthVector<double>>,
"");
122 static_assert(
is_array_v<itk::VariableLengthVector<std::complex<double>>>,
"");
144 template <
typename PixelType>
147 static unsigned int For(PixelType
const& pix)
157 template <
typename RealType>
164 static unsigned int For(itk::VariableLengthVector<RealType>
const& pix)
166 return pix.GetSize();
174 template <
typename T>
177 static constexpr
unsigned int For(std::complex<T>
const&) noexcept
187 template <
typename T>
190 static unsigned int For(T
const& pix)
213 template <
typename PixelType>
223 #endif // otbArrayTraits_h