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)
Length represents a physical length in the real world. The number of pixels this equates to can then ...
Definition: length.h:30
constexpr Length()
Definition: length.h:40
constexpr bool operator==(Length const &rhs) const
Definition: length.h:55
Units
Definition: length.h:33
@ inches
Definition: length.h:37
@ centimetres
Definition: length.h:36
@ micrometres
Definition: length.h:34
@ millimetres
Definition: length.h:35
constexpr bool operator!=(Length const &rhs) const
Definition: length.h:60
constexpr Length(float mag, Units units)
Definition: length.h:42
Length & operator=(Length const &)=default
constexpr float as_pixels(float dpi) const
Definition: length.h:50
constexpr Length(Length const &)=default
constexpr float as(Units units) const
Definition: length.h:45
Definition: splash_session.h:24