19 #ifndef MIR_GEOMETRY_DIMENSIONS_H_ 20 #define MIR_GEOMETRY_DIMENSIONS_H_ 35 template<
typename Tag>
45 template<
typename AnyInteger>
50 return (uint32_t)value;
62 template<
typename Tag>
63 std::ostream& operator<<(std::ostream& out, IntWrapper<Tag>
const& value)
65 out << value.as_int();
69 template<
typename Tag>
75 template<
typename Tag>
81 template<
typename Tag>
82 inline constexpr
bool operator <= (IntWrapper<Tag>
const& lhs,
IntWrapper<Tag> const& rhs)
84 return lhs.
as_int() <= rhs.as_int();
87 template<
typename Tag>
93 template<
typename Tag>
94 inline constexpr
bool operator < (IntWrapper<Tag>
const& lhs,
IntWrapper<Tag> const& rhs)
96 return lhs.
as_int() < rhs.as_int();
99 template<
typename Tag>
147 template<
typename Scalar>
149 template<
typename Scalar>
151 template<
typename Scalar>
153 template<
typename Scalar>
155 template<
typename Scalar>
157 template<
typename Scalar>
159 template<
typename Scalar>
161 template<
typename Scalar>
164 template<
typename Target,
typename Source>
165 inline constexpr Target
dim_cast(Source s) {
return Target(s.as_int()); }
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: blob.h:26
int ValueType
Definition: dimensions.h:39
detail::IntWrapper< struct DeltaXTag > DeltaX
Definition: dimensions.h:113
detail::IntWrapper< struct YTag > Y
Definition: dimensions.h:112
detail::IntWrapper< struct WidthTag > Width
Definition: dimensions.h:106
constexpr DeltaX operator-(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:119
constexpr Target dim_cast(Source s)
Definition: dimensions.h:165
constexpr int as_int() const
Definition: dimensions.h:53
constexpr bool operator>(IntWrapper< Tag > const &lhs, IntWrapper< Tag > const &rhs)
Definition: dimensions.h:100
constexpr bool operator==(IntWrapper< Tag > const &lhs, IntWrapper< Tag > const &rhs)
Definition: dimensions.h:70
constexpr DeltaX operator+(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:117
constexpr Width operator*(Scalar scale, Width const &w)
Definition: dimensions.h:148
constexpr bool operator!=(IntWrapper< Tag > const &lhs, IntWrapper< Tag > const &rhs)
Definition: dimensions.h:76
constexpr IntWrapper(AnyInteger value)
Definition: dimensions.h:46
constexpr IntWrapper()
Definition: dimensions.h:41
X & operator-=(X &lhs, DeltaX rhs)
Definition: dimensions.h:129
detail::IntWrapper< struct StrideTag > Stride
Definition: dimensions.h:109
X & operator+=(X &lhs, DeltaX rhs)
Definition: dimensions.h:127
IntWrapper & operator=(IntWrapper const &that)=default
constexpr uint32_t as_uint32_t() const
Definition: dimensions.h:48
detail::IntWrapper< struct XTag > X
Definition: dimensions.h:111
Definition: dimensions.h:36
constexpr bool operator>=(IntWrapper< Tag > const &lhs, IntWrapper< Tag > const &rhs)
Definition: dimensions.h:88
detail::IntWrapper< struct HeightTag > Height
Definition: dimensions.h:107
detail::IntWrapper< struct DeltaYTag > DeltaY
Definition: dimensions.h:114