scalar_common.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /// @ref ext_scalar_common
  2. /// @file glm/ext/scalar_common.hpp
  3. ///
  4. /// @defgroup ext_scalar_common GLM_EXT_scalar_common
  5. /// @ingroup ext
  6. ///
  7. /// Exposes min and max functions for 3 to 4 scalar parameters.
  8. ///
  9. /// Include <glm/ext/scalar_common.hpp> to use the features of this extension.
  10. ///
  11. /// @see core_func_common
  12. /// @see ext_vector_common
  13. #pragma once
  14. // Dependency:
  15. #include "../common.hpp"
  16. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  17. # pragma message("GLM: GLM_EXT_scalar_common extension included")
  18. #endif
  19. namespace glm
  20. {
  21. /// @addtogroup ext_scalar_common
  22. /// @{
  23. /// Returns the minimum component-wise values of 3 inputs
  24. ///
  25. /// @tparam T A floating-point scalar type.
  26. template<typename T>
  27. GLM_FUNC_DECL T min(T a, T b, T c);
  28. /// Returns the minimum component-wise values of 4 inputs
  29. ///
  30. /// @tparam T A floating-point scalar type.
  31. template<typename T>
  32. GLM_FUNC_DECL T min(T a, T b, T c, T d);
  33. /// Returns the maximum component-wise values of 3 inputs
  34. ///
  35. /// @tparam T A floating-point scalar type.
  36. template<typename T>
  37. GLM_FUNC_DECL T max(T a, T b, T c);
  38. /// Returns the maximum component-wise values of 4 inputs
  39. ///
  40. /// @tparam T A floating-point scalar type.
  41. template<typename T>
  42. GLM_FUNC_DECL T max(T a, T b, T c, T d);
  43. /// Returns the minimum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
  44. ///
  45. /// @tparam T A floating-point scalar type.
  46. ///
  47. /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a>
  48. template<typename T>
  49. GLM_FUNC_DECL T fmin(T a, T b);
  50. /// Returns the minimum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
  51. ///
  52. /// @tparam T A floating-point scalar type.
  53. ///
  54. /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a>
  55. template<typename T>
  56. GLM_FUNC_DECL T fmin(T a, T b, T c);
  57. /// Returns the minimum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
  58. ///
  59. /// @tparam T A floating-point scalar type.
  60. ///
  61. /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a>
  62. template<typename T>
  63. GLM_FUNC_DECL T fmin(T a, T b, T c, T d);
  64. /// Returns the maximum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
  65. ///
  66. /// @tparam T A floating-point scalar type.
  67. ///
  68. /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a>
  69. template<typename T>
  70. GLM_FUNC_DECL T fmax(T a, T b);
  71. /// Returns the maximum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
  72. ///
  73. /// @tparam T A floating-point scalar type.
  74. ///
  75. /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a>
  76. template<typename T>
  77. GLM_FUNC_DECL T fmax(T a, T b, T C);
  78. /// Returns the maximum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned.
  79. ///
  80. /// @tparam T A floating-point scalar type.
  81. ///
  82. /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a>
  83. template<typename T>
  84. GLM_FUNC_DECL T fmax(T a, T b, T C, T D);
  85. /// @}
  86. }//namespace glm
  87. #include "scalar_common.inl"