/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2007-06-21 // Updated : 2007-08-03 // Licence : This source is under MIT License // File : glm/gtx/color_cast.inl /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm { template GLM_FUNC_QUALIFIER uint8 u8channel_cast(T a) { return static_cast(a * T(255)); } template GLM_FUNC_QUALIFIER uint16 u16channel_cast(T a) { return static_cast(a * T(65535)); } template GLM_FUNC_QUALIFIER uint32 u32_rgbx_cast(const detail::tvec3& c) { uint32 result = 0; result += static_cast(c.x * detail::tvec3::value_type(255)) << 0; result += static_cast(c.y * detail::tvec3::value_type(255)) << 8; result += static_cast(c.z * detail::tvec3::value_type(255)) << 16; return result; } template GLM_FUNC_QUALIFIER uint32 u32_xrgb_cast(const detail::tvec3& c) { uint32 result = 0; result += static_cast(c.x * detail::tvec3::value_type(255)) << 8; result += static_cast(c.y * detail::tvec3::value_type(255)) << 16; result += static_cast(c.z * detail::tvec3::value_type(255)) << 24; return result; } template GLM_FUNC_QUALIFIER uint32 u32_bgrx_cast(const detail::tvec3& c) { uint32 result = 0; result += static_cast(c.x * detail::tvec3::value_type(255)) << 16; result += static_cast(c.y * detail::tvec3::value_type(255)) << 8; result += static_cast(c.z * detail::tvec3::value_type(255)) << 0; return result; } template GLM_FUNC_QUALIFIER uint32 u32_xbgr_cast(const detail::tvec3& c) { uint32 result = 0; result += static_cast(c.x * detail::tvec3::value_type(255)) << 24; result += static_cast(c.y * detail::tvec3::value_type(255)) << 16; result += static_cast(c.z * detail::tvec3::value_type(255)) << 8; result += static_cast(c.w * detail::tvec3::value_type(255)) << 0; return result; } template GLM_FUNC_QUALIFIER uint32 u32_rgba_cast(const detail::tvec4& c) { uint32 result = 0; result += static_cast(c.x * detail::tvec4::value_type(255)) << 0; result += static_cast(c.y * detail::tvec4::value_type(255)) << 8; result += static_cast(c.z * detail::tvec4::value_type(255)) << 16; result += static_cast(c.w * detail::tvec4::value_type(255)) << 24; return result; } template GLM_FUNC_QUALIFIER uint32 u32_argb_cast(const detail::tvec4& c) { uint32 result = 0; result += static_cast(c.x * detail::tvec4::value_type(255)) << 8; result += static_cast(c.y * detail::tvec4::value_type(255)) << 16; result += static_cast(c.z * detail::tvec4::value_type(255)) << 24; result += static_cast(c.w * detail::tvec4::value_type(255)) << 0; return result; } template GLM_FUNC_QUALIFIER uint32 u32_bgra_cast(const detail::tvec4& c) { uint32 result = 0; result += static_cast(c.x * detail::tvec4::value_type(255)) << 16; result += static_cast(c.y * detail::tvec4::value_type(255)) << 8; result += static_cast(c.z * detail::tvec4::value_type(255)) << 0; result += static_cast(c.w * detail::tvec4::value_type(255)) << 24; return result; } template GLM_FUNC_QUALIFIER uint32 u32_abgr_cast(const detail::tvec4& c) { uint32 result = 0; result += static_cast(c.x * detail::tvec4::value_type(255)) << 24; result += static_cast(c.y * detail::tvec4::value_type(255)) << 16; result += static_cast(c.z * detail::tvec4::value_type(255)) << 8; result += static_cast(c.w * detail::tvec4::value_type(255)) << 0; return result; } template GLM_FUNC_QUALIFIER uint64 u64_rgbx_cast(const detail::tvec3& c) { uint64 result = 0; result += static_cast(c.x * detail::tvec3::value_type(65535)) << 0; result += static_cast(c.y * detail::tvec3::value_type(65535)) << 16; result += static_cast(c.z * detail::tvec3::value_type(65535)) << 32; return result; } template GLM_FUNC_QUALIFIER uint64 u32_xrgb_cast(const detail::tvec3& c) { uint64 result = 0; result += static_cast(c.x * detail::tvec3::value_type(65535)) << 16; result += static_cast(c.y * detail::tvec3::value_type(65535)) << 32; result += static_cast(c.z * detail::tvec3::value_type(65535)) << 48; return result; } template GLM_FUNC_QUALIFIER uint64 u32_bgrx_cast(const detail::tvec3& c) { uint64 result = 0; result += static_cast(c.x * detail::tvec3::value_type(65535)) << 32; result += static_cast(c.y * detail::tvec3::value_type(65535)) << 16; result += static_cast(c.z * detail::tvec3::value_type(65535)) << 0; return result; } template GLM_FUNC_QUALIFIER uint64 u32_xbgr_cast(const detail::tvec3& c) { uint64 result = 0; result += static_cast(c.x * detail::tvec3::value_type(65535)) << 48; result += static_cast(c.y * detail::tvec3::value_type(65535)) << 32; result += static_cast(c.z * detail::tvec3::value_type(65535)) << 16; result += static_cast(c.w * detail::tvec3::value_type(65535)) << 0; return result; } template GLM_FUNC_QUALIFIER uint64 u64_rgba_cast(const detail::tvec4& c) { uint64 result = 0; result += static_cast(c.x * detail::tvec4::value_type(65535)) << 0; result += static_cast(c.y * detail::tvec4::value_type(65535)) << 16; result += static_cast(c.z * detail::tvec4::value_type(65535)) << 32; result += static_cast(c.w * detail::tvec4::value_type(65535)) << 48; return result; } template GLM_FUNC_QUALIFIER uint64 u64_argb_cast(const detail::tvec4& c) { uint64 result = 0; result += static_cast(c.x * detail::tvec4::value_type(65535)) << 16; result += static_cast(c.y * detail::tvec4::value_type(65535)) << 32; result += static_cast(c.z * detail::tvec4::value_type(65535)) << 48; result += static_cast(c.w * detail::tvec4::value_type(65535)) << 0; return result; } template GLM_FUNC_QUALIFIER uint64 u64_bgra_cast(const detail::tvec4& c) { uint64 result = 0; result += static_cast(c.x * detail::tvec4::value_type(65535)) << 32; result += static_cast(c.y * detail::tvec4::value_type(65535)) << 16; result += static_cast(c.z * detail::tvec4::value_type(65535)) << 0; result += static_cast(c.w * detail::tvec4::value_type(65535)) << 48; return result; } template GLM_FUNC_QUALIFIER uint64 u64_abgr_cast(const detail::tvec4& c) { uint64 result = 0; result += static_cast(c.x * detail::tvec4::value_type(65535)) << 48; result += static_cast(c.y * detail::tvec4::value_type(65535)) << 32; result += static_cast(c.z * detail::tvec4::value_type(65535)) << 16; result += static_cast(c.w * detail::tvec4::value_type(65535)) << 0; return result; } template <> GLM_FUNC_QUALIFIER f16 f16_channel_cast(uint32 color) { return f16(static_cast(color >> 0) / static_cast(255)); } template <> GLM_FUNC_QUALIFIER f16vec3 f16_rgbx_cast(uint32 color) { f16vec3 result; result.x = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); result.y = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); result.z = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); return result; } template <> GLM_FUNC_QUALIFIER f16vec3 f16_xrgb_cast(uint32 color) { f16vec3 result; result.x = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); result.y = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); result.z = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); return result; } template <> GLM_FUNC_QUALIFIER f16vec3 f16_bgrx_cast(uint32 color) { f16vec3 result; result.x = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); result.y = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); result.z = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); return result; } template <> GLM_FUNC_QUALIFIER f16vec3 f16_xbgr_cast(uint32 color) { f16vec3 result; result.x = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); result.y = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); result.z = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); return result; } template <> GLM_FUNC_QUALIFIER f16vec4 f16_rgba_cast(uint32 color) { f16vec4 result; result.x = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); result.y = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); result.z = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); result.w = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); return result; } template <> GLM_FUNC_QUALIFIER f16vec4 f16_argb_cast(uint32 color) { f16vec4 result; result.x = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); result.y = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); result.z = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); result.w = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); return result; } template <> GLM_FUNC_QUALIFIER f16vec4 f16_bgra_cast(uint32 color) { f16vec4 result; result.x = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); result.y = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); result.z = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); result.w = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); return result; } template <> GLM_FUNC_QUALIFIER f16vec4 f16_abgr_cast(uint32 color) { f16vec4 result; result.x = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); result.y = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); result.z = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); result.w = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); return result; } template <> GLM_FUNC_QUALIFIER float f32_channel_cast(uint8 color) { return static_cast(color >> 0) / static_cast(255); } template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_rgbx_cast(uint32 color) { detail::tvec3 result; result.x = static_cast((color >> 0) & 0xFF) / static_cast(255); result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); result.z = static_cast((color >> 16) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_xrgb_cast(uint32 color) { detail::tvec3 result; result.x = static_cast((color >> 8) & 0xFF) / static_cast(255); result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); result.z = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_bgrx_cast(uint32 color) { detail::tvec3 result; result.x = static_cast((color >> 16) & 0xFF) / static_cast(255); result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); result.z = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_xbgr_cast(uint32 color) { detail::tvec3 result; result.x = static_cast((color >> 24) & 0xFF) / static_cast(255); result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); result.z = static_cast((color >> 8) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_rgba_cast(uint32 color) { detail::tvec4 result; result.x = static_cast((color >> 0) & 0xFF) / static_cast(255); result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); result.z = static_cast((color >> 16) & 0xFF) / static_cast(255); result.w = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_argb_cast(uint32 color) { detail::tvec4 result; result.x = static_cast((color >> 8) & 0xFF) / static_cast(255); result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); result.z = static_cast((color >> 24) & 0xFF) / static_cast(255); result.w = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_bgra_cast(uint32 color) { detail::tvec4 result; result.x = static_cast((color >> 16) & 0xFF) / static_cast(255); result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); result.z = static_cast((color >> 0) & 0xFF) / static_cast(255); result.w = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_abgr_cast(uint32 color) { detail::tvec4 result; result.x = static_cast((color >> 24) & 0xFF) / static_cast(255); result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); result.z = static_cast((color >> 8) & 0xFF) / static_cast(255); result.w = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER double f64_channel_cast(uint8 color) { return static_cast(color >> 0) / static_cast(255); } template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_rgbx_cast(uint32 color) { detail::tvec3 result; result.x = static_cast((color >> 0) & 0xFF) / static_cast(255); result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); result.z = static_cast((color >> 16) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_xrgb_cast(uint32 color) { detail::tvec3 result; result.x = static_cast((color >> 8) & 0xFF) / static_cast(255); result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); result.z = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_bgrx_cast(uint32 color) { detail::tvec3 result; result.x = static_cast((color >> 16) & 0xFF) / static_cast(255); result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); result.z = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_xbgr_cast(uint32 color) { detail::tvec3 result; result.x = static_cast((color >> 24) & 0xFF) / static_cast(255); result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); result.z = static_cast((color >> 8) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_rgba_cast(uint32 color) { detail::tvec4 result; result.x = static_cast((color >> 0) & 0xFF) / static_cast(255); result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); result.z = static_cast((color >> 16) & 0xFF) / static_cast(255); result.w = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_argb_cast(uint32 color) { detail::tvec4 result; result.x = static_cast((color >> 8) & 0xFF) / static_cast(255); result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); result.z = static_cast((color >> 24) & 0xFF) / static_cast(255); result.w = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_bgra_cast(uint32 color) { detail::tvec4 result; result.x = static_cast((color >> 16) & 0xFF) / static_cast(255); result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); result.z = static_cast((color >> 0) & 0xFF) / static_cast(255); result.w = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_abgr_cast(uint32 color) { detail::tvec4 result; result.x = static_cast((color >> 24) & 0xFF) / static_cast(255); result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); result.z = static_cast((color >> 8) & 0xFF) / static_cast(255); result.w = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } template <> GLM_FUNC_QUALIFIER detail::half f16_channel_cast(uint16 color) { return detail::half(static_cast(color >> 0) / static_cast(65535)); } template <> GLM_FUNC_QUALIFIER detail::tvec3 f16_rgbx_cast(uint64 color) { detail::tvec3 result; result.x = detail::half(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); result.y = detail::half(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); result.z = detail::half(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f16_xrgb_cast(uint64 color) { detail::tvec3 result; result.x = detail::half(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); result.y = detail::half(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); result.z = detail::half(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f16_bgrx_cast(uint64 color) { detail::tvec3 result; result.x = detail::half(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); result.y = detail::half(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); result.z = detail::half(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f16_xbgr_cast(uint64 color) { detail::tvec3 result; result.x = detail::half(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); result.y = detail::half(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); result.z = detail::half(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f16_rgba_cast(uint64 color) { detail::tvec4 result; result.x = detail::half(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); result.y = detail::half(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); result.z = detail::half(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); result.w = detail::half(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f16_argb_cast(uint64 color) { detail::tvec4 result; result.x = detail::half(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); result.y = detail::half(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); result.z = detail::half(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); result.w = detail::half(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f16_bgra_cast(uint64 color) { detail::tvec4 result; result.x = detail::half(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); result.y = detail::half(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); result.z = detail::half(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); result.w = detail::half(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f16_abgr_cast(uint64 color) { detail::tvec4 result; result.x = detail::half(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); result.y = detail::half(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); result.z = detail::half(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); result.w = detail::half(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); return result; } template <> GLM_FUNC_QUALIFIER float f32_channel_cast(uint16 color) { return static_cast(color >> 0) / static_cast(65535); } template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_rgbx_cast(uint64 color) { detail::tvec3 result; result.x = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_xrgb_cast(uint64 color) { detail::tvec3 result; result.x = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_bgrx_cast(uint64 color) { detail::tvec3 result; result.x = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_xbgr_cast(uint64 color) { detail::tvec3 result; result.x = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_rgba_cast(uint64 color) { detail::tvec4 result; result.x = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.w = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_argb_cast(uint64 color) { detail::tvec4 result; result.x = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); result.w = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_bgra_cast(uint64 color) { detail::tvec4 result; result.x = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); result.w = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_abgr_cast(uint64 color) { detail::tvec4 result; result.x = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.w = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER double f64_channel_cast(uint16 color) { return static_cast(color >> 0) / static_cast(65535); } template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_rgbx_cast(uint64 color) { detail::tvec3 result; result.x = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_xrgb_cast(uint64 color) { detail::tvec3 result; result.x = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_bgrx_cast(uint64 color) { detail::tvec3 result; result.x = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_xbgr_cast(uint64 color) { detail::tvec3 result; result.x = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_rgba_cast(uint64 color) { detail::tvec4 result; result.x = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.w = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_argb_cast(uint64 color) { detail::tvec4 result; result.x = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); result.w = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_bgra_cast(uint64 color) { detail::tvec4 result; result.x = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); result.w = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_abgr_cast(uint64 color) { detail::tvec4 result; result.x = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); result.z = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); result.w = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } }//namespace glm