Removed GTC extensions namespace

This commit is contained in:
Christophe Riccio 2011-06-07 01:13:51 +01:00
parent 5acf2d84a0
commit 493c5a5614
21 changed files with 199 additions and 258 deletions

View File

@ -342,8 +342,7 @@ namespace detail
} }
//namespace detail //namespace detail
namespace gtc{ namespace gtc
namespace half_float ///< GLM_GTC_half_float extension: Add support for half precision floating-point types
{ {
/// \addtogroup gtc_half_float /// \addtogroup gtc_half_float
/// @{ /// @{
@ -413,13 +412,9 @@ namespace half_float ///< GLM_GTC_half_float extension: Add support for half pre
typedef detail::tmat4x4<detail::thalf> hmat4x4; typedef detail::tmat4x4<detail::thalf> hmat4x4;
/// @} /// @}
}// namespace half_float
}// namespace gtc }// namespace gtc
}// namespace glm }// namespace glm
#include "half_float.inl" #include "half_float.inl"
namespace glm{using namespace gtc::half_float;}
#endif//glm_gtc_half_float #endif//glm_gtc_half_float

View File

@ -40,8 +40,7 @@
namespace glm{ namespace glm{
namespace gtc{ namespace gtc{
namespace matrix_access ///< GLM_GTC_matrix_access extension: Set a column or a row of a matrix
{
/// @addtogroup gtc_matrix_access /// @addtogroup gtc_matrix_access
/// @{ /// @{
@ -76,12 +75,9 @@ namespace matrix_access ///< GLM_GTC_matrix_access extension: Set a column or a
typename genType::col_type const & x); typename genType::col_type const & x);
/// @} /// @}
}//namespace matrix_access
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm
#include "matrix_access.inl" #include "matrix_access.inl"
namespace glm{using namespace gtc::matrix_access;}
#endif//glm_gtc_matrix_access #endif//glm_gtc_matrix_access

View File

@ -40,8 +40,7 @@
namespace glm{ namespace glm{
namespace gtc{ namespace gtc{
namespace matrix_integer ///< GLM_GTC_matrix_integer extension: Add integer matrices
{
/// \addtogroup gtc_matrix_integer /// \addtogroup gtc_matrix_integer
/// @{ /// @{
@ -211,12 +210,8 @@ namespace matrix_integer ///< GLM_GTC_matrix_integer extension: Add integer matr
typedef mediump_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) typedef mediump_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
#endif//GLM_PRECISION #endif//GLM_PRECISION
///@} /// @}
}//namespace matrix_integer
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm
namespace glm{using namespace gtc::matrix_integer;}
#endif//glm_gtc_matrix_integer #endif//glm_gtc_matrix_integer

View File

@ -40,10 +40,9 @@
namespace glm{ namespace glm{
namespace gtc{ namespace gtc{
namespace matrix_inverse ///< GLM_GTC_matrix_inverse extension: Inverse matrix functions
{ /// @addtogroup gtc_matrix_inverse
/// \addtogroup gtc_matrix_inverse /// @{
///@{
//! Fast matrix inverse for affine matrix. //! Fast matrix inverse for affine matrix.
//! From GLM_GTC_matrix_inverse extension. //! From GLM_GTC_matrix_inverse extension.
@ -56,14 +55,10 @@ namespace matrix_inverse ///< GLM_GTC_matrix_inverse extension: Inverse matrix f
GLM_FUNC_QUALIFIER typename genType::value_type inverseTranspose( GLM_FUNC_QUALIFIER typename genType::value_type inverseTranspose(
genType const & m); genType const & m);
///@} /// @}
}//namespace matrix_inverse
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm
#include "matrix_inverse.inl" #include "matrix_inverse.inl"
namespace glm{using namespace gtc::matrix_inverse;}
#endif//glm_gtc_matrix_inverse #endif//glm_gtc_matrix_inverse

View File

@ -9,8 +9,7 @@
namespace glm{ namespace glm{
namespace gtc{ namespace gtc{
namespace matrix_inverse
{
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> affineInverse GLM_FUNC_QUALIFIER detail::tmat3x3<T> affineInverse
( (
@ -134,6 +133,5 @@ namespace matrix_inverse
return Inverse; return Inverse;
} }
}//namespace matrix_inverse
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm

View File

@ -42,8 +42,7 @@
namespace glm{ namespace glm{
namespace gtc{ namespace gtc{
namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transformation matrices
{
/// @addtogroup gtc_matrix_transform /// @addtogroup gtc_matrix_transform
/// @{ /// @{
@ -83,7 +82,7 @@ namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transfor
/// Creates a matrix for an orthographic parallel viewing volume. /// Creates a matrix for an orthographic parallel viewing volume.
/// @see - gtc_matrix_transform: /// @see - gtc_matrix_transform:
/// - @link glm::gtc::matrix_transform::ortho(T const & left, T const & right, T const & bottom, T const & top) ortho(T const & left, T const & right, T const & bottom, T const & top) @endlink /// - @link glm::gtc::ortho(T const & left, T const & right, T const & bottom, T const & top) ortho(T const & left, T const & right, T const & bottom, T const & top) @endlink
template <typename T> template <typename T>
detail::tmat4x4<T> ortho( detail::tmat4x4<T> ortho(
T const & left, T const & left,
@ -95,7 +94,7 @@ namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transfor
/// Creates a matrix for projecting two-dimensional coordinates onto the screen. /// Creates a matrix for projecting two-dimensional coordinates onto the screen.
/// @see - gtc_matrix_transform: /// @see - gtc_matrix_transform:
/// - @link glm::gtc::matrix_transform::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) @endlink /// - @link glm::gtc::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) @endlink
template <typename T> template <typename T>
detail::tmat4x4<T> ortho( detail::tmat4x4<T> ortho(
T const & left, T const & left,
@ -184,12 +183,9 @@ namespace matrix_transform ///< GLM_GTC_matrix_transform extension: Add transfor
detail::tvec3<T> const & up); detail::tvec3<T> const & up);
/// @} /// @}
}//namespace matrix_transform
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm
#include "matrix_transform.inl" #include "matrix_transform.inl"
namespace glm{using namespace gtc::matrix_transform;}
#endif//glm_gtc_matrix_transform #endif//glm_gtc_matrix_transform

View File

@ -9,8 +9,7 @@
namespace glm{ namespace glm{
namespace gtc{ namespace gtc{
namespace matrix_transform
{
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate
( (
@ -390,8 +389,8 @@ namespace matrix_transform
Result[3][1] =-dot(y, eye); Result[3][1] =-dot(y, eye);
Result[3][2] = dot(f, eye); Result[3][2] = dot(f, eye);
*/ */
return gtc::matrix_transform::translate(Result, -eye); return gtc::translate(Result, -eye);
} }
}//namespace matrix_transform
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm

View File

@ -144,10 +144,9 @@ namespace detail
} //namespace detail } //namespace detail
namespace gtc{ namespace gtc{
namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and functions
{ /// @addtogroup gtc_quaternion
/// \addtogroup gtc_quaternion /// @{
///@{
//! Returns the length of the quaternion. //! Returns the length of the quaternion.
//! From GLM_GTC_quaternion extension. //! From GLM_GTC_quaternion extension.
@ -249,12 +248,9 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun
typedef detail::tquat<highp_float> highp_quat; typedef detail::tquat<highp_float> highp_quat;
/// @} /// @}
} //namespace quaternion
} //namespace gtc } //namespace gtc
} //namespace glm } //namespace glm
#include "quaternion.inl" #include "quaternion.inl"
namespace glm{using namespace gtc::quaternion;}
#endif//glm_gtc_quaternion #endif//glm_gtc_quaternion

View File

@ -211,7 +211,7 @@ namespace detail{
detail::tquat<T> const & q detail::tquat<T> const & q
) )
{ {
return gtc::quaternion::inverse(q) * v; return gtc::inverse(q) * v;
} }
template <typename T> template <typename T>
@ -231,7 +231,7 @@ namespace detail{
detail::tquat<T> const & q detail::tquat<T> const & q
) )
{ {
return gtc::quaternion::inverse(q) * v; return gtc::inverse(q) * v;
} }
template <typename T> template <typename T>
@ -292,7 +292,6 @@ namespace detail{
}//namespace detail }//namespace detail
namespace gtc{ namespace gtc{
namespace quaternion{
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
template <typename T> template <typename T>
@ -448,7 +447,7 @@ namespace quaternion{
detail::tquat<T> const & q detail::tquat<T> const & q
) )
{ {
return gtc::quaternion::conjugate(q) / gtc::quaternion::dot(q, q); return gtc::conjugate(q) / gtc::dot(q, q);
} }
template <typename T> template <typename T>
@ -474,7 +473,7 @@ namespace quaternion{
typename detail::tquat<T>::value_type AngleRad = radians(angle); typename detail::tquat<T>::value_type AngleRad = radians(angle);
typename detail::tquat<T>::value_type fSin = sin(AngleRad * T(0.5)); typename detail::tquat<T>::value_type fSin = sin(AngleRad * T(0.5));
return gtc::quaternion::cross(q, detail::tquat<T>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); return gtc::cross(q, detail::tquat<T>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin));
} }
template <typename T> template <typename T>
@ -579,6 +578,5 @@ namespace quaternion{
return quat_cast(detail::tmat3x3<T>(m4)); return quat_cast(detail::tmat3x3<T>(m4));
} }
}//namespace quaternion
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm

View File

@ -42,8 +42,6 @@
namespace glm{ namespace glm{
namespace gtc namespace gtc
{ {
using namespace gtc::half_float;
template <typename T, template <typename> class vecType> template <typename T, template <typename> class vecType>
T const & swizzle( T const & swizzle(
vecType<T> const & v, vecType<T> const & v,
@ -360,7 +358,6 @@ namespace gtc
static_swizzle4_ref(glm::u32, 4) static_swizzle4_ref(glm::u32, 4)
static_swizzle4_ref(glm::u64, 4) static_swizzle4_ref(glm::u64, 4)
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm

View File

@ -44,19 +44,12 @@
namespace glm{ namespace glm{
namespace gtc{ namespace gtc{
namespace type_precision ///< GLM_GTC_type_precision extension: Defined types with specific size.
{
///////////////////////////
// Dependences
using namespace gtc::half_float;
using namespace gtc::quaternion;
/////////////////////////// ///////////////////////////
// Signed int vector types // Signed int vector types
/// \addtogroup gtc_type_precision /// @addtogroup gtc_type_precision
///@{ /// @{
typedef detail::int8 int8; //!< \brief 8bit signed integer. (from GLM_GTC_type_precision extension) typedef detail::int8 int8; //!< \brief 8bit signed integer. (from GLM_GTC_type_precision extension)
typedef detail::int16 int16; //!< \brief 16bit signed integer. (from GLM_GTC_type_precision extension) typedef detail::int16 int16; //!< \brief 16bit signed integer. (from GLM_GTC_type_precision extension)
@ -225,14 +218,10 @@ namespace type_precision ///< GLM_GTC_type_precision extension: Defined types wi
typedef detail::tquat<f32> f32quat; //!< \brief Single-precision floating-point quaternion. (from GLM_GTC_type_precision extension) typedef detail::tquat<f32> f32quat; //!< \brief Single-precision floating-point quaternion. (from GLM_GTC_type_precision extension)
typedef detail::tquat<f64> f64quat; //!< \brief Double-precision floating-point quaternion. (from GLM_GTC_type_precision extension) typedef detail::tquat<f64> f64quat; //!< \brief Double-precision floating-point quaternion. (from GLM_GTC_type_precision extension)
///@} /// @}
}//namespace type_precision
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm
#include "type_precision.inl" #include "type_precision.inl"
namespace glm{using namespace gtc::type_precision;}
#endif//glm_gtc_type_precision #endif//glm_gtc_type_precision

View File

@ -45,13 +45,11 @@
namespace glm{ namespace glm{
namespace gtc{ namespace gtc{
namespace type_ptr ///< GLM_GTC_type_ptr extension: Get access to vectors & matrices value type address. /// @addtogroup gtc_type_ptr
{ /// @{
/// \addtogroup gtc_type_ptr
///@{
//! Return the constant address to the data of the input parameter. /// Return the constant address to the data of the input parameter.
//! From GLM_GTC_type_ptr extension. /// From GLM_GTC_type_ptr extension.
template<typename T> template<typename T>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
@ -477,13 +475,10 @@ namespace type_ptr ///< GLM_GTC_type_ptr extension: Get access to vectors & matr
} }
/// @} /// @}
}//namespace type_ptr
}//namespace gtc }//namespace gtc
}//namespace glm }//namespace glm
#include "type_ptr.inl" #include "type_ptr.inl"
namespace glm{using namespace gtc::type_ptr;}
#endif//glm_gtx_type_ptr #endif//glm_gtx_type_ptr

View File

@ -26,8 +26,6 @@ namespace glm{
namespace gtx{ namespace gtx{
namespace bit ///< GLM_GTX_bit extension: Allow to perform bit operations on integer values namespace bit ///< GLM_GTX_bit extension: Allow to perform bit operations on integer values
{ {
using namespace gtc::half_float;
/// \addtogroup gtx_bit /// \addtogroup gtx_bit
/// @{ /// @{

View File

@ -62,13 +62,13 @@ GLM_FUNC_QUALIFIER detail::tvec4<valIType> mask
template <typename genIType> template <typename genIType>
GLM_FUNC_QUALIFIER genIType extractField GLM_FUNC_QUALIFIER genIType extractField
( (
gtc::half_float::half const & value, gtc::half const & value,
genIType const & first, genIType const & first,
genIType const & count genIType const & count
) )
{ {
assert(first + count < sizeof(gtc::half_float::half)); assert(first + count < sizeof(gtc::half));
return (value._data() << first) >> ((sizeof(gtc::half_float::half) << 3) - count); return (value._data() << first) >> ((sizeof(gtc::half) << 3) - count);
} }
template <typename genIType> template <typename genIType>

View File

@ -33,67 +33,67 @@ namespace color_cast ///< GLM_GTX_color_cast extension: Conversion between two c
//! Conversion of a floating value into a 8bit unsigned int value. //! Conversion of a floating value into a 8bit unsigned int value.
//! From GLM_GTX_color_cast extension. //! From GLM_GTX_color_cast extension.
template <typename valType> gtc::type_precision::uint8 u8channel_cast(valType a); template <typename valType> gtc::uint8 u8channel_cast(valType a);
//! Conversion of a floating value into a 16bit unsigned int value. //! Conversion of a floating value into a 16bit unsigned int value.
//! From GLM_GTX_color_cast extension. //! From GLM_GTX_color_cast extension.
template <typename valType> gtc::type_precision::uint16 u16channel_cast(valType a); template <typename valType> gtc::uint16 u16channel_cast(valType a);
template <typename T> gtc::type_precision::uint32 u32_rgbx_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint32 u32_rgbx_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint32 u32_xrgb_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint32 u32_xrgb_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint32 u32_bgrx_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint32 u32_bgrx_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint32 u32_xbgr_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint32 u32_xbgr_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint32 u32_rgba_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint32 u32_rgba_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint32 u32_argb_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint32 u32_argb_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint32 u32_bgra_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint32 u32_bgra_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint32 u32_abgr_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint32 u32_abgr_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint64 u64_rgbx_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint64 u64_rgbx_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint64 u64_xrgb_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint64 u64_xrgb_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint64 u64_bgrx_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint64 u64_bgrx_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint64 u64_xbgr_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint64 u64_xbgr_cast(const detail::tvec3<T>& c); //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint64 u64_rgba_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint64 u64_rgba_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint64 u64_argb_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint64 u64_argb_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint64 u64_bgra_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint64 u64_bgra_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::uint64 u64_abgr_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) template <typename T> gtc::uint64 u64_abgr_cast(const detail::tvec4<T>& c); //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)
template <typename T> gtx::number_precision::f16vec1 f16_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) template <typename T> gtx::number_precision::f16vec1 f16_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f16vec3 f16_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f16vec3 f16_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f16vec3 f16_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f16vec3 f16_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f16vec3 f16_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f16vec3 f16_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f16vec3 f16_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f16vec3 f16_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f16vec4 f16_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f16vec4 f16_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f16vec4 f16_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f16vec4 f16_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f16vec4 f16_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f16vec4 f16_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f16vec4 f16_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f16vec4 f16_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtx::number_precision::f32vec1 f32_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) template <typename T> gtx::number_precision::f32vec1 f32_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f32vec3 f32_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f32vec3 f32_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f32vec3 f32_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f32vec3 f32_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f32vec3 f32_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f32vec3 f32_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f32vec3 f32_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f32vec3 f32_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f32vec4 f32_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f32vec4 f32_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f32vec4 f32_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f32vec4 f32_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f32vec4 f32_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f32vec4 f32_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f32vec4 f32_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f32vec4 f32_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtx::number_precision::f64vec1 f64_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) template <typename T> gtx::number_precision::f64vec1 f64_channel_cast(T a); //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f64vec3 f64_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f64vec3 f64_rgbx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f64vec3 f64_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f64vec3 f64_xrgb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f64vec3 f64_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f64vec3 f64_bgrx_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f64vec3 f64_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f64vec3 f64_xbgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f64vec4 f64_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f64vec4 f64_rgba_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f64vec4 f64_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f64vec4 f64_argb_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f64vec4 f64_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f64vec4 f64_bgra_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
template <typename T> gtc::type_precision::f64vec4 f64_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) template <typename T> gtc::f64vec4 f64_abgr_cast(T c); //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)
/// @} /// @}
}//namespace color_space }//namespace color_space

View File

@ -13,210 +13,210 @@ namespace gtx{
namespace color_cast{ namespace color_cast{
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint8 u8channel_cast(T a) GLM_FUNC_QUALIFIER gtc::uint8 u8channel_cast(T a)
{ {
return static_cast<gtc::type_precision::uint8>(a * T(255)); return static_cast<gtc::uint8>(a * T(255));
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint16 u16channel_cast(T a) GLM_FUNC_QUALIFIER gtc::uint16 u16channel_cast(T a)
{ {
return static_cast<gtc::type_precision::uint16>(a * T(65535)); return static_cast<gtc::uint16>(a * T(65535));
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_rgbx_cast(const detail::tvec3<T>& c) GLM_FUNC_QUALIFIER gtc::uint32 u32_rgbx_cast(const detail::tvec3<T>& c)
{ {
gtc::type_precision::uint32 result = 0; gtc::uint32 result = 0;
result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 0; result += static_cast<gtc::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 0;
result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 8; result += static_cast<gtc::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 8;
result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 16; result += static_cast<gtc::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 16;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_xrgb_cast(const detail::tvec3<T>& c) GLM_FUNC_QUALIFIER gtc::uint32 u32_xrgb_cast(const detail::tvec3<T>& c)
{ {
gtc::type_precision::uint32 result = 0; gtc::uint32 result = 0;
result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 8; result += static_cast<gtc::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 8;
result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 16; result += static_cast<gtc::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 16;
result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 24; result += static_cast<gtc::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 24;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_bgrx_cast(const detail::tvec3<T>& c) GLM_FUNC_QUALIFIER gtc::uint32 u32_bgrx_cast(const detail::tvec3<T>& c)
{ {
gtc::type_precision::uint32 result = 0; gtc::uint32 result = 0;
result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 16; result += static_cast<gtc::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 16;
result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 8; result += static_cast<gtc::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 8;
result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 0; result += static_cast<gtc::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 0;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_xbgr_cast(const detail::tvec3<T>& c) GLM_FUNC_QUALIFIER gtc::uint32 u32_xbgr_cast(const detail::tvec3<T>& c)
{ {
gtc::type_precision::uint32 result = 0; gtc::uint32 result = 0;
result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 24; result += static_cast<gtc::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 24;
result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 16; result += static_cast<gtc::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 16;
result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 8; result += static_cast<gtc::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 8;
result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec3<T>::value_type(255)) << 0; result += static_cast<gtc::uint32>(c.w * detail::tvec3<T>::value_type(255)) << 0;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_rgba_cast(const detail::tvec4<T>& c) GLM_FUNC_QUALIFIER gtc::uint32 u32_rgba_cast(const detail::tvec4<T>& c)
{ {
gtc::type_precision::uint32 result = 0; gtc::uint32 result = 0;
result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 0; result += static_cast<gtc::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 0;
result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 8; result += static_cast<gtc::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 8;
result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 16; result += static_cast<gtc::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 16;
result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 24; result += static_cast<gtc::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 24;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_argb_cast(const detail::tvec4<T>& c) GLM_FUNC_QUALIFIER gtc::uint32 u32_argb_cast(const detail::tvec4<T>& c)
{ {
gtc::type_precision::uint32 result = 0; gtc::uint32 result = 0;
result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 8; result += static_cast<gtc::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 8;
result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 16; result += static_cast<gtc::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 16;
result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 24; result += static_cast<gtc::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 24;
result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 0; result += static_cast<gtc::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 0;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_bgra_cast(const detail::tvec4<T>& c) GLM_FUNC_QUALIFIER gtc::uint32 u32_bgra_cast(const detail::tvec4<T>& c)
{ {
gtc::type_precision::uint32 result = 0; gtc::uint32 result = 0;
result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 16; result += static_cast<gtc::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 16;
result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 8; result += static_cast<gtc::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 8;
result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 0; result += static_cast<gtc::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 0;
result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 24; result += static_cast<gtc::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 24;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint32 u32_abgr_cast(const detail::tvec4<T>& c) GLM_FUNC_QUALIFIER gtc::uint32 u32_abgr_cast(const detail::tvec4<T>& c)
{ {
gtc::type_precision::uint32 result = 0; gtc::uint32 result = 0;
result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 24; result += static_cast<gtc::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 24;
result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 16; result += static_cast<gtc::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 16;
result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 8; result += static_cast<gtc::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 8;
result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 0; result += static_cast<gtc::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 0;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_rgbx_cast(const detail::tvec3<T>& c) GLM_FUNC_QUALIFIER gtc::uint64 u64_rgbx_cast(const detail::tvec3<T>& c)
{ {
gtc::type_precision::uint64 result = 0; gtc::uint64 result = 0;
result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 0; result += static_cast<gtc::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 0;
result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 16; result += static_cast<gtc::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 16;
result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 32; result += static_cast<gtc::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 32;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u32_xrgb_cast(const detail::tvec3<T>& c) GLM_FUNC_QUALIFIER gtc::uint64 u32_xrgb_cast(const detail::tvec3<T>& c)
{ {
gtc::type_precision::uint64 result = 0; gtc::uint64 result = 0;
result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 16; result += static_cast<gtc::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 16;
result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 32; result += static_cast<gtc::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 32;
result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 48; result += static_cast<gtc::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 48;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u32_bgrx_cast(const detail::tvec3<T>& c) GLM_FUNC_QUALIFIER gtc::uint64 u32_bgrx_cast(const detail::tvec3<T>& c)
{ {
gtc::type_precision::uint64 result = 0; gtc::uint64 result = 0;
result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 32; result += static_cast<gtc::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 32;
result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 16; result += static_cast<gtc::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 16;
result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 0; result += static_cast<gtc::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 0;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u32_xbgr_cast(const detail::tvec3<T>& c) GLM_FUNC_QUALIFIER gtc::uint64 u32_xbgr_cast(const detail::tvec3<T>& c)
{ {
gtc::type_precision::uint64 result = 0; gtc::uint64 result = 0;
result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 48; result += static_cast<gtc::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 48;
result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 32; result += static_cast<gtc::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 32;
result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 16; result += static_cast<gtc::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 16;
result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec3<T>::value_type(65535)) << 0; result += static_cast<gtc::uint64>(c.w * detail::tvec3<T>::value_type(65535)) << 0;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_rgba_cast(const detail::tvec4<T>& c) GLM_FUNC_QUALIFIER gtc::uint64 u64_rgba_cast(const detail::tvec4<T>& c)
{ {
gtc::type_precision::uint64 result = 0; gtc::uint64 result = 0;
result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 0; result += static_cast<gtc::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 0;
result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 16; result += static_cast<gtc::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 16;
result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 32; result += static_cast<gtc::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 32;
result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 48; result += static_cast<gtc::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 48;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_argb_cast(const detail::tvec4<T>& c) GLM_FUNC_QUALIFIER gtc::uint64 u64_argb_cast(const detail::tvec4<T>& c)
{ {
gtc::type_precision::uint64 result = 0; gtc::uint64 result = 0;
result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 16; result += static_cast<gtc::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 16;
result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 32; result += static_cast<gtc::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 32;
result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 48; result += static_cast<gtc::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 48;
result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 0; result += static_cast<gtc::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 0;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_bgra_cast(const detail::tvec4<T>& c) GLM_FUNC_QUALIFIER gtc::uint64 u64_bgra_cast(const detail::tvec4<T>& c)
{ {
gtc::type_precision::uint64 result = 0; gtc::uint64 result = 0;
result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 32; result += static_cast<gtc::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 32;
result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 16; result += static_cast<gtc::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 16;
result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 0; result += static_cast<gtc::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 0;
result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 48; result += static_cast<gtc::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 48;
return result; return result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER gtc::type_precision::uint64 u64_abgr_cast(const detail::tvec4<T>& c) GLM_FUNC_QUALIFIER gtc::uint64 u64_abgr_cast(const detail::tvec4<T>& c)
{ {
gtc::type_precision::uint64 result = 0; gtc::uint64 result = 0;
result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 48; result += static_cast<gtc::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 48;
result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 32; result += static_cast<gtc::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 32;
result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 16; result += static_cast<gtc::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 16;
result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 0; result += static_cast<gtc::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 0;
return result; return result;
} }
template <> template <>
GLM_FUNC_QUALIFIER f16vec1 f16_channel_cast<gtc::type_precision::uint32>(gtc::type_precision::uint32 color) GLM_FUNC_QUALIFIER f16vec1 f16_channel_cast<gtc::uint32>(gtc::uint32 color)
{ {
return gtc::type_precision::f16(static_cast<float>(color >> 0) / static_cast<float>(255)); return gtc::f16(static_cast<float>(color >> 0) / static_cast<float>(255));
} }
template <> template <>
GLM_FUNC_QUALIFIER gtc::type_precision::f16vec3 f16_rgbx_cast<gtc::type_precision::uint32>(gtc::type_precision::uint32 color) GLM_FUNC_QUALIFIER gtc::f16vec3 f16_rgbx_cast<gtc::uint32>(gtc::uint32 color)
{ {
gtc::type_precision::f16vec3 result; gtc::f16vec3 result;
result.x = gtc::type_precision::f16(static_cast<float>(color >> 0) / static_cast<float>(255)); result.x = gtc::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.y = gtc::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.z = gtc::f16(static_cast<float>(color >> 16) / static_cast<float>(255));
return result; return result;
} }
template <> template <>
GLM_FUNC_QUALIFIER gtc::type_precision::f16vec3 f16_xrgb_cast<gtc::type_precision::uint32>(gtc::type_precision::uint32 color) GLM_FUNC_QUALIFIER gtc::f16vec3 f16_xrgb_cast<gtc::uint32>(gtc::uint32 color)
{ {
gtc::type_precision::f16vec3 result; gtc::f16vec3 result;
result.x = gtc::type_precision::f16(static_cast<float>(color >> 8) / static_cast<float>(255)); result.x = gtc::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.y = gtc::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.z = gtc::f16(static_cast<float>(color >> 24) / static_cast<float>(255));
return result; return result;
} }

View File

@ -27,8 +27,6 @@ namespace glm{
namespace gtx{ namespace gtx{
namespace number_precision ///< GLM_GTX_number_precision extension: Defined size types. namespace number_precision ///< GLM_GTX_number_precision extension: Defined size types.
{ {
using namespace gtc::type_precision;
///////////////////////////// /////////////////////////////
// Unsigned int vector types // Unsigned int vector types

View File

@ -29,8 +29,6 @@ namespace glm{
namespace gtx{ namespace gtx{
namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and functions namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and functions
{ {
using namespace gtc::quaternion;
/// \addtogroup gtx_quaternion /// \addtogroup gtx_quaternion
///@{ ///@{
@ -169,25 +167,25 @@ namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and fun
//! From GLM_GTX_quaternion extension. //! From GLM_GTX_quaternion extension.
template <typename valType> template <typename valType>
detail::tmat3x3<valType> toMat3( detail::tmat3x3<valType> toMat3(
detail::tquat<valType> const & x){return gtc::quaternion::mat3_cast(x);} detail::tquat<valType> const & x){return gtc::mat3_cast(x);}
//! Converts a quaternion to a 4 * 4 matrix. //! Converts a quaternion to a 4 * 4 matrix.
//! From GLM_GTX_quaternion extension. //! From GLM_GTX_quaternion extension.
template <typename valType> template <typename valType>
detail::tmat4x4<valType> toMat4( detail::tmat4x4<valType> toMat4(
detail::tquat<valType> const & x){return gtc::quaternion::mat4_cast(x);} detail::tquat<valType> const & x){return gtc::mat4_cast(x);}
//! Converts a 3 * 3 matrix to a quaternion. //! Converts a 3 * 3 matrix to a quaternion.
//! From GLM_GTX_quaternion extension. //! From GLM_GTX_quaternion extension.
template <typename valType> template <typename valType>
detail::tquat<valType> toQuat( detail::tquat<valType> toQuat(
detail::tmat3x3<valType> const & x){return gtc::quaternion::quat_cast(x);} detail::tmat3x3<valType> const & x){return gtc::quat_cast(x);}
//! Converts a 4 * 4 matrix to a quaternion. //! Converts a 4 * 4 matrix to a quaternion.
//! From GLM_GTX_quaternion extension. //! From GLM_GTX_quaternion extension.
template <typename valType> template <typename valType>
detail::tquat<valType> toQuat( detail::tquat<valType> toQuat(
detail::tmat4x4<valType> const & x){return gtc::quaternion::quat_cast(x);} detail::tmat4x4<valType> const & x){return gtc::quat_cast(x);}
//! Quaternion interpolation using the rotation short path. //! Quaternion interpolation using the rotation short path.
//! From GLM_GTX_quaternion extension. //! From GLM_GTX_quaternion extension.
@ -208,7 +206,7 @@ namespace quaternion ///< GLM_GTX_quaternion extension: Quaternion types and fun
/// @} /// @}
}//namespace quaternion }//namespace quaternion
}//namespace gtx }//namespace gtx
} //namespace glm }//namespace glm
#include "quaternion.inl" #include "quaternion.inl"

View File

@ -20,7 +20,7 @@ namespace quaternion
detail::tquat<valType> const & q detail::tquat<valType> const & q
) )
{ {
return gtc::quaternion::inverse(q) * v; return gtc::inverse(q) * v;
} }
template <typename valType> template <typename valType>
@ -53,7 +53,7 @@ namespace quaternion
detail::tquat<T> const & next detail::tquat<T> const & next
) )
{ {
detail::tquat<T> invQuat = gtc::quaternion::inverse(curr); detail::tquat<T> invQuat = gtc::inverse(curr);
return ext((log(next + invQuat) + log(prev + invQuat)) / T(-4)) * curr; return ext((log(next + invQuat) + log(prev + invQuat)) / T(-4)) * curr;
} }

View File

@ -45,10 +45,8 @@
namespace glm{ namespace glm{
namespace gtx{ namespace gtx{
namespace transform ///< GLM_GTX_transform extension: Add transformation matrices namespace transform ///< GLM_GTX_transform extension: Add transformation matrices
{ {
using namespace gtc::matrix_transform; /// @addtogroup gtx_transform
/// \addtogroup gtx_transform
/// @{ /// @{
//! Builds a translation 4 * 4 matrix created from 3 scalars. //! Builds a translation 4 * 4 matrix created from 3 scalars.

View File

@ -15,7 +15,7 @@ namespace transform
GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate( GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate(
T x, T y, T z) T x, T y, T z)
{ {
return gtc::matrix_transform::translate( return gtc::translate(
detail::tmat4x4<T>(1.0f), detail::tmat4x4<T>(1.0f),
detail::tvec3<T>(x, y , z)); detail::tvec3<T>(x, y , z));
} }
@ -25,7 +25,7 @@ namespace transform
detail::tmat4x4<T> const & m, detail::tmat4x4<T> const & m,
T x, T y, T z) T x, T y, T z)
{ {
return gtc::matrix_transform::translate( return gtc::translate(
m, detail::tvec3<T>(x, y , z)); m, detail::tvec3<T>(x, y , z));
} }
@ -33,7 +33,7 @@ namespace transform
GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate( GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate(
detail::tvec3<T> const & v) detail::tvec3<T> const & v)
{ {
return gtc::matrix_transform::translate( return gtc::translate(
detail::tmat4x4<T>(1.0f), v); detail::tmat4x4<T>(1.0f), v);
} }
@ -42,7 +42,7 @@ namespace transform
T angle, T angle,
T x, T y, T z) T x, T y, T z)
{ {
return gtc::matrix_transform::rotate( return gtc::rotate(
detail::tmat4x4<T>(1), angle, detail::tvec3<T>(x, y, z)); detail::tmat4x4<T>(1), angle, detail::tvec3<T>(x, y, z));
} }
@ -51,7 +51,7 @@ namespace transform
T angle, T angle,
detail::tvec3<T> const & v) detail::tvec3<T> const & v)
{ {
return gtc::matrix_transform::rotate( return gtc::rotate(
detail::tmat4x4<T>(1), angle, v); detail::tmat4x4<T>(1), angle, v);
} }
@ -61,14 +61,14 @@ namespace transform
T angle, T angle,
T x, T y, T z) T x, T y, T z)
{ {
return gtc::matrix_transform::rotate( return gtc::rotate(
m, angle, detail::tvec3<T>(x, y, z)); m, angle, detail::tvec3<T>(x, y, z));
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale(T x, T y, T z) GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale(T x, T y, T z)
{ {
return gtc::matrix_transform::scale( return gtc::scale(
detail::tmat4x4<T>(1), detail::tvec3<T>(x, y, z)); detail::tmat4x4<T>(1), detail::tvec3<T>(x, y, z));
} }
@ -77,7 +77,7 @@ namespace transform
detail::tmat4x4<T> const & m, detail::tmat4x4<T> const & m,
T x, T y, T z) T x, T y, T z)
{ {
return gtc::matrix_transform::scale( return gtc::scale(
m, detail::tvec3<T>(x, y, z)); m, detail::tvec3<T>(x, y, z));
} }
@ -85,7 +85,7 @@ namespace transform
GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale( GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale(
detail::tvec3<T> const & v) detail::tvec3<T> const & v)
{ {
return gtc::matrix_transform::scale( return gtc::scale(
detail::tmat4x4<T>(1.0f), v); detail::tmat4x4<T>(1.0f), v);
} }