dl
命名空间 | 类型定义 | 枚举 | 函数 | 变量
dl_align.h 文件参考

方向和对齐定义 更多...

#include <array>
#include <string_view>
#include "dl_concept.h"
#include "io/dl_log.h"
#include "dl_string.h"

浏览源代码.

命名空间

namespace  dl
 
namespace  dl::Align
 

类型定义

using dl::Align::Direction2 = std::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
}
 
enum class  dl::Align::LTRB { dl::Align::LEFT = 0 , dl::Align::TOP = 1 , dl::Align::RIGHT = 2 , dl::Align::BUTTOM = 3 }
 9方向定义(包含0为中心),以x正轴,朝y轴旋转 更多...
 
enum class  dl::Align::Corner { dl::Align::LT = 0 , dl::Align::RT = 1 , dl::Align::RB = 2 , dl::Align::LB = 3 }
 水平位置 更多...
 

函数

template<IsSigned T, std::size_t N>
constexpr std::array< T, N > dl::Align::Size2Anchor (const std::array< T, N > &size, const std::array< Direction, N > &dir)
 垂直位置 更多...
 
Direction2 dl::Align::Anchor2Direction (std::string_view anchor)
 锚点(字符串)返回 对齐 更多...
 
Point dl::Align::Anchor2Point (const Size &size, std::string_view anchor)
 锚点(字符串)返回 偏移 更多...
 
template<typename T >
constexpr std::array< T, 2 > dl::Align::GetLT (const std::array< T, 4 > &rect)
 
template<typename T >
constexpr std::array< T, 2 > dl::Align::GetRT (const std::array< T, 4 > &rect)
 
template<typename T >
constexpr std::array< T, 2 > dl::Align::GetRB (const std::array< T, 4 > &rect)
 
template<typename T >
constexpr std::array< T, 2 > dl::Align::GetLB (const std::array< T, 4 > &rect)
 
template<typename T >
constexpr T & dl::Align::GetLeft (std::array< T, 4 > &rect)
 
template<typename T >
constexpr T & dl::Align::GetTop (std::array< T, 4 > &rect)
 
template<typename T >
constexpr T & dl::Align::GetRight (std::array< T, 4 > &rect)
 
template<typename T >
constexpr T & dl::Align::GetButtom (std::array< T, 4 > &rect)
 
template<typename T >
constexpr T dl::Align::GetHeight (const std::array< T, 4 > &rect)
 计算返回 矩形 右下角坐标y 减去 左上角坐标y 更多...
 
template<typename T >
constexpr T dl::Align::GetWidth (const std::array< T, 4 > &rect)
 计算返回 矩形 右下角坐标x 减去 左上角坐标x 更多...
 
template<typename T >
constexpr std::array< T, 2 > dl::Align::GetSize (const std::array< T, 4 > &rect)
 计算返回 矩形 宽和高 更多...
 
template<typename T >
constexpr T dl::Align::GetQuadSize (const std::array< T, 4 > &quad)
 返回 Quad 的大小 更多...
 
template<typename T >
constexpr std::array< T, 3 > dl::Align::GetQuadTriangle0 (const std::array< T, 4 > &quad)
 返回 Quad的三角形 更多...
 
template<typename T >
constexpr std::array< T, 3 > dl::Align::GetQuadTriangle1 (const std::array< T, 4 > &quad)
 

变量

constexpr Direction2 dl::Align::LC = { Direction::BACK, Direction::ZERO }
 
constexpr Direction2 dl::Align::LT = { Direction::BACK, Direction::BACK }
 

详细描述

方向和对齐定义

版本
1.0
作者
lveyou
日期
22-08-28
注解

在文件 dl_align.h 中定义.