Mir
Loading...
Searching...
No Matches
mir::geometry::Length Class Reference

Length represents a physical length in the real world. The number of pixels this equates to can then be calculated based on a given DPI. More...

#include <length.h>

Public Types

enum  Units { micrometres = 1 , millimetres = 1000 , centimetres = 10000 , inches = 25400 }

Public Member Functions

constexpr Length ()
constexpr Length (Length const &)=default
constexpr Length (float mag, Units units)
Lengthoperator= (Length const &)=default
constexpr float as (Units units) const
constexpr float as_pixels (float dpi) const
constexpr bool operator== (Length const &rhs) const
constexpr bool operator!= (Length const &rhs) const

Detailed Description

Length represents a physical length in the real world. The number of pixels this equates to can then be calculated based on a given DPI.

Member Enumeration Documentation

◆ Units

Enumerator
micrometres 
millimetres 
centimetres 
inches 

Constructor & Destructor Documentation

◆ Length() [1/3]

mir::geometry::Length::Length ( )
inlineconstexpr

◆ Length() [2/3]

mir::geometry::Length::Length ( Length const & )
constexprdefault

◆ Length() [3/3]

mir::geometry::Length::Length ( float mag,
Units units )
inlineconstexpr

Member Function Documentation

◆ as()

float mir::geometry::Length::as ( Units units) const
inlineconstexpr

◆ as_pixels()

float mir::geometry::Length::as_pixels ( float dpi) const
inlineconstexpr

◆ operator!=()

bool mir::geometry::Length::operator!= ( Length const & rhs) const
inlineconstexpr

◆ operator=()

Length & mir::geometry::Length::operator= ( Length const & )
default

◆ operator==()

bool mir::geometry::Length::operator== ( Length const & rhs) const
inlineconstexpr

The documentation for this class was generated from the following file:

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.