| Flutter Impeller |

Public Member Functions | Public Attributes | List of all members
impeller::Degrees Struct Reference

`#include <scalar.h>`

## Public Member Functions
constexpr | Degrees ()=default
constexpr | Degrees (Scalar p_degrees)
constexpr | operator Radians () const
constexpr bool | IsFinite () const
constexpr Degrees | operator- () const
constexpr Degrees | operator+ (Degrees d) const
constexpr Degrees | operator- (Degrees d) const
constexpr auto | operator<=> (const Degrees &d) const =default
constexpr Degrees | GetPositive () const

## Public Attributes
Scalar | degrees = 0.0

## Detailed Description

Definition at line 66 of file scalar.h.

## Constructor & Destructor Documentation

## ◆ Degrees() [1/2]

constexpr impeller::Degrees::Degrees | ( |  | ) |
| constexpr default

## ◆ Degrees() [2/2]

constexpr impeller::Degrees::Degrees | ( | Scalar | p_degrees | ) |
| inline explicit constexpr

Definition at line 71 of file scalar.h.

71 : degrees(p_degrees) {}
impeller::Degrees::degrees
Scalar degrees
Definition: scalar.h:67

## Member Function Documentation

## ◆ GetPositive()

constexpr Degrees impeller::Degrees::GetPositive | ( |  | ) | const
| inline constexpr

Definition at line 91 of file scalar.h.

91 {
92 Scalar deg = std::fmod(degrees, 360.0f);
93 if (deg < 0.0f) {
94 deg += 360.0f;
95 }
96 return Degrees{deg};
97 }
impeller::Scalar
float Scalar
Definition: scalar.h:19
impeller::Degrees::Degrees
constexpr Degrees()=default

References degrees.

Referenced by impeller::Arc::ComputeIterations(), and impeller::Arc::GetTightArcBounds().

## ◆ IsFinite()

constexpr bool impeller::Degrees::IsFinite | ( |  | ) | const
| inline constexpr

Definition at line 77 of file scalar.h.

77 { return std::isfinite(degrees); }

References degrees.

Referenced by impeller::Arc::Arc().

## ◆ operator Radians()

constexpr impeller::Degrees::operator Radians | ( |  | ) | const
| inline constexpr

Definition at line 73 of file scalar.h.

73 {
74 return Radians{degrees * kPi / 180.0f};
75 };
impeller::kPi
constexpr float kPi
Definition: constants.h:26

References degrees, and impeller::kPi.

## ◆ operator+()

constexpr Degrees impeller::Degrees::operator+ | ( | Degrees | d | ) | const
| inline constexpr

Definition at line 81 of file scalar.h.

81 {
82 return Degrees{degrees + d.degrees};
83 }

References degrees.

## ◆ operator-() [1/2]

constexpr Degrees impeller::Degrees::operator- | ( |  | ) | const
| inline constexpr

Definition at line 79 of file scalar.h.

79 { return Degrees{-degrees}; }

References degrees.

## ◆ operator-() [2/2]

constexpr Degrees impeller::Degrees::operator- | ( | Degrees | d | ) | const
| inline constexpr

Definition at line 85 of file scalar.h.

85 {
86 return Degrees{degrees - d.degrees};
87 }

References degrees.

## ◆ operator<=>()

constexpr auto impeller::Degrees::operator<=> | ( | const Degrees & | d | ) | const
| constexpr default

## Member Data Documentation

## ◆ degrees

Scalar impeller::Degrees::degrees = 0.0

Definition at line 67 of file scalar.h.

Referenced by impeller::interop::PathBuilder::AddArc(), impeller::Arc::Arc(), impeller::Arc::ComputeIterations(), GetPositive(), impeller::Arc::GetTightArcBounds(), IsFinite(), impeller::Arc::IsFullCircle(), operator Radians(), operator+(), operator-(), std::operator<<(), impeller::interop::DisplayListBuilder::Rotate(), impeller::SweepGradientContents::SetCenterAndAngles(), impeller::testing::TEST(), and impeller::testing::TEST_P().

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

- impeller/geometry/scalar.h