You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

194 lines
5.1 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////
  2. /// OpenGL Mathematics (glm.g-truc.net)
  3. ///
  4. /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  5. /// Permission is hereby granted, free of charge, to any person obtaining a copy
  6. /// of this software and associated documentation files (the "Software"), to deal
  7. /// in the Software without restriction, including without limitation the rights
  8. /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. /// copies of the Software, and to permit persons to whom the Software is
  10. /// furnished to do so, subject to the following conditions:
  11. ///
  12. /// The above copyright notice and this permission notice shall be included in
  13. /// all copies or substantial portions of the Software.
  14. ///
  15. /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. /// THE SOFTWARE.
  22. ///
  23. /// @ref gtx_extented_min_max
  24. /// @file glm/gtx/extented_min_max.hpp
  25. /// @date 2007-03-14 / 2011-06-07
  26. /// @author Christophe Riccio
  27. ///
  28. /// @see core (dependence)
  29. /// @see gtx_half_float (dependence)
  30. ///
  31. /// @defgroup gtx_extented_min_max GLM_GTX_extented_min_max
  32. /// @ingroup gtx
  33. ///
  34. /// Min and max functions for 3 to 4 parameters.
  35. ///
  36. /// <glm/gtx/extented_min_max.hpp> need to be included to use these functionalities.
  37. ///////////////////////////////////////////////////////////////////////////////////
  38. #ifndef GLM_GTX_extented_min_max
  39. #define GLM_GTX_extented_min_max GLM_VERSION
  40. // Dependency:
  41. #include "../glm.hpp"
  42. #include "../gtc/half_float.hpp"
  43. #if(defined(GLM_MESSAGES) && !defined(glm_ext))
  44. # pragma message("GLM: GLM_GTX_extented_min_max extension included")
  45. #endif
  46. namespace glm
  47. {
  48. /// @addtogroup gtx_extented_min_max
  49. /// @{
  50. /// Return the minimum component-wise values of 3 inputs
  51. /// @see gtx_extented_min_max
  52. template <typename T>
  53. T min(
  54. T const & x,
  55. T const & y,
  56. T const & z);
  57. /// Return the minimum component-wise values of 3 inputs
  58. /// @see gtx_extented_min_max
  59. template
  60. <
  61. typename T,
  62. template <typename> class C
  63. >
  64. C<T> min(
  65. C<T> const & x,
  66. typename C<T>::value_type const & y,
  67. typename C<T>::value_type const & z);
  68. /// Return the minimum component-wise values of 3 inputs
  69. /// @see gtx_extented_min_max
  70. template
  71. <
  72. typename T,
  73. template <typename> class C
  74. >
  75. C<T> min(
  76. C<T> const & x,
  77. C<T> const & y,
  78. C<T> const & z);
  79. /// Return the minimum component-wise values of 4 inputs
  80. /// @see gtx_extented_min_max
  81. template <typename T>
  82. T min(
  83. T const & x,
  84. T const & y,
  85. T const & z,
  86. T const & w);
  87. /// Return the minimum component-wise values of 4 inputs
  88. /// @see gtx_extented_min_max
  89. template
  90. <
  91. typename T,
  92. template <typename> class C
  93. >
  94. C<T> min(
  95. C<T> const & x,
  96. typename C<T>::value_type const & y,
  97. typename C<T>::value_type const & z,
  98. typename C<T>::value_type const & w);
  99. /// Return the minimum component-wise values of 4 inputs
  100. /// @see gtx_extented_min_max
  101. template
  102. <
  103. typename T,
  104. template <typename> class C
  105. >
  106. C<T> min(
  107. C<T> const & x,
  108. C<T> const & y,
  109. C<T> const & z,
  110. C<T> const & w);
  111. /// Return the maximum component-wise values of 3 inputs
  112. /// @see gtx_extented_min_max
  113. template <typename T>
  114. T max(
  115. T const & x,
  116. T const & y,
  117. T const & z);
  118. /// Return the maximum component-wise values of 3 inputs
  119. /// @see gtx_extented_min_max
  120. template
  121. <
  122. typename T,
  123. template <typename> class C
  124. >
  125. C<T> max(
  126. C<T> const & x,
  127. typename C<T>::value_type const & y,
  128. typename C<T>::value_type const & z);
  129. /// Return the maximum component-wise values of 3 inputs
  130. /// @see gtx_extented_min_max
  131. template
  132. <
  133. typename T,
  134. template <typename> class C
  135. >
  136. C<T> max(
  137. C<T> const & x,
  138. C<T> const & y,
  139. C<T> const & z);
  140. /// Return the maximum component-wise values of 4 inputs
  141. /// @see gtx_extented_min_max
  142. template <typename T>
  143. T max(
  144. T const & x,
  145. T const & y,
  146. T const & z,
  147. T const & w);
  148. /// Return the maximum component-wise values of 4 inputs
  149. /// @see gtx_extented_min_max
  150. template
  151. <
  152. typename T,
  153. template <typename> class C
  154. >
  155. C<T> max(
  156. C<T> const & x,
  157. typename C<T>::value_type const & y,
  158. typename C<T>::value_type const & z,
  159. typename C<T>::value_type const & w);
  160. /// Return the maximum component-wise values of 4 inputs
  161. /// @see gtx_extented_min_max
  162. template
  163. <
  164. typename T,
  165. template <typename> class C
  166. >
  167. C<T> max(
  168. C<T> const & x,
  169. C<T> const & y,
  170. C<T> const & z,
  171. C<T> const & w);
  172. /// @}
  173. }//namespace glm
  174. #include "extented_min_max.inl"
  175. #endif//GLM_GTX_extented_min_max