Ticket #116, fixed color casts

This commit is contained in:
Christophe Riccio 2011-08-01 14:21:09 +01:00
parent 2732d4bae5
commit 43eb90b1bf

View File

@ -204,9 +204,9 @@ template <>
GLM_FUNC_QUALIFIER gtc::type_precision::f16vec3 f16_rgbx_cast<gtc::type_precision::uint32>(gtc::type_precision::uint32 color)
{
gtc::type_precision::f16vec3 result;
result.x = gtc::type_precision::f16(static_cast<float>(color >> 0) / static_cast<float>(255));
result.y = gtc::type_precision::f16(static_cast<float>(color >> 8) / static_cast<float>(255));
result.z = gtc::type_precision::f16(static_cast<float>(color >> 16) / static_cast<float>(255));
result.x = gtc::type_precision::f16(static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255));
result.y = gtc::type_precision::f16(static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255));
result.z = gtc::type_precision::f16(static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255));
return result;
}
@ -214,9 +214,9 @@ template <>
GLM_FUNC_QUALIFIER gtc::type_precision::f16vec3 f16_xrgb_cast<gtc::type_precision::uint32>(gtc::type_precision::uint32 color)
{
gtc::type_precision::f16vec3 result;
result.x = gtc::type_precision::f16(static_cast<float>(color >> 8) / static_cast<float>(255));
result.y = gtc::type_precision::f16(static_cast<float>(color >> 16) / static_cast<float>(255));
result.z = gtc::type_precision::f16(static_cast<float>(color >> 24) / static_cast<float>(255));
result.x = gtc::type_precision::f16(static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255));
result.y = gtc::type_precision::f16(static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255));
result.z = gtc::type_precision::f16(static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255));
return result;
}
@ -224,9 +224,9 @@ template <>
GLM_FUNC_QUALIFIER f16vec3 f16_bgrx_cast<uint32>(uint32 color)
{
f16vec3 result;
result.x = f16(static_cast<float>(color >> 16) / static_cast<float>(255));
result.y = f16(static_cast<float>(color >> 8) / static_cast<float>(255));
result.z = f16(static_cast<float>(color >> 0) / static_cast<float>(255));
result.x = f16(static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255));
result.y = f16(static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255));
result.z = f16(static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255));
return result;
}
@ -234,9 +234,9 @@ template <>
GLM_FUNC_QUALIFIER f16vec3 f16_xbgr_cast<uint32>(uint32 color)
{
f16vec3 result;
result.x = f16(static_cast<float>(color >> 24) / static_cast<float>(255));
result.y = f16(static_cast<float>(color >> 16) / static_cast<float>(255));
result.z = f16(static_cast<float>(color >> 8) / static_cast<float>(255));
result.x = f16(static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255));
result.y = f16(static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255));
result.z = f16(static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255));
return result;
}
@ -244,10 +244,10 @@ template <>
GLM_FUNC_QUALIFIER f16vec4 f16_rgba_cast<uint32>(uint32 color)
{
f16vec4 result;
result.x = f16(static_cast<float>(color >> 0) / static_cast<float>(255));
result.y = f16(static_cast<float>(color >> 8) / static_cast<float>(255));
result.z = f16(static_cast<float>(color >> 16) / static_cast<float>(255));
result.w = f16(static_cast<float>(color >> 24) / static_cast<float>(255));
result.x = f16(static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255));
result.y = f16(static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255));
result.z = f16(static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255));
result.w = f16(static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255));
return result;
}
@ -255,10 +255,10 @@ template <>
GLM_FUNC_QUALIFIER f16vec4 f16_argb_cast<uint32>(uint32 color)
{
f16vec4 result;
result.x = f16(static_cast<float>(color >> 8) / static_cast<float>(255));
result.y = f16(static_cast<float>(color >> 16) / static_cast<float>(255));
result.z = f16(static_cast<float>(color >> 24) / static_cast<float>(255));
result.w = f16(static_cast<float>(color >> 0) / static_cast<float>(255));
result.x = f16(static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255));
result.y = f16(static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255));
result.z = f16(static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255));
result.w = f16(static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255));
return result;
}
@ -266,10 +266,10 @@ template <>
GLM_FUNC_QUALIFIER f16vec4 f16_bgra_cast<uint32>(uint32 color)
{
f16vec4 result;
result.x = f16(static_cast<float>(color >> 16) / static_cast<float>(255));
result.y = f16(static_cast<float>(color >> 8) / static_cast<float>(255));
result.z = f16(static_cast<float>(color >> 0) / static_cast<float>(255));
result.w = f16(static_cast<float>(color >> 24) / static_cast<float>(255));
result.x = f16(static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255));
result.y = f16(static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255));
result.z = f16(static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255));
result.w = f16(static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255));
return result;
}
@ -277,10 +277,10 @@ template <>
GLM_FUNC_QUALIFIER f16vec4 f16_abgr_cast<uint32>(uint32 color)
{
f16vec4 result;
result.x = f16(static_cast<float>(color >> 24) / static_cast<float>(255));
result.y = f16(static_cast<float>(color >> 16) / static_cast<float>(255));
result.z = f16(static_cast<float>(color >> 8) / static_cast<float>(255));
result.w = f16(static_cast<float>(color >> 0) / static_cast<float>(255));
result.x = f16(static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255));
result.y = f16(static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255));
result.z = f16(static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255));
result.w = f16(static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255));
return result;
}
@ -294,9 +294,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<float> f32_rgbx_cast<uint32>(uint32 color)
{
detail::tvec3<float> result;
result.x = static_cast<float>(color >> 0) / static_cast<float>(255);
result.y = static_cast<float>(color >> 8) / static_cast<float>(255);
result.z = static_cast<float>(color >> 16) / static_cast<float>(255);
result.x = static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255);
result.y = static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255);
result.z = static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255);
return result;
}
@ -304,9 +304,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<float> f32_xrgb_cast<uint32>(uint32 color)
{
detail::tvec3<float> result;
result.x = static_cast<float>(color >> 8) / static_cast<float>(255);
result.y = static_cast<float>(color >> 16) / static_cast<float>(255);
result.z = static_cast<float>(color >> 24) / static_cast<float>(255);
result.x = static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255);
result.y = static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255);
result.z = static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255);
return result;
}
@ -314,9 +314,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<float> f32_bgrx_cast<uint32>(uint32 color)
{
detail::tvec3<float> result;
result.x = static_cast<float>(color >> 16) / static_cast<float>(255);
result.y = static_cast<float>(color >> 8) / static_cast<float>(255);
result.z = static_cast<float>(color >> 0) / static_cast<float>(255);
result.x = static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255);
result.y = static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255);
result.z = static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255);
return result;
}
@ -324,9 +324,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<float> f32_xbgr_cast<uint32>(uint32 color)
{
detail::tvec3<float> result;
result.x = static_cast<float>(color >> 24) / static_cast<float>(255);
result.y = static_cast<float>(color >> 16) / static_cast<float>(255);
result.z = static_cast<float>(color >> 8) / static_cast<float>(255);
result.x = static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255);
result.y = static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255);
result.z = static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255);
return result;
}
@ -334,10 +334,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<float> f32_rgba_cast<uint32>(uint32 color)
{
detail::tvec4<float> result;
result.x = static_cast<float>(color >> 0) / static_cast<float>(255);
result.y = static_cast<float>(color >> 8) / static_cast<float>(255);
result.z = static_cast<float>(color >> 16) / static_cast<float>(255);
result.w = static_cast<float>(color >> 24) / static_cast<float>(255);
result.x = static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255);
result.y = static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255);
result.z = static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255);
result.w = static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255);
return result;
}
@ -345,10 +345,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<float> f32_argb_cast<uint32>(uint32 color)
{
detail::tvec4<float> result;
result.x = static_cast<float>(color >> 8) / static_cast<float>(255);
result.y = static_cast<float>(color >> 16) / static_cast<float>(255);
result.z = static_cast<float>(color >> 24) / static_cast<float>(255);
result.w = static_cast<float>(color >> 0) / static_cast<float>(255);
result.x = static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255);
result.y = static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255);
result.z = static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255);
result.w = static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255);
return result;
}
@ -367,10 +367,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<float> f32_abgr_cast<uint32>(uint32 color)
{
detail::tvec4<float> result;
result.x = static_cast<float>(color >> 24) / static_cast<float>(255);
result.y = static_cast<float>(color >> 16) / static_cast<float>(255);
result.z = static_cast<float>(color >> 8) / static_cast<float>(255);
result.w = static_cast<float>(color >> 0) / static_cast<float>(255);
result.x = static_cast<float>((color >> 24) & 0xFF) / static_cast<float>(255);
result.y = static_cast<float>((color >> 16) & 0xFF) / static_cast<float>(255);
result.z = static_cast<float>((color >> 8) & 0xFF) / static_cast<float>(255);
result.w = static_cast<float>((color >> 0) & 0xFF) / static_cast<float>(255);
return result;
}
@ -384,9 +384,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<double> f64_rgbx_cast<uint32>(uint32 color)
{
detail::tvec3<double> result;
result.x = static_cast<double>(color >> 0) / static_cast<double>(255);
result.y = static_cast<double>(color >> 8) / static_cast<double>(255);
result.z = static_cast<double>(color >> 16) / static_cast<double>(255);
result.x = static_cast<double>((color >> 0) & 0xFF) / static_cast<double>(255);
result.y = static_cast<double>((color >> 8) & 0xFF) / static_cast<double>(255);
result.z = static_cast<double>((color >> 16) & 0xFF) / static_cast<double>(255);
return result;
}
@ -394,9 +394,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<double> f64_xrgb_cast<uint32>(uint32 color)
{
detail::tvec3<double> result;
result.x = static_cast<double>(color >> 8) / static_cast<double>(255);
result.y = static_cast<double>(color >> 16) / static_cast<double>(255);
result.z = static_cast<double>(color >> 24) / static_cast<double>(255);
result.x = static_cast<double>((color >> 8) & 0xFF) / static_cast<double>(255);
result.y = static_cast<double>((color >> 16) & 0xFF) / static_cast<double>(255);
result.z = static_cast<double>((color >> 24) & 0xFF) / static_cast<double>(255);
return result;
}
@ -404,9 +404,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<double> f64_bgrx_cast<uint32>(uint32 color)
{
detail::tvec3<double> result;
result.x = static_cast<double>(color >> 16) / static_cast<double>(255);
result.y = static_cast<double>(color >> 8) / static_cast<double>(255);
result.z = static_cast<double>(color >> 0) / static_cast<double>(255);
result.x = static_cast<double>((color >> 16) & 0xFF) / static_cast<double>(255);
result.y = static_cast<double>((color >> 8) & 0xFF) / static_cast<double>(255);
result.z = static_cast<double>((color >> 0) & 0xFF) / static_cast<double>(255);
return result;
}
@ -414,9 +414,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<double> f64_xbgr_cast<uint32>(uint32 color)
{
detail::tvec3<double> result;
result.x = static_cast<double>(color >> 24) / static_cast<double>(255);
result.y = static_cast<double>(color >> 16) / static_cast<double>(255);
result.z = static_cast<double>(color >> 8) / static_cast<double>(255);
result.x = static_cast<double>((color >> 24) & 0xFF) / static_cast<double>(255);
result.y = static_cast<double>((color >> 16) & 0xFF) / static_cast<double>(255);
result.z = static_cast<double>((color >> 8) & 0xFF) / static_cast<double>(255);
return result;
}
@ -424,10 +424,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<double> f64_rgba_cast<uint32>(uint32 color)
{
detail::tvec4<double> result;
result.x = static_cast<double>(color >> 0) / static_cast<double>(255);
result.y = static_cast<double>(color >> 8) / static_cast<double>(255);
result.z = static_cast<double>(color >> 16) / static_cast<double>(255);
result.w = static_cast<double>(color >> 24) / static_cast<double>(255);
result.x = static_cast<double>((color >> 0) & 0xFF) / static_cast<double>(255);
result.y = static_cast<double>((color >> 8) & 0xFF) / static_cast<double>(255);
result.z = static_cast<double>((color >> 16) & 0xFF) / static_cast<double>(255);
result.w = static_cast<double>((color >> 24) & 0xFF) / static_cast<double>(255);
return result;
}
@ -435,10 +435,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<double> f64_argb_cast<uint32>(uint32 color)
{
detail::tvec4<double> result;
result.x = static_cast<double>(color >> 8) / static_cast<double>(255);
result.y = static_cast<double>(color >> 16) / static_cast<double>(255);
result.z = static_cast<double>(color >> 24) / static_cast<double>(255);
result.w = static_cast<double>(color >> 0) / static_cast<double>(255);
result.x = static_cast<double>((color >> 8) & 0xFF) / static_cast<double>(255);
result.y = static_cast<double>((color >> 16) & 0xFF) / static_cast<double>(255);
result.z = static_cast<double>((color >> 24) & 0xFF) / static_cast<double>(255);
result.w = static_cast<double>((color >> 0) & 0xFF) / static_cast<double>(255);
return result;
}
@ -446,10 +446,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<double> f64_bgra_cast<uint32>(uint32 color)
{
detail::tvec4<double> result;
result.x = static_cast<double>(color >> 16) / static_cast<double>(255);
result.y = static_cast<double>(color >> 8) / static_cast<double>(255);
result.z = static_cast<double>(color >> 0) / static_cast<double>(255);
result.w = static_cast<double>(color >> 24) / static_cast<double>(255);
result.x = static_cast<double>((color >> 16) & 0xFF) / static_cast<double>(255);
result.y = static_cast<double>((color >> 8) & 0xFF) / static_cast<double>(255);
result.z = static_cast<double>((color >> 0) & 0xFF) / static_cast<double>(255);
result.w = static_cast<double>((color >> 24) & 0xFF) / static_cast<double>(255);
return result;
}
@ -457,10 +457,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<double> f64_abgr_cast<uint32>(uint32 color)
{
detail::tvec4<double> result;
result.x = static_cast<double>(color >> 24) / static_cast<double>(255);
result.y = static_cast<double>(color >> 16) / static_cast<double>(255);
result.z = static_cast<double>(color >> 8) / static_cast<double>(255);
result.w = static_cast<double>(color >> 0) / static_cast<double>(255);
result.x = static_cast<double>((color >> 24) & 0xFF) / static_cast<double>(255);
result.y = static_cast<double>((color >> 16) & 0xFF) / static_cast<double>(255);
result.z = static_cast<double>((color >> 8) & 0xFF) / static_cast<double>(255);
result.w = static_cast<double>((color >> 0) & 0xFF) / static_cast<double>(255);
return result;
}
@ -474,9 +474,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<detail::thalf> f16_rgbx_cast<uint64>(uint64 color)
{
detail::tvec3<detail::thalf> result;
result.x = detail::thalf(static_cast<float>(color >> 0) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));
result.x = detail::thalf(static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535));
return result;
}
@ -484,9 +484,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<detail::thalf> f16_xrgb_cast<uint64>(uint64 color)
{
detail::tvec3<detail::thalf> result;
result.x = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));
result.x = detail::thalf(static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535));
return result;
}
@ -494,9 +494,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<detail::thalf> f16_bgrx_cast<uint64>(uint64 color)
{
detail::tvec3<detail::thalf> result;
result.x = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>(color >> 0) / static_cast<float>(65535));
result.x = detail::thalf(static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535));
return result;
}
@ -504,9 +504,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<detail::thalf> f16_xbgr_cast<uint64>(uint64 color)
{
detail::tvec3<detail::thalf> result;
result.x = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));
result.x = detail::thalf(static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535));
return result;
}
@ -514,10 +514,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<detail::thalf> f16_rgba_cast<uint64>(uint64 color)
{
detail::tvec4<detail::thalf> result;
result.x = detail::thalf(static_cast<float>(color >> 0) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));
result.w = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));
result.x = detail::thalf(static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535));
result.w = detail::thalf(static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535));
return result;
}
@ -525,10 +525,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<detail::thalf> f16_argb_cast<uint64>(uint64 color)
{
detail::tvec4<detail::thalf> result;
result.x = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));
result.w = detail::thalf(static_cast<float>(color >> 0) / static_cast<float>(65535));
result.x = detail::thalf(static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535));
result.w = detail::thalf(static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535));
return result;
}
@ -536,10 +536,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<detail::thalf> f16_bgra_cast<uint64>(uint64 color)
{
detail::tvec4<detail::thalf> result;
result.x = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>(color >> 0) / static_cast<float>(65535));
result.w = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));
result.x = detail::thalf(static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535));
result.w = detail::thalf(static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535));
return result;
}
@ -547,10 +547,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<detail::thalf> f16_abgr_cast<uint64>(uint64 color)
{
detail::tvec4<detail::thalf> result;
result.x = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));
result.w = detail::thalf(static_cast<float>(color >> 0) / static_cast<float>(65535));
result.x = detail::thalf(static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535));
result.y = detail::thalf(static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535));
result.z = detail::thalf(static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535));
result.w = detail::thalf(static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535));
return result;
}
@ -564,9 +564,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<float> f32_rgbx_cast<uint64>(uint64 color)
{
detail::tvec3<float> result;
result.x = static_cast<float>(color >> 0) / static_cast<float>(65535);
result.y = static_cast<float>(color >> 16) / static_cast<float>(65535);
result.z = static_cast<float>(color >> 32) / static_cast<float>(65535);
result.x = static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535);
result.y = static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535);
result.z = static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535);
return result;
}
@ -574,9 +574,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<float> f32_xrgb_cast<uint64>(uint64 color)
{
detail::tvec3<float> result;
result.x = static_cast<float>(color >> 16) / static_cast<float>(65535);
result.y = static_cast<float>(color >> 32) / static_cast<float>(65535);
result.z = static_cast<float>(color >> 48) / static_cast<float>(65535);
result.x = static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535);
result.y = static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535);
result.z = static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535);
return result;
}
@ -584,9 +584,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<float> f32_bgrx_cast<uint64>(uint64 color)
{
detail::tvec3<float> result;
result.x = static_cast<float>(color >> 32) / static_cast<float>(65535);
result.y = static_cast<float>(color >> 16) / static_cast<float>(65535);
result.z = static_cast<float>(color >> 0) / static_cast<float>(65535);
result.x = static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535);
result.y = static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535);
result.z = static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535);
return result;
}
@ -594,9 +594,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<float> f32_xbgr_cast<uint64>(uint64 color)
{
detail::tvec3<float> result;
result.x = static_cast<float>(color >> 48) / static_cast<float>(65535);
result.y = static_cast<float>(color >> 32) / static_cast<float>(65535);
result.z = static_cast<float>(color >> 16) / static_cast<float>(65535);
result.x = static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535);
result.y = static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535);
result.z = static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535);
return result;
}
@ -604,10 +604,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<float> f32_rgba_cast<uint64>(uint64 color)
{
detail::tvec4<float> result;
result.x = static_cast<float>(color >> 0) / static_cast<float>(65535);
result.y = static_cast<float>(color >> 16) / static_cast<float>(65535);
result.z = static_cast<float>(color >> 32) / static_cast<float>(65535);
result.w = static_cast<float>(color >> 48) / static_cast<float>(65535);
result.x = static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535);
result.y = static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535);
result.z = static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535);
result.w = static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535);
return result;
}
@ -615,10 +615,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<float> f32_argb_cast<uint64>(uint64 color)
{
detail::tvec4<float> result;
result.x = static_cast<float>(color >> 16) / static_cast<float>(65535);
result.y = static_cast<float>(color >> 32) / static_cast<float>(65535);
result.z = static_cast<float>(color >> 48) / static_cast<float>(65535);
result.w = static_cast<float>(color >> 0) / static_cast<float>(65535);
result.x = static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535);
result.y = static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535);
result.z = static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535);
result.w = static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535);
return result;
}
@ -626,10 +626,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<float> f32_bgra_cast<uint64>(uint64 color)
{
detail::tvec4<float> result;
result.x = static_cast<float>(color >> 32) / static_cast<float>(65535);
result.y = static_cast<float>(color >> 16) / static_cast<float>(65535);
result.z = static_cast<float>(color >> 0) / static_cast<float>(65535);
result.w = static_cast<float>(color >> 48) / static_cast<float>(65535);
result.x = static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535);
result.y = static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535);
result.z = static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535);
result.w = static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535);
return result;
}
@ -637,10 +637,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<float> f32_abgr_cast<uint64>(uint64 color)
{
detail::tvec4<float> result;
result.x = static_cast<float>(color >> 48) / static_cast<float>(65535);
result.y = static_cast<float>(color >> 32) / static_cast<float>(65535);
result.z = static_cast<float>(color >> 16) / static_cast<float>(65535);
result.w = static_cast<float>(color >> 0) / static_cast<float>(65535);
result.x = static_cast<float>((color >> 48) & 0xFFFF) / static_cast<float>(65535);
result.y = static_cast<float>((color >> 32) & 0xFFFF) / static_cast<float>(65535);
result.z = static_cast<float>((color >> 16) & 0xFFFF) / static_cast<float>(65535);
result.w = static_cast<float>((color >> 0) & 0xFFFF) / static_cast<float>(65535);
return result;
}
@ -654,9 +654,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<double> f64_rgbx_cast<uint64>(uint64 color)
{
detail::tvec3<double> result;
result.x = static_cast<double>(color >> 0) / static_cast<double>(65535);
result.y = static_cast<double>(color >> 16) / static_cast<double>(65535);
result.z = static_cast<double>(color >> 32) / static_cast<double>(65535);
result.x = static_cast<double>((color >> 0) & 0xFFFF) / static_cast<double>(65535);
result.y = static_cast<double>((color >> 16) & 0xFFFF) / static_cast<double>(65535);
result.z = static_cast<double>((color >> 32) & 0xFFFF) / static_cast<double>(65535);
return result;
}
@ -664,9 +664,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<double> f64_xrgb_cast<uint64>(uint64 color)
{
detail::tvec3<double> result;
result.x = static_cast<double>(color >> 16) / static_cast<double>(65535);
result.y = static_cast<double>(color >> 32) / static_cast<double>(65535);
result.z = static_cast<double>(color >> 48) / static_cast<double>(65535);
result.x = static_cast<double>((color >> 16) & 0xFFFF) / static_cast<double>(65535);
result.y = static_cast<double>((color >> 32) & 0xFFFF) / static_cast<double>(65535);
result.z = static_cast<double>((color >> 48) & 0xFFFF) / static_cast<double>(65535);
return result;
}
@ -674,9 +674,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<double> f64_bgrx_cast<uint64>(uint64 color)
{
detail::tvec3<double> result;
result.x = static_cast<double>(color >> 32) / static_cast<double>(65535);
result.y = static_cast<double>(color >> 16) / static_cast<double>(65535);
result.z = static_cast<double>(color >> 0) / static_cast<double>(65535);
result.x = static_cast<double>((color >> 32) & 0xFFFF) / static_cast<double>(65535);
result.y = static_cast<double>((color >> 16) & 0xFFFF) / static_cast<double>(65535);
result.z = static_cast<double>((color >> 0) & 0xFFFF) / static_cast<double>(65535);
return result;
}
@ -684,9 +684,9 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec3<double> f64_xbgr_cast<uint64>(uint64 color)
{
detail::tvec3<double> result;
result.x = static_cast<double>(color >> 48) / static_cast<double>(65535);
result.y = static_cast<double>(color >> 32) / static_cast<double>(65535);
result.z = static_cast<double>(color >> 16) / static_cast<double>(65535);
result.x = static_cast<double>((color >> 48) & 0xFFFF) / static_cast<double>(65535);
result.y = static_cast<double>((color >> 32) & 0xFFFF) / static_cast<double>(65535);
result.z = static_cast<double>((color >> 16) & 0xFFFF) / static_cast<double>(65535);
return result;
}
@ -694,10 +694,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<double> f64_rgba_cast<uint64>(uint64 color)
{
detail::tvec4<double> result;
result.x = static_cast<double>(color >> 0) / static_cast<double>(65535);
result.y = static_cast<double>(color >> 16) / static_cast<double>(65535);
result.z = static_cast<double>(color >> 32) / static_cast<double>(65535);
result.w = static_cast<double>(color >> 48) / static_cast<double>(65535);
result.x = static_cast<double>((color >> 0) & 0xFFFF) / static_cast<double>(65535);
result.y = static_cast<double>((color >> 16) & 0xFFFF) / static_cast<double>(65535);
result.z = static_cast<double>((color >> 32) & 0xFFFF) / static_cast<double>(65535);
result.w = static_cast<double>((color >> 48) & 0xFFFF) / static_cast<double>(65535);
return result;
}
@ -705,10 +705,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<double> f64_argb_cast<uint64>(uint64 color)
{
detail::tvec4<double> result;
result.x = static_cast<double>(color >> 16) / static_cast<double>(65535);
result.y = static_cast<double>(color >> 32) / static_cast<double>(65535);
result.z = static_cast<double>(color >> 48) / static_cast<double>(65535);
result.w = static_cast<double>(color >> 0) / static_cast<double>(65535);
result.x = static_cast<double>((color >> 16) & 0xFFFF) / static_cast<double>(65535);
result.y = static_cast<double>((color >> 32) & 0xFFFF) / static_cast<double>(65535);
result.z = static_cast<double>((color >> 48) & 0xFFFF) / static_cast<double>(65535);
result.w = static_cast<double>((color >> 0) & 0xFFFF) / static_cast<double>(65535);
return result;
}
@ -716,10 +716,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<double> f64_bgra_cast<uint64>(uint64 color)
{
detail::tvec4<double> result;
result.x = static_cast<double>(color >> 32) / static_cast<double>(65535);
result.y = static_cast<double>(color >> 16) / static_cast<double>(65535);
result.z = static_cast<double>(color >> 0) / static_cast<double>(65535);
result.w = static_cast<double>(color >> 48) / static_cast<double>(65535);
result.x = static_cast<double>((color >> 32) & 0xFFFF) / static_cast<double>(65535);
result.y = static_cast<double>((color >> 16) & 0xFFFF) / static_cast<double>(65535);
result.z = static_cast<double>((color >> 0) & 0xFFFF) / static_cast<double>(65535);
result.w = static_cast<double>((color >> 48) & 0xFFFF) / static_cast<double>(65535);
return result;
}
@ -727,10 +727,10 @@ template <>
GLM_FUNC_QUALIFIER detail::tvec4<double> f64_abgr_cast<uint64>(uint64 color)
{
detail::tvec4<double> result;
result.x = static_cast<double>(color >> 48) / static_cast<double>(65535);
result.y = static_cast<double>(color >> 32) / static_cast<double>(65535);
result.z = static_cast<double>(color >> 16) / static_cast<double>(65535);
result.w = static_cast<double>(color >> 0) / static_cast<double>(65535);
result.x = static_cast<double>((color >> 48) & 0xFFFF) / static_cast<double>(65535);
result.y = static_cast<double>((color >> 32) & 0xFFFF) / static_cast<double>(65535);
result.z = static_cast<double>((color >> 16) & 0xFFFF) / static_cast<double>(65535);
result.w = static_cast<double>((color >> 0) & 0xFFFF) / static_cast<double>(65535);
return result;
}