|
dl
|
方向和对齐定义 更多...
#include <array>#include <string_view>#include "base/dl_concept.h"#include "io/dl_log.h"#include "base/dl_string.h"命名空间 | |
| namespace | dl |
| namespace | dl::Align |
| 方向、对齐定义 | |
类型定义 | |
| using | dl::Align::Direction2 = Array<Direction, 2> |
枚举 | |
| enum class | dl::Align::Direction : int { dl::Align::BACK = -1 , dl::Align::ZERO = 0 , dl::Align::FRONT = 1 , dl::Align::FARTHEST = std::numeric_limits<int>::lowest() } |
| enum class | dl::Align::Dir4 { dl::Align::RIGHT = 0 , dl::Align::BOTTOM , dl::Align::LEFT , dl::Align::TOP } |
| enum class | dl::Align::Dir8 { dl::Align::RIGHT = 0 , dl::Align::RB , dl::Align::BOTTOM , dl::Align::LB , dl::Align::LEFT , dl::Align::LT , dl::Align::TOP , dl::Align::RT , dl::Align::NONE } |
| enum class | dl::Align::LTRB { dl::Align::LEFT = 0 , dl::Align::TOP = 1 , dl::Align::RIGHT = 2 , dl::Align::BOTTOM = 3 } |
| 左上右下(2个点,rect用) 更多... | |
| enum class | dl::Align::Corner { dl::Align::LT = 0 , dl::Align::RT = 1 , dl::Align::RB = 2 , dl::Align::LB = 3 } |
| 斜角位置(4个点,quad用) 更多... | |
函数 | |
| constexpr Dir8 | dl::Align::GetDir8 (const PointU &p0, const PointU &p1) |
| constexpr Dir8 | dl::Align::GetDir8R (Dir8 dir) |
| 获取相反方向 | |
| constexpr int | dl::Align::Dir8ToMir2 (Dir8 dir) |
| template<typename T, typename F> | |
| int | dl::Align::GetMask (const std::array< T, 4 > &arr, F func) |
| constexpr size_t | dl::Align::Mask2Index (int mask) |
| template<IsSigned T, std::size_t N> | |
| constexpr Array< T, N > | dl::Align::Size2Anchor (const Array< T, N > &size, const Array< Direction, N > &dir) |
| 根据大小和对齐,计算锚点 | |
| template<IsSigned T, std::size_t N> | |
| constexpr Array< T, N > | dl::Align::Size2Anchor (const Array< T, N > &size, const Array< T, N > &size_self, const Array< Direction, N > &dir) |
| 根据大小和对齐,计算锚点 | |
| template<IsSigned T, std::size_t N> | |
| constexpr Array< T, N > | dl::Align::Dir2Offset (const Array< T, N > &size, Dir4 dir) |
| 根据大小和朝向,计算偏移 | |
| float | dl::Align::Dir2Rotate (Dir4 dir) |
| 方向对应的旋转角度(弧度) | |
| Direction2 | dl::Align::Anchor2Direction (std::string_view anchor) |
| 锚点(字符串)返回 对齐 | |
| Point | dl::Align::Anchor2Point (const Size &size, std::string_view anchor) |
| 锚点(字符串)返回 偏移 | |
| Position | dl::Align::Anchor2Position (const Position &size, std::string_view anchor) |
| template<typename T> | |
| constexpr Array< T, 2 > | dl::Align::GetLT (const Array< T, 4 > &rect) |
| template<typename T> | |
| constexpr Array< T, 2 > | dl::Align::GetRT (const Array< T, 4 > &rect) |
| template<typename T> | |
| constexpr Array< T, 2 > | dl::Align::GetRB (const Array< T, 4 > &rect) |
| template<typename T> | |
| constexpr Array< T, 2 > | dl::Align::GetLB (const Array< T, 4 > &rect) |
| template<typename T> | |
| constexpr T & | dl::Align::GetLeft (Array< T, 4 > &rect) |
| template<typename T> | |
| constexpr T & | dl::Align::GetTop (Array< T, 4 > &rect) |
| template<typename T> | |
| constexpr T & | dl::Align::GetRight (Array< T, 4 > &rect) |
| template<typename T> | |
| constexpr T & | dl::Align::GetBottom (Array< T, 4 > &rect) |
| template<typename T> | |
| constexpr T | dl::Align::GetHeight (const Array< T, 4 > &rect) |
| 计算返回 矩形 右下角坐标y 减去 左上角坐标y | |
| template<typename T> | |
| constexpr T | dl::Align::GetWidth (const Array< T, 4 > &rect) |
| 计算返回 矩形 右下角坐标x 减去 左上角坐标x | |
| template<typename T> | |
| constexpr Array< T, 2 > | dl::Align::GetSize (const Array< T, 4 > &rect) |
| 计算返回 矩形 宽和高 | |
| template<typename T> | |
| constexpr void | dl::Align::Shrink (Array< T, 4 > &rect, const T &v) |
| 拓展矩形 | |
| template<typename T> | |
| constexpr Array< T, 4 > | dl::Align::Shrink (const Array< T, 4 > &rect, const T &v) |
| template<typename T> | |
| constexpr void | dl::Align::OffsetRect (Array< T, 4 > &rect, const Array< T, 2 > &offset) |
| 偏移矩形 | |
变量 | |
| constexpr Direction2 | dl::Align::LT = { Direction::BACK, Direction::BACK } |
| constexpr Direction2 | dl::Align::LC = { Direction::BACK, Direction::ZERO } |
| constexpr Direction2 | dl::Align::LB = { Direction::BACK, Direction::FRONT } |
| constexpr Direction2 | dl::Align::CT = { Direction::ZERO, Direction::BACK } |
| constexpr Direction2 | dl::Align::CC = { Direction::ZERO, Direction::ZERO } |
| constexpr Direction2 | dl::Align::CB = { Direction::ZERO, Direction::FRONT } |
| constexpr Direction2 | dl::Align::RT = { Direction::FRONT, Direction::BACK } |
| constexpr Direction2 | dl::Align::RC = { Direction::FRONT, Direction::ZERO } |
| constexpr Direction2 | dl::Align::RB = { Direction::FRONT, Direction::FRONT } |
| constexpr int | dl::Align::MASK_J = 1 |
| 平滑地图 四方向掩码 | |
| constexpr int | dl::Align::MASK_L = 2 |
| constexpr int | dl::Align::MASK_7 = 4 |
| constexpr int | dl::Align::MASK_Γ = 8 |