5#include "libxr_def.hpp"
25template <
typename Scalar = DefaultScalar>
角度循环处理类,用于处理周期性角度计算。 A cyclic angle handling class for periodic angle calculations.
Scalar Value()
获取当前的角度值。 Retrieves the current angle value.
static Scalar Calculate(Scalar value)
计算角度值并归一化到 0 到 2π 之间。 Computes and normalizes the angle value within the range of 0 to 2π.
CycleValue operator-=(const Scalar &value)
复合减法运算符重载。 Overloaded compound subtraction operator.
CycleValue & operator=(const CycleValue &)=default
赋值运算符重载。 Overloaded assignment operator.
CycleValue & operator=(const Scalar &value)
赋值运算符重载,更新角度值并归一化。 Overloaded assignment operator, updating and normalizing the angle value.
Scalar operator-(const Scalar &raw_value)
减法运算符重载,计算角度差值并归一化到 -π 到 π 之间。 Overloaded subtraction operator, computing the angle difference and no...
Scalar value_
存储的角度值。 The stored angle value.
CycleValue operator+=(const Scalar &value)
复合加法运算符重载。 Overloaded compound addition operator.
CycleValue operator+(const Scalar &value)
加法运算符重载。 Overloaded addition operator.
CycleValue(const CycleValue &value)
拷贝构造函数,确保角度值在合法范围内。 Copy constructor ensuring the angle value remains within valid limits.
CycleValue operator-()
取反运算符重载,将角度转换到 2π - value_。 Overloaded negation operator, converting the angle to 2π - value_.
CycleValue(const Scalar &value)
使用给定值初始化 CycleValue。 Initializes CycleValue with a given value.
CycleValue()
默认构造函数,初始化为 0。 Default constructor initializing the angle to 0.
LibXR Color Control Library / LibXR终端颜色控制库
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值