|
| template<typename T > |
| constexpr T | Limit (const T &v, const T &v_min, const T &v_max) |
| | 限制数值到 闭区间 更多...
|
| |
| template<typename T , size_t N> |
| std::array< unsigned, N > | CastU (const std::array< T, N > &a, bool show_log=true) |
| | 有符号转无符号,并且判断负数 更多...
|
| |
| template<typename T , size_t N> |
| std::array< unsigned, N > | CastUDefault (const std::array< T, N > &a) |
| | 有符号转无符号,直接转换,负数会直接转为大正数 更多...
|
| |
| template<typename T > |
| constexpr bool | IsOutRange (T x, T a, T b) |
| | 判断数值是否越界(前闭后开) 更多...
|
| |
| constexpr uint64_t | Pow (uint64_t x, uint8_t n) |
| | 返回x的n次方 更多...
|
| |
| constexpr uint32_t | Pow32 (uint32_t x, uint8_t n) |
| |
| constexpr uint64_t | CeilToPow2 (uint64_t &&x) |
| |
| constexpr uint32_t | CeilToPow2 (uint32_t &&x) |
| |
| template<typename T > |
| T | CeilToPow2 (const T &x) |
| | 向上取2的幂次 更多...
|
| |
| float | RSqrt (float x) |
| | 返回平方根的倒数 更多...
|
| |
| template<size_t N> |
| void | NormalizeFast (std::array< float, N > &v) |
| | 向量单位化,精度低速度快 更多...
|
| |
| template<IsSigned T> |
| T | DisPow2 (const std::array< T, 2 > &a) |
| | 返回 向量 距离的平方 更多...
|
| |
| template<IsSigned T> |
| T | DisPow2 (const std::array< T, 3 > &a) |
| |
| template<IsSigned T> |
| T | DisPow2 (const std::array< T, 4 > &a) |
| |
| template<IsSigned T> |
| T | DisPow2 (const std::array< T, 2 > &a, const std::array< T, 2 > &b) |
| | 返回 距离的平方 更多...
|
| |
| template<IsUnsigned T> |
| T | DisU (T a, T b) |
| | 返回无符号类型的差值 更多...
|
| |
| template<IsUnsigned T0, IsSigned T1> |
| T0 | AddU (T0 a, T1 b) |
| | 无符号 加 有符号,防止小于0 更多...
|
| |
| template<IsUnsigned T> |
| T | DisPow2U (const std::array< T, 2 > &a, const std::array< T, 2 > &b) |
| | 返回 距离的平方 更多...
|
| |
| template<IsSigned T, size_t N> |
| void | Normalize (std::array< T, N > &v) |
| | 向量单位化 更多...
|
| |
| template<IsSigned T, size_t N> |
| std::array< T, N > | Normalize (const std::array< T, N > &v) |
| |
| std::vector< PointU > | getCircle (const Size &size, const PointU &xy, unsigned rad) |
| | 返回圆形范围的节点,考虑越界 更多...
|
| |
| std::vector< Point > | getCircle (const Point &xy, unsigned rad) |
| | 返回圆形范围的节点,不考虑越界 更多...
|
| |
| constexpr double | PI (unsigned n, unsigned d=1) |
| | 返回PI的分数 更多...
|
| |
| template<IsReal T> |
| constexpr T | AlignF (T x, T align) |
| | RGP资源下标转方向 更多...
|
| |
| template<IsUnsigned T> |
| constexpr T | Align (T x, T align) |
| | 对齐align的倍数 更多...
|
| |
| constexpr unsigned | AlignPow2 (unsigned x, unsigned align) |
| | 对齐align的倍数 更多...
|
| |
| constexpr unsigned | div_found (unsigned n, unsigned d) |
| | 无符号除法,返回四舍五入结果 更多...
|
| |
| constexpr unsigned | div_found_fast (unsigned n, unsigned d) |
| | 无符号除法,返回四舍五入结果 更多...
|
| |
| constexpr float | OffsetOrder (float order, int u=1, int v=0, int w=0) |
| | 偏移order 更多...
|
| |
| constexpr Float | CrossProduct (const Position2 &a, const Position2 &b) |
| | 叉乘 更多...
|
| |
| constexpr Position3 | CrossProduct (const Position3 &a, const Position3 &b) |
| |
| template<typename T , size_t N> |
| constexpr T | DotProduct (const std::array< T, N > &a, const std::array< T, N > &b) |
| | 点乘 更多...
|
| |
| Position4 | Slerp (const Position4 &q0, const Position4 &q1, const Float &t) |
| | 球面线性插值 更多...
|
| |
| template<typename C > |
| constexpr auto | DistanceDiagonal (const C &p0, const C &p1) |
| | 纹理区域转uv 更多...
|
| |
| std::vector< Point > | DrawLineLerp (const Point &p0, const Point &p1) |
| | 线性插值 画线算法 更多...
|
| |
| std::vector< Point > | DrawLineBresenham (const Point &p0, const Point &p1) |
| | bresenham 画线算法 更多...
|
| |
| std::vector< Point > | DrawLineOrth (const Point &p0, const Point &p1) |
| | 正交 画线算法 更多...
|
| |
| std::vector< Point > | DrawLineCover (const Point &p0, const Point &p1) |
| | 覆盖 画线算法 更多...
|
| |
| void | MergePath (std::list< Point > &list_pos) |
| | 路径合并(网格路径) 更多...
|
| |
| template<typename F > |
| void | MergePathDirect (std::list< Point > &list_pos, F func_pass) |
| | 路径合并(网格路径) 更多...
|
| |
| template<typename T > |
| constexpr bool | IsValidRect (const std::array< T, 4 > &rect) |
| | ** 更多...
|
| |
| template<typename T > |
| constexpr bool | IsRectInSize (const std::array< T, 4 > &rect, const Size &size) |
| | 判断 矩形 在 大小 内,首先它必须是有效的矩形 更多...
|
| |
| constexpr bool | IsXyInSize (const Point &xy, const Size &size) |
| | 判断 点是否在大小内 更多...
|
| |
| constexpr bool | IsXyInRect (const Point &xy, const Rect &rect) |
| | 判断 点是否在矩形内 更多...
|
| |
| constexpr bool | IsDotInTriangle (const Position &dot, const Triangle &triangle) |
| | 判断点是否在三角形内 更多...
|
| |