• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /// @ref gtx_component_wise
2 /// @file glm/gtx/component_wise.hpp
3 /// @date 2007-05-21 / 2011-06-07
4 /// @author Christophe Riccio
5 ///
6 /// @see core (dependence)
7 ///
8 /// @defgroup gtx_component_wise GLM_GTX_component_wise
9 /// @ingroup gtx
10 ///
11 /// @brief Operations between components of a type
12 ///
13 /// <glm/gtx/component_wise.hpp> need to be included to use these functionalities.
14 
15 #pragma once
16 
17 // Dependencies
18 #include "../detail/setup.hpp"
19 #include "../detail/precision.hpp"
20 
21 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
22 #	pragma message("GLM: GLM_GTX_component_wise extension included")
23 #endif
24 
25 namespace glm
26 {
27 	/// @addtogroup gtx_component_wise
28 	/// @{
29 
30 	/// Convert an integer vector to a normalized float vector.
31 	/// If the parameter value type is already a floating precision type, the value is passed through.
32 	/// @see gtx_component_wise
33 	template <typename floatType, typename T, precision P, template <typename, precision> class vecType>
34 	GLM_FUNC_DECL vecType<floatType, P> compNormalize(vecType<T, P> const & v);
35 
36 	/// Convert a normalized float vector to an integer vector.
37 	/// If the parameter value type is already a floating precision type, the value is passed through.
38 	/// @see gtx_component_wise
39 	template <typename T, typename floatType, precision P, template <typename, precision> class vecType>
40 	GLM_FUNC_DECL vecType<T, P> compScale(vecType<floatType, P> const & v);
41 
42 	/// Add all vector components together.
43 	/// @see gtx_component_wise
44 	template <typename genType>
45 	GLM_FUNC_DECL typename genType::value_type compAdd(genType const & v);
46 
47 	/// Multiply all vector components together.
48 	/// @see gtx_component_wise
49 	template <typename genType>
50 	GLM_FUNC_DECL typename genType::value_type compMul(genType const & v);
51 
52 	/// Find the minimum value between single vector components.
53 	/// @see gtx_component_wise
54 	template <typename genType>
55 	GLM_FUNC_DECL typename genType::value_type compMin(genType const & v);
56 
57 	/// Find the maximum value between single vector components.
58 	/// @see gtx_component_wise
59 	template <typename genType>
60 	GLM_FUNC_DECL typename genType::value_type compMax(genType const & v);
61 
62 	/// @}
63 }//namespace glm
64 
65 #include "component_wise.inl"
66