Mir
Public Types | Public Member Functions | List of all members
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]

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

◆ Length() [2/3]

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

◆ Length() [3/3]

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

Member Function Documentation

◆ as()

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

◆ as_pixels()

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

◆ operator!=()

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

◆ operator=()

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

◆ operator==()

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

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

Copyright © 2012-2021 Canonical Ltd.
Generated on Thu Jun 17 07:34:44 UTC 2021
This documentation is licensed under the GPL version 2 or 3.