extended_min_max.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /// @ref gtx_extended_min_max
  2. /// @file glm/gtx/extended_min_max.hpp
  3. ///
  4. /// @see core (dependence)
  5. ///
  6. /// @defgroup gtx_extended_min_max GLM_GTX_extended_min_max
  7. /// @ingroup gtx
  8. ///
  9. /// Include <glm/gtx/extended_min_max.hpp> to use the features of this extension.
  10. ///
  11. /// Min and max functions for 3 to 4 parameters.
  12. #pragma once
  13. // Dependency:
  14. #include "../glm.hpp"
  15. #include "../ext/vector_common.hpp"
  16. #ifndef GLM_ENABLE_EXPERIMENTAL
  17. # error "GLM: GLM_GTX_extended_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
  18. #elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  19. # pragma message("GLM: GLM_GTX_extended_min_max extension included")
  20. #endif
  21. namespace glm
  22. {
  23. /// @addtogroup gtx_extended_min_max
  24. /// @{
  25. /// Return the minimum component-wise values of 3 inputs
  26. /// @see gtx_extented_min_max
  27. template<typename T>
  28. GLM_FUNC_DECL T min(
  29. T const& x,
  30. T const& y,
  31. T const& z);
  32. /// Return the minimum component-wise values of 3 inputs
  33. /// @see gtx_extented_min_max
  34. template<typename T, template<typename> class C>
  35. GLM_FUNC_DECL C<T> min(
  36. C<T> const& x,
  37. typename C<T>::T const& y,
  38. typename C<T>::T const& z);
  39. /// Return the minimum component-wise values of 3 inputs
  40. /// @see gtx_extented_min_max
  41. template<typename T, template<typename> class C>
  42. GLM_FUNC_DECL C<T> min(
  43. C<T> const& x,
  44. C<T> const& y,
  45. C<T> const& z);
  46. /// Return the minimum component-wise values of 4 inputs
  47. /// @see gtx_extented_min_max
  48. template<typename T>
  49. GLM_FUNC_DECL T min(
  50. T const& x,
  51. T const& y,
  52. T const& z,
  53. T const& w);
  54. /// Return the minimum component-wise values of 4 inputs
  55. /// @see gtx_extented_min_max
  56. template<typename T, template<typename> class C>
  57. GLM_FUNC_DECL C<T> min(
  58. C<T> const& x,
  59. typename C<T>::T const& y,
  60. typename C<T>::T const& z,
  61. typename C<T>::T const& w);
  62. /// Return the minimum component-wise values of 4 inputs
  63. /// @see gtx_extented_min_max
  64. template<typename T, template<typename> class C>
  65. GLM_FUNC_DECL C<T> min(
  66. C<T> const& x,
  67. C<T> const& y,
  68. C<T> const& z,
  69. C<T> const& w);
  70. /// Return the maximum component-wise values of 3 inputs
  71. /// @see gtx_extented_min_max
  72. template<typename T>
  73. GLM_FUNC_DECL T max(
  74. T const& x,
  75. T const& y,
  76. T const& z);
  77. /// Return the maximum component-wise values of 3 inputs
  78. /// @see gtx_extented_min_max
  79. template<typename T, template<typename> class C>
  80. GLM_FUNC_DECL C<T> max(
  81. C<T> const& x,
  82. typename C<T>::T const& y,
  83. typename C<T>::T const& z);
  84. /// Return the maximum component-wise values of 3 inputs
  85. /// @see gtx_extented_min_max
  86. template<typename T, template<typename> class C>
  87. GLM_FUNC_DECL C<T> max(
  88. C<T> const& x,
  89. C<T> const& y,
  90. C<T> const& z);
  91. /// Return the maximum component-wise values of 4 inputs
  92. /// @see gtx_extented_min_max
  93. template<typename T>
  94. GLM_FUNC_DECL T max(
  95. T const& x,
  96. T const& y,
  97. T const& z,
  98. T const& w);
  99. /// Return the maximum component-wise values of 4 inputs
  100. /// @see gtx_extented_min_max
  101. template<typename T, template<typename> class C>
  102. GLM_FUNC_DECL C<T> max(
  103. C<T> const& x,
  104. typename C<T>::T const& y,
  105. typename C<T>::T const& z,
  106. typename C<T>::T const& w);
  107. /// Return the maximum component-wise values of 4 inputs
  108. /// @see gtx_extented_min_max
  109. template<typename T, template<typename> class C>
  110. GLM_FUNC_DECL C<T> max(
  111. C<T> const& x,
  112. C<T> const& y,
  113. C<T> const& z,
  114. C<T> const& w);
  115. /// @}
  116. }//namespace glm
  117. #include "extended_min_max.inl"