Mir
Namespaces | Classes | Typedefs | Functions
mir::geometry Namespace Reference

Basic geometry types. Types for dimensions, displacements, etc. and the operations that they support. More...

Namespaces

namespace  detail
 

Classes

struct  Displacement
 
class  Length
 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...
 
struct  Point
 
struct  Rectangle
 
class  Rectangles
 A collection of rectangles (with possible duplicates). More...
 
struct  Size
 

Typedefs

typedef detail::IntWrapper< struct WidthTag > Width
 
typedef detail::IntWrapper< struct HeightTag > Height
 
typedef detail::IntWrapper< struct StrideTag > Stride
 
typedef detail::IntWrapper< struct XTag > X
 
typedef detail::IntWrapper< struct YTag > Y
 
typedef detail::IntWrapper< struct DeltaXTag > DeltaX
 
typedef detail::IntWrapper< struct DeltaYTag > DeltaY
 

Functions

constexpr DeltaX operator+ (DeltaX lhs, DeltaX rhs)
 
constexpr DeltaY operator+ (DeltaY lhs, DeltaY rhs)
 
constexpr DeltaX operator- (DeltaX lhs, DeltaX rhs)
 
constexpr DeltaY operator- (DeltaY lhs, DeltaY rhs)
 
DeltaXoperator+= (DeltaX &lhs, DeltaX rhs)
 
DeltaYoperator+= (DeltaY &lhs, DeltaY rhs)
 
DeltaXoperator-= (DeltaX &lhs, DeltaX rhs)
 
DeltaYoperator-= (DeltaY &lhs, DeltaY rhs)
 
constexpr X operator+ (X lhs, DeltaX rhs)
 
constexpr Y operator+ (Y lhs, DeltaY rhs)
 
constexpr X operator- (X lhs, DeltaX rhs)
 
constexpr Y operator- (Y lhs, DeltaY rhs)
 
Xoperator+= (X &lhs, DeltaX rhs)
 
Yoperator+= (Y &lhs, DeltaY rhs)
 
Xoperator-= (X &lhs, DeltaX rhs)
 
Yoperator-= (Y &lhs, DeltaY rhs)
 
constexpr Width operator+ (Width lhs, DeltaX rhs)
 
constexpr Height operator+ (Height lhs, DeltaY rhs)
 
constexpr Width operator- (Width lhs, DeltaX rhs)
 
constexpr Height operator- (Height lhs, DeltaY rhs)
 
Widthoperator+= (Width &lhs, DeltaX rhs)
 
Heightoperator+= (Height &lhs, DeltaY rhs)
 
Widthoperator-= (Width &lhs, DeltaX rhs)
 
Heightoperator-= (Height &lhs, DeltaY rhs)
 
constexpr Width operator+ (Width lhs, Width rhs)
 
constexpr Height operator+ (Height lhs, Height rhs)
 
Widthoperator+= (Width &lhs, Width rhs)
 
Heightoperator+= (Height &lhs, Height rhs)
 
constexpr DeltaX operator- (X lhs, X rhs)
 
constexpr DeltaY operator- (Y lhs, Y rhs)
 
constexpr DeltaX operator- (Width lhs, Width rhs)
 
constexpr DeltaY operator- (Height lhs, Height rhs)
 
template<typename Scalar >
constexpr Width operator* (Scalar scale, Width const &w)
 
template<typename Scalar >
constexpr Height operator* (Scalar scale, Height const &h)
 
template<typename Scalar >
constexpr DeltaX operator* (Scalar scale, DeltaX const &dx)
 
template<typename Scalar >
constexpr DeltaY operator* (Scalar scale, DeltaY const &dy)
 
template<typename Scalar >
constexpr Width operator* (Width const &w, Scalar scale)
 
template<typename Scalar >
constexpr Height operator* (Height const &h, Scalar scale)
 
template<typename Scalar >
constexpr DeltaX operator* (DeltaX const &dx, Scalar scale)
 
template<typename Scalar >
constexpr DeltaY operator* (DeltaY const &dy, Scalar scale)
 
template<typename Scalar >
constexpr Width operator/ (Width const &w, Scalar scale)
 
template<typename Scalar >
constexpr Height operator/ (Height const &h, Scalar scale)
 
template<typename Scalar >
constexpr DeltaX operator/ (DeltaX const &dx, Scalar scale)
 
template<typename Scalar >
constexpr DeltaY operator/ (DeltaY const &dy, Scalar scale)
 
constexpr Width as_width (DeltaX const &dx)
 
constexpr Height as_height (DeltaY const &dy)
 
constexpr X as_x (DeltaX const &dx)
 
constexpr Y as_y (DeltaY const &dy)
 
constexpr DeltaX as_delta (X const &x)
 
constexpr DeltaY as_delta (Y const &y)
 
constexpr X as_x (Width const &w)
 
constexpr Y as_y (Height const &h)
 
constexpr Width as_width (X const &x)
 
constexpr Height as_height (Y const &y)
 
constexpr DeltaX as_delta (Width const &w)
 
constexpr DeltaY as_delta (Height const &h)
 
template<typename Target , typename Source >
constexpr Target dim_cast (Source s)
 
constexpr bool operator== (Displacement const &lhs, Displacement const &rhs)
 
constexpr bool operator!= (Displacement const &lhs, Displacement const &rhs)
 
std::ostream & operator<< (std::ostream &out, Displacement const &value)
 
constexpr Displacement operator+ (Displacement const &lhs, Displacement const &rhs)
 
constexpr Displacement operator- (Displacement const &lhs, Displacement const &rhs)
 
constexpr Point operator+ (Point const &lhs, Displacement const &rhs)
 
constexpr Point operator+ (Displacement const &lhs, Point const &rhs)
 
constexpr Point operator- (Point const &lhs, Displacement const &rhs)
 
constexpr Displacement operator- (Point const &lhs, Point const &rhs)
 
constexpr Pointoperator+= (Point &lhs, Displacement const &rhs)
 
constexpr Pointoperator-= (Point &lhs, Displacement const &rhs)
 
bool operator< (Displacement const &lhs, Displacement const &rhs)
 
template<typename Scalar >
constexpr Displacement operator* (Scalar scale, Displacement const &disp)
 
template<typename Scalar >
constexpr Displacement operator* (Displacement const &disp, Scalar scale)
 
constexpr Displacement as_displacement (Size const &size)
 
constexpr Size as_size (Displacement const &disp)
 
constexpr Displacement as_displacement (Point const &point)
 
constexpr Point as_point (Displacement const &disp)
 
constexpr Length operator""_mm (long double mag)
 
constexpr Length operator""_mm (unsigned long long mag)
 
constexpr Length operator""_cm (long double mag)
 
constexpr Length operator""_cm (unsigned long long mag)
 
constexpr Length operator""_in (long double mag)
 
constexpr Length operator""_in (unsigned long long mag)
 
constexpr bool operator== (Point const &lhs, Point const &rhs)
 
constexpr bool operator!= (Point const &lhs, Point const &rhs)
 
constexpr Point operator+ (Point lhs, DeltaX rhs)
 
constexpr Point operator+ (Point lhs, DeltaY rhs)
 
constexpr Point operator- (Point lhs, DeltaX rhs)
 
constexpr Point operator- (Point lhs, DeltaY rhs)
 
Pointoperator+= (Point &lhs, DeltaX rhs)
 
Pointoperator+= (Point &lhs, DeltaY rhs)
 
Pointoperator-= (Point &lhs, DeltaX rhs)
 
Pointoperator-= (Point &lhs, DeltaY rhs)
 
std::ostream & operator<< (std::ostream &out, Point const &value)
 
constexpr bool operator== (Rectangle const &lhs, Rectangle const &rhs)
 
constexpr bool operator!= (Rectangle const &lhs, Rectangle const &rhs)
 
std::ostream & operator<< (std::ostream &out, Rectangle const &value)
 
std::ostream & operator<< (std::ostream &out, Rectangles const &value)
 
constexpr bool operator== (Size const &lhs, Size const &rhs)
 
constexpr bool operator!= (Size const &lhs, Size const &rhs)
 
std::ostream & operator<< (std::ostream &out, Size const &value)
 
template<typename Scalar >
constexpr Size operator* (Scalar scale, Size const &size)
 
template<typename Scalar >
constexpr Size operator* (Size const &size, Scalar scale)
 
template<typename Scalar >
constexpr Size operator/ (Size const &size, Scalar scale)
 
constexpr Size as_size (Point const &point)
 
constexpr Point as_point (Size const &size)
 

Detailed Description

Basic geometry types. Types for dimensions, displacements, etc. and the operations that they support.

Typedef Documentation

◆ DeltaX

typedef detail::IntWrapper<struct DeltaXTag> mir::geometry::DeltaX

◆ DeltaY

typedef detail::IntWrapper<struct DeltaYTag> mir::geometry::DeltaY

◆ Height

typedef detail::IntWrapper<struct HeightTag> mir::geometry::Height

◆ Stride

typedef detail::IntWrapper<struct StrideTag> mir::geometry::Stride

◆ Width

typedef detail::IntWrapper<struct WidthTag> mir::geometry::Width

◆ X

typedef detail::IntWrapper<struct XTag> mir::geometry::X

◆ Y

typedef detail::IntWrapper<struct YTag> mir::geometry::Y

Function Documentation

◆ as_delta() [1/4]

constexpr DeltaY mir::geometry::as_delta ( Height const &  h)
inlineconstexpr

◆ as_delta() [2/4]

constexpr DeltaX mir::geometry::as_delta ( Width const &  w)
inlineconstexpr

◆ as_delta() [3/4]

constexpr DeltaX mir::geometry::as_delta ( X const &  x)
inlineconstexpr

◆ as_delta() [4/4]

constexpr DeltaY mir::geometry::as_delta ( Y const &  y)
inlineconstexpr

◆ as_displacement() [1/2]

constexpr Displacement mir::geometry::as_displacement ( Point const &  point)
inlineconstexpr

◆ as_displacement() [2/2]

constexpr Displacement mir::geometry::as_displacement ( Size const &  size)
inlineconstexpr

◆ as_height() [1/2]

constexpr Height mir::geometry::as_height ( DeltaY const &  dy)
inlineconstexpr

◆ as_height() [2/2]

constexpr Height mir::geometry::as_height ( Y const &  y)
inlineconstexpr

◆ as_point() [1/2]

constexpr Point mir::geometry::as_point ( Displacement const &  disp)
inlineconstexpr

◆ as_point() [2/2]

constexpr Point mir::geometry::as_point ( Size const &  size)
inlineconstexpr

◆ as_size() [1/2]

constexpr Size mir::geometry::as_size ( Displacement const &  disp)
inlineconstexpr

◆ as_size() [2/2]

constexpr Size mir::geometry::as_size ( Point const &  point)
inlineconstexpr

◆ as_width() [1/2]

constexpr Width mir::geometry::as_width ( DeltaX const &  dx)
inlineconstexpr

◆ as_width() [2/2]

constexpr Width mir::geometry::as_width ( X const &  x)
inlineconstexpr

◆ as_x() [1/2]

constexpr X mir::geometry::as_x ( DeltaX const &  dx)
inlineconstexpr

◆ as_x() [2/2]

constexpr X mir::geometry::as_x ( Width const &  w)
inlineconstexpr

◆ as_y() [1/2]

constexpr Y mir::geometry::as_y ( DeltaY const &  dy)
inlineconstexpr

◆ as_y() [2/2]

constexpr Y mir::geometry::as_y ( Height const &  h)
inlineconstexpr

◆ dim_cast()

template<typename Target , typename Source >
constexpr Target mir::geometry::dim_cast ( Source  s)
inlineconstexpr

◆ operator!=() [1/4]

constexpr bool mir::geometry::operator!= ( Displacement const &  lhs,
Displacement const &  rhs 
)
inlineconstexpr

◆ operator!=() [2/4]

constexpr bool mir::geometry::operator!= ( Point const &  lhs,
Point const &  rhs 
)
inlineconstexpr

◆ operator!=() [3/4]

constexpr bool mir::geometry::operator!= ( Rectangle const &  lhs,
Rectangle const &  rhs 
)
inlineconstexpr

◆ operator!=() [4/4]

constexpr bool mir::geometry::operator!= ( Size const &  lhs,
Size const &  rhs 
)
inlineconstexpr

◆ operator""_cm() [1/2]

constexpr Length mir::geometry::operator""_cm ( long double  mag)
inlineconstexpr

◆ operator""_cm() [2/2]

constexpr Length mir::geometry::operator""_cm ( unsigned long long  mag)
inlineconstexpr

◆ operator""_in() [1/2]

constexpr Length mir::geometry::operator""_in ( long double  mag)
inlineconstexpr

◆ operator""_in() [2/2]

constexpr Length mir::geometry::operator""_in ( unsigned long long  mag)
inlineconstexpr

◆ operator""_mm() [1/2]

constexpr Length mir::geometry::operator""_mm ( long double  mag)
inlineconstexpr

◆ operator""_mm() [2/2]

constexpr Length mir::geometry::operator""_mm ( unsigned long long  mag)
inlineconstexpr

◆ operator*() [1/12]

template<typename Scalar >
constexpr DeltaX mir::geometry::operator* ( DeltaX const &  dx,
Scalar  scale 
)
inlineconstexpr

◆ operator*() [2/12]

template<typename Scalar >
constexpr DeltaY mir::geometry::operator* ( DeltaY const &  dy,
Scalar  scale 
)
inlineconstexpr

◆ operator*() [3/12]

template<typename Scalar >
constexpr Displacement mir::geometry::operator* ( Displacement const &  disp,
Scalar  scale 
)
inlineconstexpr

◆ operator*() [4/12]

template<typename Scalar >
constexpr Height mir::geometry::operator* ( Height const &  h,
Scalar  scale 
)
inlineconstexpr

◆ operator*() [5/12]

template<typename Scalar >
constexpr DeltaX mir::geometry::operator* ( Scalar  scale,
DeltaX const &  dx 
)
inlineconstexpr

◆ operator*() [6/12]

template<typename Scalar >
constexpr DeltaY mir::geometry::operator* ( Scalar  scale,
DeltaY const &  dy 
)
inlineconstexpr

◆ operator*() [7/12]

template<typename Scalar >
constexpr Displacement mir::geometry::operator* ( Scalar  scale,
Displacement const &  disp 
)
inlineconstexpr

◆ operator*() [8/12]

template<typename Scalar >
constexpr Height mir::geometry::operator* ( Scalar  scale,
Height const &  h 
)
inlineconstexpr

◆ operator*() [9/12]

template<typename Scalar >
constexpr Size mir::geometry::operator* ( Scalar  scale,
Size const &  size 
)
inlineconstexpr

◆ operator*() [10/12]

template<typename Scalar >
constexpr Width mir::geometry::operator* ( Scalar  scale,
Width const &  w 
)
inlineconstexpr

◆ operator*() [11/12]

template<typename Scalar >
constexpr Size mir::geometry::operator* ( Size const &  size,
Scalar  scale 
)
inlineconstexpr

◆ operator*() [12/12]

template<typename Scalar >
constexpr Width mir::geometry::operator* ( Width const &  w,
Scalar  scale 
)
inlineconstexpr

◆ operator+() [1/13]

constexpr DeltaX mir::geometry::operator+ ( DeltaX  lhs,
DeltaX  rhs 
)
inlineconstexpr

◆ operator+() [2/13]

constexpr DeltaY mir::geometry::operator+ ( DeltaY  lhs,
DeltaY  rhs 
)
inlineconstexpr

◆ operator+() [3/13]

constexpr Displacement mir::geometry::operator+ ( Displacement const &  lhs,
Displacement const &  rhs 
)
inlineconstexpr

◆ operator+() [4/13]

constexpr Point mir::geometry::operator+ ( Displacement const &  lhs,
Point const &  rhs 
)
inlineconstexpr

◆ operator+() [5/13]

constexpr Height mir::geometry::operator+ ( Height  lhs,
DeltaY  rhs 
)
inlineconstexpr

◆ operator+() [6/13]

constexpr Height mir::geometry::operator+ ( Height  lhs,
Height  rhs 
)
inlineconstexpr

◆ operator+() [7/13]

constexpr Point mir::geometry::operator+ ( Point const &  lhs,
Displacement const &  rhs 
)
inlineconstexpr

◆ operator+() [8/13]

constexpr Point mir::geometry::operator+ ( Point  lhs,
DeltaX  rhs 
)
inlineconstexpr

◆ operator+() [9/13]

constexpr Point mir::geometry::operator+ ( Point  lhs,
DeltaY  rhs 
)
inlineconstexpr

◆ operator+() [10/13]

constexpr Width mir::geometry::operator+ ( Width  lhs,
DeltaX  rhs 
)
inlineconstexpr

◆ operator+() [11/13]

constexpr Width mir::geometry::operator+ ( Width  lhs,
Width  rhs 
)
inlineconstexpr

◆ operator+() [12/13]

constexpr X mir::geometry::operator+ ( X  lhs,
DeltaX  rhs 
)
inlineconstexpr

◆ operator+() [13/13]

constexpr Y mir::geometry::operator+ ( Y  lhs,
DeltaY  rhs 
)
inlineconstexpr

◆ operator+=() [1/11]

DeltaX & mir::geometry::operator+= ( DeltaX lhs,
DeltaX  rhs 
)
inline

◆ operator+=() [2/11]

DeltaY & mir::geometry::operator+= ( DeltaY lhs,
DeltaY  rhs 
)
inline

◆ operator+=() [3/11]

Height & mir::geometry::operator+= ( Height lhs,
DeltaY  rhs 
)
inline

◆ operator+=() [4/11]

Height & mir::geometry::operator+= ( Height lhs,
Height  rhs 
)
inline

◆ operator+=() [5/11]

Point & mir::geometry::operator+= ( Point lhs,
DeltaX  rhs 
)
inline

◆ operator+=() [6/11]

Point & mir::geometry::operator+= ( Point lhs,
DeltaY  rhs 
)
inline

◆ operator+=() [7/11]

constexpr Point & mir::geometry::operator+= ( Point lhs,
Displacement const &  rhs 
)
inlineconstexpr

◆ operator+=() [8/11]

Width & mir::geometry::operator+= ( Width lhs,
DeltaX  rhs 
)
inline

◆ operator+=() [9/11]

Width & mir::geometry::operator+= ( Width lhs,
Width  rhs 
)
inline

◆ operator+=() [10/11]

X & mir::geometry::operator+= ( X lhs,
DeltaX  rhs 
)
inline

◆ operator+=() [11/11]

Y & mir::geometry::operator+= ( Y lhs,
DeltaY  rhs 
)
inline

◆ operator-() [1/15]

constexpr DeltaX mir::geometry::operator- ( DeltaX  lhs,
DeltaX  rhs 
)
inlineconstexpr

◆ operator-() [2/15]

constexpr DeltaY mir::geometry::operator- ( DeltaY  lhs,
DeltaY  rhs 
)
inlineconstexpr

◆ operator-() [3/15]

constexpr Displacement mir::geometry::operator- ( Displacement const &  lhs,
Displacement const &  rhs 
)
inlineconstexpr

◆ operator-() [4/15]

constexpr Height mir::geometry::operator- ( Height  lhs,
DeltaY  rhs 
)
inlineconstexpr

◆ operator-() [5/15]

constexpr DeltaY mir::geometry::operator- ( Height  lhs,
Height  rhs 
)
inlineconstexpr

◆ operator-() [6/15]

constexpr Point mir::geometry::operator- ( Point const &  lhs,
Displacement const &  rhs 
)
inlineconstexpr

◆ operator-() [7/15]

constexpr Displacement mir::geometry::operator- ( Point const &  lhs,
Point const &  rhs 
)
inlineconstexpr

◆ operator-() [8/15]

constexpr Point mir::geometry::operator- ( Point  lhs,
DeltaX  rhs 
)
inlineconstexpr

◆ operator-() [9/15]

constexpr Point mir::geometry::operator- ( Point  lhs,
DeltaY  rhs 
)
inlineconstexpr

◆ operator-() [10/15]

constexpr Width mir::geometry::operator- ( Width  lhs,
DeltaX  rhs 
)
inlineconstexpr

◆ operator-() [11/15]

constexpr DeltaX mir::geometry::operator- ( Width  lhs,
Width  rhs 
)
inlineconstexpr

◆ operator-() [12/15]

constexpr X mir::geometry::operator- ( X  lhs,
DeltaX  rhs 
)
inlineconstexpr

◆ operator-() [13/15]

constexpr DeltaX mir::geometry::operator- ( X  lhs,
X  rhs 
)
inlineconstexpr

◆ operator-() [14/15]

constexpr Y mir::geometry::operator- ( Y  lhs,
DeltaY  rhs 
)
inlineconstexpr

◆ operator-() [15/15]

constexpr DeltaY mir::geometry::operator- ( Y  lhs,
Y  rhs 
)
inlineconstexpr

◆ operator-=() [1/9]

DeltaX & mir::geometry::operator-= ( DeltaX lhs,
DeltaX  rhs 
)
inline

◆ operator-=() [2/9]

DeltaY & mir::geometry::operator-= ( DeltaY lhs,
DeltaY  rhs 
)
inline

◆ operator-=() [3/9]

Height & mir::geometry::operator-= ( Height lhs,
DeltaY  rhs 
)
inline

◆ operator-=() [4/9]

Point & mir::geometry::operator-= ( Point lhs,
DeltaX  rhs 
)
inline

◆ operator-=() [5/9]

Point & mir::geometry::operator-= ( Point lhs,
DeltaY  rhs 
)
inline

◆ operator-=() [6/9]

constexpr Point & mir::geometry::operator-= ( Point lhs,
Displacement const &  rhs 
)
inlineconstexpr

◆ operator-=() [7/9]

Width & mir::geometry::operator-= ( Width lhs,
DeltaX  rhs 
)
inline

◆ operator-=() [8/9]

X & mir::geometry::operator-= ( X lhs,
DeltaX  rhs 
)
inline

◆ operator-=() [9/9]

Y & mir::geometry::operator-= ( Y lhs,
DeltaY  rhs 
)
inline

◆ operator/() [1/5]

template<typename Scalar >
constexpr DeltaX mir::geometry::operator/ ( DeltaX const &  dx,
Scalar  scale 
)
inlineconstexpr

◆ operator/() [2/5]

template<typename Scalar >
constexpr DeltaY mir::geometry::operator/ ( DeltaY const &  dy,
Scalar  scale 
)
inlineconstexpr

◆ operator/() [3/5]

template<typename Scalar >
constexpr Height mir::geometry::operator/ ( Height const &  h,
Scalar  scale 
)
inlineconstexpr

◆ operator/() [4/5]

template<typename Scalar >
constexpr Size mir::geometry::operator/ ( Size const &  size,
Scalar  scale 
)
inlineconstexpr

◆ operator/() [5/5]

template<typename Scalar >
constexpr Width mir::geometry::operator/ ( Width const &  w,
Scalar  scale 
)
inlineconstexpr

◆ operator<()

bool mir::geometry::operator< ( Displacement const &  lhs,
Displacement const &  rhs 
)
inline

◆ operator<<() [1/5]

std::ostream & mir::geometry::operator<< ( std::ostream &  out,
Displacement const &  value 
)

◆ operator<<() [2/5]

std::ostream & mir::geometry::operator<< ( std::ostream &  out,
Point const &  value 
)

◆ operator<<() [3/5]

std::ostream & mir::geometry::operator<< ( std::ostream &  out,
Rectangle const &  value 
)

◆ operator<<() [4/5]

std::ostream & mir::geometry::operator<< ( std::ostream &  out,
Rectangles const &  value 
)

◆ operator<<() [5/5]

std::ostream & mir::geometry::operator<< ( std::ostream &  out,
Size const &  value 
)

◆ operator==() [1/4]

constexpr bool mir::geometry::operator== ( Displacement const &  lhs,
Displacement const &  rhs 
)
inlineconstexpr

◆ operator==() [2/4]

constexpr bool mir::geometry::operator== ( Point const &  lhs,
Point const &  rhs 
)
inlineconstexpr

◆ operator==() [3/4]

constexpr bool mir::geometry::operator== ( Rectangle const &  lhs,
Rectangle const &  rhs 
)
inlineconstexpr

◆ operator==() [4/4]

constexpr bool mir::geometry::operator== ( Size const &  lhs,
Size const &  rhs 
)
inlineconstexpr

Copyright © 2012-2022 Canonical Ltd.
Generated on Sun Oct 9 06:13:38 UTC 2022
This documentation is licensed under the GPL version 2 or 3.