19 #ifndef MIR_GEOMETRY_DISPLACEMENT_H_ 20 #define MIR_GEOMETRY_DISPLACEMENT_H_ 38 template<
typename DeltaXType,
typename DeltaYType>
53 return lhs.
dx == rhs.
dx && lhs.
dy == rhs.
dy;
58 return lhs.
dx != rhs.
dx || lhs.
dy != rhs.
dy;
61 std::ostream&
operator<<(std::ostream& out, Displacement
const& value);
98 template<
typename Scalar>
104 template<
typename Scalar>
110 #ifdef MIR_GEOMETRY_SIZE_H_ 111 inline constexpr Displacement as_displacement(Size
const& size)
113 return Displacement{size.width.as_int(), size.height.as_int()};
116 inline constexpr Size as_size(Displacement
const& disp)
118 return Size{disp.
dx.
as_int(), disp.dy.as_int()};
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: blob.h:26
DeltaY dy
Definition: displacement.h:48
X x
Definition: point.h:39
DeltaX dx
Definition: displacement.h:47
constexpr DeltaX operator-(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:119
Y y
Definition: point.h:40
long long length_squared() const
Definition: displacement.h:41
constexpr Displacement(DeltaXType &&dx, DeltaYType &&dy)
Definition: displacement.h:39
constexpr int as_int() const
Definition: dimensions.h:53
constexpr DeltaX operator+(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:117
constexpr Width operator*(Scalar scale, Width const &w)
Definition: dimensions.h:148
Definition: displacement.h:32
Displacement & operator=(Displacement const &)=default
constexpr Displacement()
Definition: displacement.h:34
std::ostream & operator<<(std::ostream &out, Displacement const &value)
bool operator<(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:93
constexpr bool operator==(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:51
constexpr bool operator!=(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:56