Go to the documentation of this file.
19 #ifndef MIR_GEOMETRY_LENGTH_H_
20 #define MIR_GEOMETRY_LENGTH_H_
42 constexpr
Length(
float mag,
Units units) : magnitude(mag * units) {}
47 return static_cast<float>(magnitude) / units;
57 return magnitude == rhs.magnitude;
62 return magnitude != rhs.magnitude;
69 inline constexpr
Length operator"" _mm(
long double mag)
74 inline constexpr
Length operator"" _mm(
unsigned long long mag)
79 inline constexpr
Length operator"" _cm(
long double mag)
84 inline constexpr
Length operator"" _cm(
unsigned long long mag)
89 inline constexpr
Length operator"" _in(
long double mag)
94 inline constexpr
Length operator"" _in(
unsigned long long mag)
102 #endif // MIR_GEOMETRY_LENGTH_H_
constexpr Length()
Definition: length.h:40
constexpr bool operator==(Length const &rhs) const
Definition: length.h:55
constexpr float as_pixels(float dpi) const
Definition: length.h:50
constexpr bool operator!=(Length const &rhs) const
Definition: length.h:60
Length & operator=(Length const &)=default
Units
Definition: length.h:32
Definition: splash_session.h:24
constexpr Length(float mag, Units units)
Definition: length.h:42
Length represents a physical length in the real world. The number of pixels this equates to can then ...
Definition: length.h:29
constexpr float as(Units units) const
Definition: length.h:45
Copyright © 2012-2019
Canonical Ltd.
Generated on Fri Dec 6 02:23:43 UTC 2019
This documentation is licensed under the GPL version 2 or 3.