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);
93 template<
typename Scalar>
99 template<
typename Scalar>
105 #ifdef MIR_GEOMETRY_SIZE_H_
106 inline Displacement as_displacement(Size
const&
size)
108 return Displacement{size.width.as_int(), size.height.as_int()};
111 inline Size as_size(Displacement
const& disp)
113 return Size{disp.
dx.
as_int(), disp.dy.as_int()};
All things Mir.
Definition: buffer_stream.h:37
DeltaY dy
Definition: displacement.h:48
X x
Definition: point.h:39
Width operator*(Scalar scale, Width const &w)
Definition: dimensions.h:136
DeltaX operator-(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:121
DeltaX dx
Definition: displacement.h:47
Definition: dimensions.h:35
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
Definition: dimensions.h:35
std::ostream & operator<<(std::ostream &out, Displacement const &value)
Definition: ostream.cpp:29
Definition: displacement.h:32
Displacement & operator=(Displacement const &)=default
bool operator<(Displacement const &lhs, Displacement const &rhs)
Definition: displacement.h:88
Displacement()
Definition: displacement.h:34
int const size
Definition: make_socket_rpc_channel.cpp:51
DeltaX operator+(DeltaX lhs, DeltaX rhs)
Definition: dimensions.h:119
long long length_squared() const
Definition: displacement.h:41
int as_int() const
Definition: dimensions.h:51