19 #ifndef MIR_GEOMETRY_DISPLACEMENT_H_
20 #define MIR_GEOMETRY_DISPLACEMENT_H_
39 template<
typename DeltaXType,
typename DeltaYType>
54 return lhs.
dx == rhs.
dx && lhs.
dy == rhs.
dy;
59 return lhs.
dx != rhs.
dx || lhs.
dy != rhs.
dy;
101 return lhs = lhs + rhs;
106 return lhs = lhs - rhs;
114 template<
typename Scalar>
120 template<
typename Scalar>
constexpr int as_int() const
Definition: dimensions.h:53
bool operator<(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:109
constexpr Displacement as_displacement(Size const &size)
Definition: displacement.h:126
DeltaX & operator+=(DeltaX &lhs, DeltaX rhs)
Definition: dimensions.h:123
std::ostream & operator<<(std::ostream &out, Displacement const &value)
constexpr Width operator*(Scalar scale, Width const &w)
Definition: dimensions.h:164
constexpr Point as_point(Displacement const &disp)
Definition: displacement.h:141
constexpr bool operator==(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:52
DeltaX & operator-=(DeltaX &lhs, DeltaX rhs)
Definition: dimensions.h:125
constexpr DeltaX operator+(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:117
constexpr DeltaX operator-(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:119
constexpr bool operator!=(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:57
constexpr Size as_size(Displacement const &disp)
Definition: displacement.h:131
Definition: splash_session.h:24
Definition: displacement.h:34
constexpr Displacement(DeltaXType &&dx, DeltaYType &&dy)
Definition: displacement.h:40
constexpr Displacement()
Definition: displacement.h:35
Displacement & operator=(Displacement const &)=default
constexpr Displacement(Displacement const &)=default
long long length_squared() const
Definition: displacement.h:42
DeltaX dx
Definition: displacement.h:48
DeltaY dy
Definition: displacement.h:49
Y y
Definition: point.h:40
X x
Definition: point.h:39
Width width
Definition: size.h:40
Height height
Definition: size.h:41