casting operators
This commit is contained in:
@@ -340,6 +340,20 @@ namespace OpenVulkano::Math
|
||||
|
||||
bool operator==(const RGB565& other) const { return value == other.value; }
|
||||
bool operator!=(const RGB565& other) const { return value != other.value; }
|
||||
|
||||
template<typename T, typename = std::enable_if_t<std::is_unsigned_v<T> || std::is_signed_v<T>>>
|
||||
operator Math::Vector4<T>() { return Get4<T>(); }
|
||||
template<typename T, typename = std::enable_if_t<std::is_unsigned_v<T> || std::is_signed_v<T>>>
|
||||
operator Math::Vector3<T>() { return Get3<T>(); }
|
||||
template<typename T, typename = std::enable_if_t<std::is_unsigned_v<T> || std::is_signed_v<T>>>
|
||||
operator Math::Vector4_SIMD<T>() { return Get4SIMD<T>(); }
|
||||
template<typename T, typename = std::enable_if_t<std::is_unsigned_v<T> || std::is_signed_v<T>>>
|
||||
operator Math::Vector3_SIMD<T>() { return Get3SIMD<T>(); }
|
||||
template<typename T, typename = std::enable_if_t<std::is_floating_point_v<T>>>
|
||||
operator Math::Vector4<T>() { return Get4Normalized<T>(); }
|
||||
template<typename T, typename = std::enable_if_t<std::is_floating_point_v<T>>>
|
||||
operator Math::Vector3<T>() { return Get3Normalized<T>(); }
|
||||
|
||||
};
|
||||
|
||||
static_assert(sizeof(RGB565) == 2);
|
||||
|
||||
Reference in New Issue
Block a user