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;
69inline constexpr Length operator"" _mm(
long double mag)
74inline constexpr Length operator"" _mm(
unsigned long long mag)
79inline constexpr Length operator"" _cm(
long double mag)
84inline constexpr Length operator"" _cm(
unsigned long long mag)
89inline constexpr Length operator"" _in(
long double mag)
94inline 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
Length & operator=(Length const &)=default
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
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
Basic geometry types. Types for dimensions, displacements, etc. and the operations that they support.
Definition dimensions.h:31
Definition splash_session.h:24
Copyright © 2012-2026
Canonical Ltd.
Generated on Sun Mar 15 06:10:58 UTC 2026
This documentation is licensed under the GPL version 2 or 3.