| 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 | |
| 14 | #pragma once |
| 15 | |
| 16 | // Dependency: |
| 17 | #include "../common.hpp" |
| 18 | |
| 19 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) |
| 20 | # pragma message("GLM: GLM_EXT_scalar_common extension included") |
| 21 | #endif |
| 22 | |
| 23 | namespace glm |
| 24 | { |
| 25 | /// @addtogroup ext_scalar_common |
| 26 | /// @{ |
| 27 | |
| 28 | /// Returns the minimum component-wise values of 3 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); |
| 33 | |
| 34 | /// Returns the minimum component-wise values of 4 inputs |
| 35 | /// |
| 36 | /// @tparam T A floating-point scalar type. |
| 37 | template<typename T> |
| 38 | GLM_FUNC_DECL T min(T a, T b, T c, T d); |
| 39 | |
| 40 | /// Returns the maximum component-wise values of 3 inputs |
| 41 | /// |
| 42 | /// @tparam T A floating-point scalar type. |
| 43 | template<typename T> |
| 44 | GLM_FUNC_DECL T max(T a, T b, T c); |
| 45 | |
| 46 | /// Returns the maximum component-wise values of 4 inputs |
| 47 | /// |
| 48 | /// @tparam T A floating-point scalar type. |
| 49 | template<typename T> |
| 50 | GLM_FUNC_DECL T max(T a, T b, T c, T d); |
| 51 | |
| 52 | /// 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. |
| 53 | /// |
| 54 | /// @tparam T A floating-point scalar type. |
| 55 | /// |
| 56 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a> |
| 57 | template<typename T> |
| 58 | GLM_FUNC_DECL T fmin(T a, T b); |
| 59 | |
| 60 | /// 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. |
| 61 | /// |
| 62 | /// @tparam T A floating-point scalar type. |
| 63 | /// |
| 64 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a> |
| 65 | template<typename T> |
| 66 | GLM_FUNC_DECL T fmin(T a, T b, T c); |
| 67 | |
| 68 | /// 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. |
| 69 | /// |
| 70 | /// @tparam T A floating-point scalar type. |
| 71 | /// |
| 72 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmin">std::fmin documentation</a> |
| 73 | template<typename T> |
| 74 | GLM_FUNC_DECL T fmin(T a, T b, T c, T d); |
| 75 | |
| 76 | /// 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. |
| 77 | /// |
| 78 | /// @tparam T A floating-point scalar type. |
| 79 | /// |
| 80 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a> |
| 81 | template<typename T> |
| 82 | GLM_FUNC_DECL T fmax(T a, T b); |
| 83 | |
| 84 | /// 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. |
| 85 | /// |
| 86 | /// @tparam T A floating-point scalar type. |
| 87 | /// |
| 88 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a> |
| 89 | template<typename T> |
| 90 | GLM_FUNC_DECL T fmax(T a, T b, T C); |
| 91 | |
| 92 | /// 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. |
| 93 | /// |
| 94 | /// @tparam T A floating-point scalar type. |
| 95 | /// |
| 96 | /// @see <a href="http://en.cppreference.com/w/cpp/numeric/math/fmax">std::fmax documentation</a> |
| 97 | template<typename T> |
| 98 | GLM_FUNC_DECL T fmax(T a, T b, T C, T D); |
| 99 | |
| 100 | /// @} |
| 101 | }//namespace glm |
| 102 | |
| 103 | #include "scalar_common.inl" |