master
ブランチ master
ShaderPlayground / deps / glm / glm / gtx / associated_min_max.hpp
7.4 KB、207行 生 Blame 履歴
1/// @ref gtx_associated_min_max
2/// @file glm/gtx/associated_min_max.hpp
3///
4/// @see core (dependence)
5/// @see gtx_extented_min_max (dependence)
6///
7/// @defgroup gtx_associated_min_max GLM_GTX_associated_min_max
8/// @ingroup gtx
9///
10/// Include <glm/gtx/associated_min_max.hpp> to use the features of this extension.
11///
12/// @brief Min and max functions that return associated values not the compared onces.
13
14#pragma once
15
16// Dependency:
17#include "../glm.hpp"
18
19#ifndef GLM_ENABLE_EXPERIMENTAL
20# error "GLM: GTX_associated_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."
21#endif
22
23#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
24# pragma message("GLM: GLM_GTX_associated_min_max extension included")
25#endif
26
27namespace glm
28{
29 /// @addtogroup gtx_associated_min_max
30 /// @{
31
32 /// Minimum comparison between 2 variables and returns 2 associated variable values
33 /// @see gtx_associated_min_max
34 template<typename T, typename U, qualifier Q>
35 GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b);
36
37 /// Minimum comparison between 2 variables and returns 2 associated variable values
38 /// @see gtx_associated_min_max
39 template<length_t L, typename T, typename U, qualifier Q>
40 GLM_FUNC_DECL vec<2, U, Q> associatedMin(
41 vec<L, T, Q> const& x, vec<L, U, Q> const& a,
42 vec<L, T, Q> const& y, vec<L, U, Q> const& b);
43
44 /// Minimum comparison between 2 variables and returns 2 associated variable values
45 /// @see gtx_associated_min_max
46 template<length_t L, typename T, typename U, qualifier Q>
47 GLM_FUNC_DECL vec<L, U, Q> associatedMin(
48 T x, const vec<L, U, Q>& a,
49 T y, const vec<L, U, Q>& b);
50
51 /// Minimum comparison between 2 variables and returns 2 associated variable values
52 /// @see gtx_associated_min_max
53 template<length_t L, typename T, typename U, qualifier Q>
54 GLM_FUNC_DECL vec<L, U, Q> associatedMin(
55 vec<L, T, Q> const& x, U a,
56 vec<L, T, Q> const& y, U b);
57
58 /// Minimum comparison between 3 variables and returns 3 associated variable values
59 /// @see gtx_associated_min_max
60 template<typename T, typename U>
61 GLM_FUNC_DECL U associatedMin(
62 T x, U a,
63 T y, U b,
64 T z, U c);
65
66 /// Minimum comparison between 3 variables and returns 3 associated variable values
67 /// @see gtx_associated_min_max
68 template<length_t L, typename T, typename U, qualifier Q>
69 GLM_FUNC_DECL vec<L, U, Q> associatedMin(
70 vec<L, T, Q> const& x, vec<L, U, Q> const& a,
71 vec<L, T, Q> const& y, vec<L, U, Q> const& b,
72 vec<L, T, Q> const& z, vec<L, U, Q> const& c);
73
74 /// Minimum comparison between 4 variables and returns 4 associated variable values
75 /// @see gtx_associated_min_max
76 template<typename T, typename U>
77 GLM_FUNC_DECL U associatedMin(
78 T x, U a,
79 T y, U b,
80 T z, U c,
81 T w, U d);
82
83 /// Minimum comparison between 4 variables and returns 4 associated variable values
84 /// @see gtx_associated_min_max
85 template<length_t L, typename T, typename U, qualifier Q>
86 GLM_FUNC_DECL vec<L, U, Q> associatedMin(
87 vec<L, T, Q> const& x, vec<L, U, Q> const& a,
88 vec<L, T, Q> const& y, vec<L, U, Q> const& b,
89 vec<L, T, Q> const& z, vec<L, U, Q> const& c,
90 vec<L, T, Q> const& w, vec<L, U, Q> const& d);
91
92 /// Minimum comparison between 4 variables and returns 4 associated variable values
93 /// @see gtx_associated_min_max
94 template<length_t L, typename T, typename U, qualifier Q>
95 GLM_FUNC_DECL vec<L, U, Q> associatedMin(
96 T x, vec<L, U, Q> const& a,
97 T y, vec<L, U, Q> const& b,
98 T z, vec<L, U, Q> const& c,
99 T w, vec<L, U, Q> const& d);
100
101 /// Minimum comparison between 4 variables and returns 4 associated variable values
102 /// @see gtx_associated_min_max
103 template<length_t L, typename T, typename U, qualifier Q>
104 GLM_FUNC_DECL vec<L, U, Q> associatedMin(
105 vec<L, T, Q> const& x, U a,
106 vec<L, T, Q> const& y, U b,
107 vec<L, T, Q> const& z, U c,
108 vec<L, T, Q> const& w, U d);
109
110 /// Maximum comparison between 2 variables and returns 2 associated variable values
111 /// @see gtx_associated_min_max
112 template<typename T, typename U>
113 GLM_FUNC_DECL U associatedMax(T x, U a, T y, U b);
114
115 /// Maximum comparison between 2 variables and returns 2 associated variable values
116 /// @see gtx_associated_min_max
117 template<length_t L, typename T, typename U, qualifier Q>
118 GLM_FUNC_DECL vec<2, U, Q> associatedMax(
119 vec<L, T, Q> const& x, vec<L, U, Q> const& a,
120 vec<L, T, Q> const& y, vec<L, U, Q> const& b);
121
122 /// Maximum comparison between 2 variables and returns 2 associated variable values
123 /// @see gtx_associated_min_max
124 template<length_t L, typename T, typename U, qualifier Q>
125 GLM_FUNC_DECL vec<L, T, Q> associatedMax(
126 T x, vec<L, U, Q> const& a,
127 T y, vec<L, U, Q> const& b);
128
129 /// Maximum comparison between 2 variables and returns 2 associated variable values
130 /// @see gtx_associated_min_max
131 template<length_t L, typename T, typename U, qualifier Q>
132 GLM_FUNC_DECL vec<L, U, Q> associatedMax(
133 vec<L, T, Q> const& x, U a,
134 vec<L, T, Q> const& y, U b);
135
136 /// Maximum comparison between 3 variables and returns 3 associated variable values
137 /// @see gtx_associated_min_max
138 template<typename T, typename U>
139 GLM_FUNC_DECL U associatedMax(
140 T x, U a,
141 T y, U b,
142 T z, U c);
143
144 /// Maximum comparison between 3 variables and returns 3 associated variable values
145 /// @see gtx_associated_min_max
146 template<length_t L, typename T, typename U, qualifier Q>
147 GLM_FUNC_DECL vec<L, U, Q> associatedMax(
148 vec<L, T, Q> const& x, vec<L, U, Q> const& a,
149 vec<L, T, Q> const& y, vec<L, U, Q> const& b,
150 vec<L, T, Q> const& z, vec<L, U, Q> const& c);
151
152 /// Maximum comparison between 3 variables and returns 3 associated variable values
153 /// @see gtx_associated_min_max
154 template<length_t L, typename T, typename U, qualifier Q>
155 GLM_FUNC_DECL vec<L, T, Q> associatedMax(
156 T x, vec<L, U, Q> const& a,
157 T y, vec<L, U, Q> const& b,
158 T z, vec<L, U, Q> const& c);
159
160 /// Maximum comparison between 3 variables and returns 3 associated variable values
161 /// @see gtx_associated_min_max
162 template<length_t L, typename T, typename U, qualifier Q>
163 GLM_FUNC_DECL vec<L, U, Q> associatedMax(
164 vec<L, T, Q> const& x, U a,
165 vec<L, T, Q> const& y, U b,
166 vec<L, T, Q> const& z, U c);
167
168 /// Maximum comparison between 4 variables and returns 4 associated variable values
169 /// @see gtx_associated_min_max
170 template<typename T, typename U>
171 GLM_FUNC_DECL U associatedMax(
172 T x, U a,
173 T y, U b,
174 T z, U c,
175 T w, U d);
176
177 /// Maximum comparison between 4 variables and returns 4 associated variable values
178 /// @see gtx_associated_min_max
179 template<length_t L, typename T, typename U, qualifier Q>
180 GLM_FUNC_DECL vec<L, U, Q> associatedMax(
181 vec<L, T, Q> const& x, vec<L, U, Q> const& a,
182 vec<L, T, Q> const& y, vec<L, U, Q> const& b,
183 vec<L, T, Q> const& z, vec<L, U, Q> const& c,
184 vec<L, T, Q> const& w, vec<L, U, Q> const& d);
185
186 /// Maximum comparison between 4 variables and returns 4 associated variable values
187 /// @see gtx_associated_min_max
188 template<length_t L, typename T, typename U, qualifier Q>
189 GLM_FUNC_DECL vec<L, U, Q> associatedMax(
190 T x, vec<L, U, Q> const& a,
191 T y, vec<L, U, Q> const& b,
192 T z, vec<L, U, Q> const& c,
193 T w, vec<L, U, Q> const& d);
194
195 /// Maximum comparison between 4 variables and returns 4 associated variable values
196 /// @see gtx_associated_min_max
197 template<length_t L, typename T, typename U, qualifier Q>
198 GLM_FUNC_DECL vec<L, U, Q> associatedMax(
199 vec<L, T, Q> const& x, U a,
200 vec<L, T, Q> const& y, U b,
201 vec<L, T, Q> const& z, U c,
202 vec<L, T, Q> const& w, U d);
203
204 /// @}
205} //namespace glm
206
207#include "associated_min_max.inl"