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 Displacement as_displacement(Size
const&
size)
113 return Displacement{size.width.as_int(), size.height.as_int()};
116 inline Size as_size(Displacement
const& disp)
118 return Size{disp.
dx.
as_int(), disp.dy.as_int()};
All things Mir.
Definition: atomic_callback.h:25
DeltaY dy
Definition: displacement.h:48
X x
Definition: point.h:39
Width operator*(Scalar scale, Width const &w)
Definition: dimensions.h:148
DeltaX operator-(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:119
DeltaX dx
Definition: displacement.h:47
Y y
Definition: point.h:40
bool operator!=(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:56
bool operator==(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:51
Displacement(DeltaXType &&dx, DeltaYType &&dy)
Definition: displacement.h:39
std::ostream & operator<<(std::ostream &out, Displacement const &value)
Definition: ostream.cpp:28
Definition: displacement.h:32
Displacement & operator=(Displacement const &)=default
bool operator<(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:93
Displacement()
Definition: displacement.h:34
int const size
Definition: make_socket_rpc_channel.cpp:51
DeltaX operator+(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:117
long long length_squared() const
Definition: displacement.h:41
int as_int() const
Definition: dimensions.h:49