17#ifndef __data_type_h__
18#define __data_type_h__
57 bool is (uint8_t type)
const {
71#ifdef MRTRIX_BYTE_ORDER_BIG_ENDIAN
84 const uint8_t type =
dt &
Type;
88 const uint8_t type =
dt &
Type;
99#ifdef MRTRIX_BYTE_ORDER_BIG_ENDIAN
110 return (
bits() +7) /8;
122 template <
typename T>
126 dt.set_byte_order_native();
134 static constexpr uint8_t
Type = 0x0FU;
142 static constexpr uint8_t
Bit = 0x01U;
143 static constexpr uint8_t
UInt8 = 0x02U;
179#ifdef MRTRIX_BYTE_ORDER_BIG_ENDIAN
189 stream <<
dt.specifier();
200 template <>
inline DataType DataType::from<bool> ()
204 template <>
inline DataType DataType::from<int8_t> ()
208 template <>
inline DataType DataType::from<uint8_t> ()
212 template <>
inline DataType DataType::from<int16_t> ()
216 template <>
inline DataType DataType::from<uint16_t> ()
220 template <>
inline DataType DataType::from<int32_t> ()
224 template <>
inline DataType DataType::from<uint32_t> ()
228 template <>
inline DataType DataType::from<int64_t> ()
232 template <>
inline DataType DataType::from<uint64_t> ()
236 template <>
inline DataType DataType::from<float> ()
240 template <>
inline DataType DataType::from<double> ()
244 template <>
inline DataType DataType::from<cfloat> ()
248 template <>
inline DataType DataType::from<cdouble> ()
a class to hold a named list of Option's
static constexpr uint8_t Int16LE
bool is_floating_point() const
static constexpr uint8_t Float32
static constexpr uint8_t UInt64LE
static constexpr uint8_t UInt32BE
static constexpr uint8_t Float64LE
static constexpr uint8_t CFloat32BE
DataType(uint8_t type) noexcept
friend std::ostream & operator<<(std::ostream &stream, const DataType &dt)
static constexpr uint8_t LittleEndian
static constexpr uint8_t Int16
bool is_byte_order_native()
static constexpr uint8_t Int16BE
const char * description() const
bool operator!=(uint8_t type) const
static constexpr uint8_t CFloat64LE
static constexpr uint8_t Int32
static constexpr uint8_t Float32BE
static constexpr uint8_t BigEndian
static DataType parse(const std::string &spec)
static constexpr uint8_t CFloat32LE
static DataType native(DataType dt)
static constexpr uint8_t UInt16BE
bool operator==(uint8_t type) const
bool is_little_endian() const
static constexpr uint8_t UInt16LE
static constexpr uint8_t UInt64BE
static constexpr uint8_t Float64
static constexpr uint8_t UInt32
static constexpr uint8_t Native
static constexpr uint8_t Int64
static constexpr uint8_t UInt16
static constexpr uint8_t Complex
static constexpr uint8_t Int8
static constexpr uint8_t Signed
void set_floating_point()
static constexpr uint8_t Int64BE
void set_flag(uint8_t flag)
static constexpr uint8_t Int32BE
static DataType from_command_line(DataType default_datatype=Undefined)
static constexpr uint8_t CFloat64
static App::OptionGroup options()
DataType(const DataType &) noexcept=default
static constexpr uint8_t Int64LE
bool is_big_endian() const
static constexpr uint8_t Float32LE
static constexpr uint8_t Undefined
const char * specifier() const
void set_byte_order_native()
static constexpr uint8_t UInt32LE
static constexpr uint8_t CFloat32
static const char * identifiers[]
void unset_flag(uint8_t flag)
static constexpr uint8_t CFloat64BE
static constexpr uint8_t UInt64
bool is(uint8_t type) const
static constexpr uint8_t Int32LE
static constexpr uint8_t Float64BE
uint8_t operator()() const
static constexpr uint8_t Type
DataType(DataType &&) noexcept=default
static constexpr uint8_t UInt8
static constexpr uint8_t Bit
static constexpr uint8_t Attributes