commit
						418eab5667
					
				|  | @ -54,6 +54,15 @@ struct Resolution | |||
|     uint32_t width = 0;         ///< 分辨率宽度
 | ||||
|     uint32_t height = 0;        ///< 分辨率高度
 | ||||
|     uint32_t refresh_rate = 0;  ///< 刷新率
 | ||||
| 
 | ||||
|     Resolution() = default; | ||||
| 
 | ||||
|     Resolution(uint32_t width, uint32_t height, uint32_t refresh_rate) | ||||
|         : width(width) | ||||
|         , height(height) | ||||
|         , refresh_rate(refresh_rate) | ||||
|     { | ||||
|     } | ||||
| }; | ||||
| 
 | ||||
| /**
 | ||||
|  |  | |||
|  | @ -43,7 +43,15 @@ Color::Color() | |||
| { | ||||
| } | ||||
| 
 | ||||
| Color::Color(uint32_t r, uint32_t g, uint32_t b, float alpha) | ||||
| Color::Color(float r, float g, float b, float alpha) | ||||
|     : r(r) | ||||
|     , g(g) | ||||
|     , b(b) | ||||
|     , a(alpha) | ||||
| { | ||||
| } | ||||
| 
 | ||||
| Color::Color(int r, int g, int b, float alpha) | ||||
|     : r(r / 255.0f) | ||||
|     , g(g / 255.0f) | ||||
|     , b(b / 255.0f) | ||||
|  | @ -59,7 +67,12 @@ Color::Color(uint32_t rgb, float alpha) | |||
| { | ||||
| } | ||||
| 
 | ||||
| Color Color::Rgb(uint32_t r, uint32_t g, uint32_t b) | ||||
| Color Color::Rgb(float r, float g, float b) | ||||
| { | ||||
|     return Color::Rgba(r, g, b, 1.0f); | ||||
| } | ||||
| 
 | ||||
| Color Color::Rgb(int r, int g, int b) | ||||
| { | ||||
|     return Color::Rgba(r, g, b, 1.0f); | ||||
| } | ||||
|  | @ -69,7 +82,12 @@ Color Color::Rgb(uint32_t rgb) | |||
|     return Color::Rgba(rgb, 1.0f); | ||||
| } | ||||
| 
 | ||||
| Color Color::Rgba(uint32_t r, uint32_t g, uint32_t b, float alpha) | ||||
| Color Color::Rgba(float r, float g, float b, float alpha) | ||||
| { | ||||
|     return Color(r, g, b, alpha); | ||||
| } | ||||
| 
 | ||||
| Color Color::Rgba(int r, int g, int b, float alpha) | ||||
| { | ||||
|     return Color(r, g, b, alpha); | ||||
| } | ||||
|  |  | |||
|  | @ -46,13 +46,21 @@ public: | |||
|     /// @details 默认颜色为 R: 0, G: 0, B: 0, A: 1.0
 | ||||
|     Color(); | ||||
| 
 | ||||
|     /// \~chinese
 | ||||
|     /// @brief 构造 RGBA 颜色
 | ||||
|     /// @param r 红色值,范围 0 - 1
 | ||||
|     /// @param g 绿色值,范围 0 - 1
 | ||||
|     /// @param b 蓝色值,范围 0 - 1
 | ||||
|     /// @param alpha Alpha值,范围 0.0 - 1.0
 | ||||
|     Color(float r, float g, float b, float alpha = 1.0f); | ||||
| 
 | ||||
|     /// \~chinese
 | ||||
|     /// @brief 构造 RGBA 颜色
 | ||||
|     /// @param r 红色值,范围 0 - 255
 | ||||
|     /// @param g 绿色值,范围 0 - 255
 | ||||
|     /// @param b 蓝色值,范围 0 - 255
 | ||||
|     /// @param alpha Alpha值,范围 0.0 - 1.0
 | ||||
|     Color(uint32_t r, uint32_t g, uint32_t b, float alpha = 1.0f); | ||||
|     Color(int r, int g, int b, float alpha = 1.0f); | ||||
| 
 | ||||
|     /// \~chinese
 | ||||
|     /// @brief 构造 RGBA 颜色
 | ||||
|  | @ -60,25 +68,39 @@ public: | |||
|     /// @param alpha Alpha值,范围 0.0 - 1.0
 | ||||
|     Color(uint32_t rgb, float alpha = 1.0f); | ||||
| 
 | ||||
|     /// \~chinese
 | ||||
|     /// @brief 构造 RGB 颜色
 | ||||
|     /// @param r 红色值,范围 0 - 1
 | ||||
|     /// @param g 绿色值,范围 0 - 1
 | ||||
|     /// @param b 蓝色值,范围 0 - 1
 | ||||
|     static Color Rgb(float r, float g, float b); | ||||
| 
 | ||||
|     /// \~chinese
 | ||||
|     /// @brief 构造 RGB 颜色
 | ||||
|     /// @param r 红色值,范围 0 - 255
 | ||||
|     /// @param g 绿色值,范围 0 - 255
 | ||||
|     /// @param b 蓝色值,范围 0 - 255
 | ||||
|     static Color Rgb(uint32_t r, uint32_t g, uint32_t b); | ||||
|     static Color Rgb(int r, int g, int b); | ||||
| 
 | ||||
|     /// \~chinese
 | ||||
|     /// @brief 构造 RGB 颜色
 | ||||
|     /// @param rgb 使用16进制整形值表示 RGB颜色
 | ||||
|     static Color Rgb(uint32_t rgb); | ||||
| 
 | ||||
|     /// \~chinese
 | ||||
|     /// @brief 构造 RGB 颜色
 | ||||
|     /// @param r 红色值,范围 0 - 1
 | ||||
|     /// @param g 绿色值,范围 0 - 1
 | ||||
|     /// @param b 蓝色值,范围 0 - 1
 | ||||
|     static Color Rgba(float r, float g, float b, float alpha); | ||||
| 
 | ||||
|     /// \~chinese
 | ||||
|     /// @brief 构造 RGBA 颜色
 | ||||
|     /// @param r 红色值,范围 0 - 255
 | ||||
|     /// @param g 绿色值,范围 0 - 255
 | ||||
|     /// @param b 蓝色值,范围 0 - 255
 | ||||
|     /// @param alpha Alpha值,范围 0.0 - 1.0
 | ||||
|     static Color Rgba(uint32_t r, uint32_t g, uint32_t b, float alpha); | ||||
|     static Color Rgba(int r, int g, int b, float alpha); | ||||
| 
 | ||||
|     /// \~chinese
 | ||||
|     /// @brief 构造 RGBA 颜色
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue