gigawidgets 0.3.55
A wxWidgets-style UI library for the Arduino Giga Display Shield.
 
Loading...
Searching...
No Matches
units.hpp File Reference

Go to the source code of this file.

Functions

constexpr uint16_t operator""_px (long double pixels)
 The custom units operator for pixels.
 
constexpr uint16_t operator""_px (unsigned long long pixels)
 The custom units operator for pixels.
 
constexpr uint16_t operator""_mm (long double millimeters)
 The custom units operator for millimeters.
 
constexpr uint16_t operator""_mm (unsigned long long millimeters)
 The custom units operator for millimeters.
 
constexpr uint16_t operator""_cm (long double centimeters)
 The custom units operator for centimeters.
 
constexpr uint16_t operator""_cm (unsigned long long centimeters)
 The custom units operator for centimeters.
 
constexpr uint16_t operator""_in (long double inches)
 The custom units operator for inches.
 
constexpr uint16_t operator""_in (unsigned long long inches)
 The custom units operator for inches.
 
uint16_t operator""_vw (long double view_width_percent)
 The custom units operator for view width percent.
 
uint16_t operator""_vw (unsigned long long view_width_percent)
 The custom units operator for view width percent.
 
uint16_t operator""_vh (long double view_height_percent)
 The custom units operator for view height percent.
 
uint16_t operator""_vh (unsigned long long view_height_percent)
 The custom units operator for view height percent.
 
constexpr uint16_t operator""_pt (long double points)
 The custom units operator for points.
 
constexpr uint16_t operator""_pt (unsigned long long points)
 The custom units operator for points.
 
constexpr long double operator""_deg (long double degrees)
 The custom units operator for degrees.
 
constexpr long double operator""_deg (unsigned long long degrees)
 The custom units operator for degrees.
 
constexpr long double operator""_rad (long double radians)
 The custom units operator for radians.
 
constexpr long double operator""_rad (unsigned long long radians)
 The custom units operator for radians.
 
constexpr unsigned long operator""_ms (unsigned long long time)
 The custom units operator for milliseconds.
 
constexpr unsigned long operator""_sec (unsigned long long time)
 The custom units operator for seconds.
 
constexpr unsigned long operator""_sec (long double time)
 The custom units operator for seconds.
 
constexpr unsigned long operator""_min (unsigned long long time)
 The custom units operator for minutes.
 
constexpr unsigned long operator""_min (long double time)
 The custom units operator for minutes.
 
constexpr unsigned long operator""_hr (unsigned long long time)
 The custom units operator for hours.
 
constexpr unsigned long operator""_hr (long double time)
 The custom units operator for hours.
 

Function Documentation

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

constexpr uint16_t operator""_cm ( long double  centimeters)
constexpr

The custom units operator for centimeters.

This operator allows for writing sizes like 2.5_cm, which will automatically be converted to pixels at compile time.

Parameters
centimetersThe size in centimeters.
Returns
The size in pixels.

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

constexpr uint16_t operator""_cm ( unsigned long long  centimeters)
constexpr

The custom units operator for centimeters.

This operator allows for writing sizes like 2_cm, which will automatically be converted to pixels at compile time.

Parameters
centimetersThe size in centimeters.
Returns
The size in pixels.

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

constexpr long double operator""_deg ( long double  degrees)
constexpr

The custom units operator for degrees.

This operator allows for writing angles like 90_deg, which will automatically be converted to radians at compile time.

Parameters
degreesThe angle in degrees.
Returns
The angle in radians.

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

constexpr long double operator""_deg ( unsigned long long  degrees)
constexpr

The custom units operator for degrees.

This operator allows for writing angles like 90_deg, which will automatically be converted to radians at compile time.

Parameters
degreesThe angle in degrees.
Returns
The angle in radians.

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

constexpr unsigned long operator""_hr ( long double  time)
constexpr

The custom units operator for hours.

This operator allows for writing time spans like 5_hr, which will automatically be converted to milliseconds at compile time.

Parameters
timeThe time in hours.
Returns
The time in milliseconds.

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

constexpr unsigned long operator""_hr ( unsigned long long  time)
constexpr

The custom units operator for hours.

This operator allows for writing time spans like 5_hr, which will automatically be converted to milliseconds at compile time.

Parameters
timeThe time in hours.
Returns
The time in milliseconds.

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

constexpr uint16_t operator""_in ( long double  inches)
constexpr

The custom units operator for inches.

This operator allows for writing sizes like 0.5_in, which will automatically be converted to pixels at compile time.

Parameters
inchesThe size in inches.
Returns
The size in pixels.

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

constexpr uint16_t operator""_in ( unsigned long long  inches)
constexpr

The custom units operator for inches.

This operator allows for writing sizes like 1_in, which will automatically be converted to pixels at compile time.

Parameters
inchesThe size in inches.
Returns
The size in pixels.

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

constexpr unsigned long operator""_min ( long double  time)
constexpr

The custom units operator for minutes.

This operator allows for writing time spans like 5_min, which will automatically be converted to milliseconds at compile time.

Parameters
timeThe time in minutes.
Returns
The time in milliseconds.

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

constexpr unsigned long operator""_min ( unsigned long long  time)
constexpr

The custom units operator for minutes.

This operator allows for writing time spans like 5_min, which will automatically be converted to milliseconds at compile time.

Parameters
timeThe time in minutes.
Returns
The time in milliseconds.

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

constexpr uint16_t operator""_mm ( long double  millimeters)
constexpr

The custom units operator for millimeters.

This operator allows for writing sizes like 2.5_mm, which will automatically be converted to pixels at compile time.

Parameters
millimetersThe size in millimeters.
Returns
The size in pixels.

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

constexpr uint16_t operator""_mm ( unsigned long long  millimeters)
constexpr

The custom units operator for millimeters.

This operator allows for writing sizes like 25_mm, which will automatically be converted to pixels at compile time.

Parameters
millimetersThe size in millimeters.
Returns
The size in pixels.

◆ operator""_ms()

constexpr unsigned long operator""_ms ( unsigned long long  time)
constexpr

The custom units operator for milliseconds.

This operator is included for consistency, to allow for writing time spans like 1_ms instead of just 1. In reality, no transformation is applied.

Parameters
timeThe time in milliseconds.
Returns
The time in milliseconds.

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

constexpr uint16_t operator""_pt ( long double  points)
constexpr

The custom units operator for points.

This operator allows for writing sizes like 12.5_pt, which will automatically be converted to pixels at compile time.

Parameters
pointsThe size in points.
Returns
The size in pixels.

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

constexpr uint16_t operator""_pt ( unsigned long long  points)
constexpr

The custom units operator for points.

This operator allows for writing sizes like 12_pt, which will automatically be converted to pixels at compile time.

Parameters
pointsThe size in points.
Returns
The size in pixels.

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

constexpr uint16_t operator""_px ( long double  pixels)
constexpr

The custom units operator for pixels.

This operator is included for consistency, to allow for writing sizes like 25.0_px instead of just 25. In reality, no transformation is applied.

Parameters
pixelsThe size in pixels.
Returns
The size in pixels.

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

constexpr uint16_t operator""_px ( unsigned long long  pixels)
constexpr

The custom units operator for pixels.

This operator is included for consistency, to allow for writing sizes like 25_px instead of just 25. In reality, no transformation is applied.

Parameters
pixelsThe size in pixels.
Returns
The size in pixels.

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

constexpr long double operator""_rad ( long double  radians)
constexpr

The custom units operator for radians.

This operator is included for consistency, to allow for writing sizes like 1_rad instead of just 1.f. In reality, no transformation is applied.

Parameters
radiansThe angle in radians.
Returns
The angle in radians.

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

constexpr long double operator""_rad ( unsigned long long  radians)
constexpr

The custom units operator for radians.

This operator is included for consistency, to allow for writing sizes like 1_rad instead of just 1.f. In reality, no transformation is applied.

Parameters
radiansThe angle in radians.
Returns
The angle in radians.

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

constexpr unsigned long operator""_sec ( long double  time)
constexpr

The custom units operator for seconds.

This operator allows for writing time spans like 5_sec, which will automatically be converted to milliseconds at compile time.

Parameters
timeThe time in seconds.
Returns
The time in milliseconds.

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

constexpr unsigned long operator""_sec ( unsigned long long  time)
constexpr

The custom units operator for seconds.

This operator allows for writing time spans like 5_sec, which will automatically be converted to milliseconds at compile time.

Parameters
timeThe time in seconds.
Returns
The time in milliseconds.

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

uint16_t operator""_vh ( long double  view_height_percent)

The custom units operator for view height percent.

This operator allows for writing sizes like 12.5_vh, which will automatically be converted to 12.5% of the display height at run time.

Parameters
view_height_percentThe size in view height percent.
Returns
The size in pixels.

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

uint16_t operator""_vh ( unsigned long long  view_height_percent)

The custom units operator for view height percent.

This operator allows for writing sizes like 25_vh, which will automatically be converted to 25% of the display height at run time.

Parameters
view_height_percentThe size in view height percent.
Returns
The size in pixels.

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

uint16_t operator""_vw ( long double  view_width_percent)

The custom units operator for view width percent.

This operator allows for writing sizes like 12.5_vw, which will automatically be converted to 12.5% of the display width at run time.

Parameters
view_width_percentThe size in view width percent.
Returns
The size in pixels.

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

uint16_t operator""_vw ( unsigned long long  view_width_percent)

The custom units operator for view width percent.

This operator allows for writing sizes like 25_vw, which will automatically be converted to 25% of the display width at run time.

Parameters
view_width_percentThe size in view width percent.
Returns
The size in pixels.