glm/doc/api/a00353_source.html
2024-01-24 14:43:07 +01:00

160 lines
18 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>1.0.0 API documentation: scalar_common.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo-mini.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">1.0.0 API documentation
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_63ed049134a778d525e06b63afc2c979.html">Github</a></li><li class="navelem"><a class="el" href="dir_c98a9ac98258ab9f831b188d66361a70.html">g-truc</a></li><li class="navelem"><a class="el" href="dir_50f12b6ceb23d7f6adfb377a1ae8b006.html">glm</a></li><li class="navelem"><a class="el" href="dir_fca33f1b5115d46f42c670590789c0d2.html">glm</a></li><li class="navelem"><a class="el" href="dir_b171cecbb853a9ee4caace490047c53f.html">ext</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">scalar_common.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="a00353.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment">// Dependency:</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#include &quot;../common.hpp&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#if GLM_MESSAGES == GLM_ENABLE &amp;&amp; !defined(GLM_EXT_INCLUDED)</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor"># pragma message(&quot;GLM: GLM_EXT_scalar_common extension included&quot;)</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="keyword">namespace </span>glm</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;{</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="a00857.html#ga420b37cbd98c395b93dab0278305cd46"> 34</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga0d24a9acb8178df77e4aff90cbb2010d">min</a>(T a, T b, T c);</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="a00857.html#ga0d24a9acb8178df77e4aff90cbb2010d"> 42</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga0d24a9acb8178df77e4aff90cbb2010d">min</a>(T a, T b, T c, T d);</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="a00857.html#gaa20839d9ab14514f8966f69877ea0de8"> 50</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga2274b5e75ed84b0b1e50d8d22f1f2f67">max</a>(T a, T b, T c);</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; </div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="a00857.html#ga2274b5e75ed84b0b1e50d8d22f1f2f67"> 58</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga2274b5e75ed84b0b1e50d8d22f1f2f67">max</a>(T a, T b, T c, T d);</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="a00857.html#ga7b2b438a765e2a62098c79eb212f28f0"> 67</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga3d6f9c6c16bfd6f38f2c4f8076e8b661">fmin</a>(T a, T b);</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="a00857.html#ga1a95fe4cf5437e8133f1093fe9726a64"> 76</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga3d6f9c6c16bfd6f38f2c4f8076e8b661">fmin</a>(T a, T b, T c);</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="a00857.html#ga3d6f9c6c16bfd6f38f2c4f8076e8b661"> 85</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga3d6f9c6c16bfd6f38f2c4f8076e8b661">fmin</a>(T a, T b, T c, T d);</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="a00857.html#ga36920478565cf608e93064283ce06421"> 94</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga27e260b1ff4d04c3ad4b864d26cbaf08">fmax</a>(T a, T b);</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="a00857.html#ga0007bba71ca451ac70e99d28dfbeaab9"> 103</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga27e260b1ff4d04c3ad4b864d26cbaf08">fmax</a>(T a, T b, T C);</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="a00857.html#ga27e260b1ff4d04c3ad4b864d26cbaf08"> 112</a></span>&#160; GLM_FUNC_DECL T <a class="code" href="a00857.html#ga27e260b1ff4d04c3ad4b864d26cbaf08">fmax</a>(T a, T b, T C, T D);</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> genType&gt;</div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="a00857.html#ga1e28539d3a46965ed9ef92ec7cb3b18a"> 120</a></span>&#160; GLM_FUNC_DECL genType <a class="code" href="a00857.html#ga1e28539d3a46965ed9ef92ec7cb3b18a">fclamp</a>(genType x, genType minVal, genType maxVal);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> genType&gt;</div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="a00857.html#ga6c0cc6bd1d67ea1008d2592e998bad33"> 128</a></span>&#160; GLM_FUNC_DECL genType <a class="code" href="a00857.html#ga6c0cc6bd1d67ea1008d2592e998bad33">clamp</a>(genType <span class="keyword">const</span>&amp; Texcoord);</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; </div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> genType&gt;</div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="a00857.html#ga809650c6310ea7c42666e918c117fb6f"> 136</a></span>&#160; GLM_FUNC_DECL genType <a class="code" href="a00857.html#ga809650c6310ea7c42666e918c117fb6f">repeat</a>(genType <span class="keyword">const</span>&amp; Texcoord);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> genType&gt;</div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="a00857.html#gaa6856a0a048d2749252848da35e10c8b"> 144</a></span>&#160; GLM_FUNC_DECL genType <a class="code" href="a00857.html#gaa6856a0a048d2749252848da35e10c8b">mirrorClamp</a>(genType <span class="keyword">const</span>&amp; Texcoord);</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> genType&gt;</div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="a00857.html#ga16a89b0661b60d5bea85137bbae74d73"> 152</a></span>&#160; GLM_FUNC_DECL genType <a class="code" href="a00857.html#ga16a89b0661b60d5bea85137bbae74d73">mirrorRepeat</a>(genType <span class="keyword">const</span>&amp; Texcoord);</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; </div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> genType&gt;</div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="a00857.html#gaa45ff5782fde5182afa7ab211f9758a3"> 164</a></span>&#160; GLM_FUNC_DECL <span class="keywordtype">int</span> <a class="code" href="a00857.html#gaa45ff5782fde5182afa7ab211f9758a3">iround</a>(genType <span class="keyword">const</span>&amp; x);</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> genType&gt;</div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="a00857.html#ga9d915647ec33c4110946665f914d3abb"> 176</a></span>&#160; GLM_FUNC_DECL uint <a class="code" href="a00857.html#ga9d915647ec33c4110946665f914d3abb">uround</a>(genType <span class="keyword">const</span>&amp; x);</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;}<span class="comment">//namespace glm</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; </div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="preprocessor">#include &quot;scalar_common.inl&quot;</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aa00857_html_gaa6856a0a048d2749252848da35e10c8b"><div class="ttname"><a href="a00857.html#gaa6856a0a048d2749252848da35e10c8b">glm::mirrorClamp</a></div><div class="ttdeci">GLM_FUNC_DECL genType mirrorClamp(genType const &amp;Texcoord)</div><div class="ttdoc">Simulate GL_MIRRORED_REPEAT OpenGL wrap mode.</div></div>
<div class="ttc" id="aa00857_html_ga0d24a9acb8178df77e4aff90cbb2010d"><div class="ttname"><a href="a00857.html#ga0d24a9acb8178df77e4aff90cbb2010d">glm::min</a></div><div class="ttdeci">GLM_FUNC_DECL T min(T a, T b, T c, T d)</div><div class="ttdoc">Returns the minimum component-wise values of 4 inputs.</div></div>
<div class="ttc" id="aa00857_html_ga3d6f9c6c16bfd6f38f2c4f8076e8b661"><div class="ttname"><a href="a00857.html#ga3d6f9c6c16bfd6f38f2c4f8076e8b661">glm::fmin</a></div><div class="ttdeci">GLM_FUNC_DECL T fmin(T a, T b, T c, T d)</div><div class="ttdoc">Returns the minimum component-wise values of 4 inputs.</div></div>
<div class="ttc" id="aa00857_html_ga809650c6310ea7c42666e918c117fb6f"><div class="ttname"><a href="a00857.html#ga809650c6310ea7c42666e918c117fb6f">glm::repeat</a></div><div class="ttdeci">GLM_FUNC_DECL genType repeat(genType const &amp;Texcoord)</div><div class="ttdoc">Simulate GL_REPEAT OpenGL wrap mode.</div></div>
<div class="ttc" id="aa00857_html_ga1e28539d3a46965ed9ef92ec7cb3b18a"><div class="ttname"><a href="a00857.html#ga1e28539d3a46965ed9ef92ec7cb3b18a">glm::fclamp</a></div><div class="ttdeci">GLM_FUNC_DECL genType fclamp(genType x, genType minVal, genType maxVal)</div><div class="ttdoc">Returns min(max(x, minVal), maxVal) for each component in x.</div></div>
<div class="ttc" id="aa00857_html_ga9d915647ec33c4110946665f914d3abb"><div class="ttname"><a href="a00857.html#ga9d915647ec33c4110946665f914d3abb">glm::uround</a></div><div class="ttdeci">GLM_FUNC_DECL uint uround(genType const &amp;x)</div><div class="ttdoc">Returns a value equal to the nearest integer to x.</div></div>
<div class="ttc" id="aa00857_html_ga16a89b0661b60d5bea85137bbae74d73"><div class="ttname"><a href="a00857.html#ga16a89b0661b60d5bea85137bbae74d73">glm::mirrorRepeat</a></div><div class="ttdeci">GLM_FUNC_DECL genType mirrorRepeat(genType const &amp;Texcoord)</div><div class="ttdoc">Simulate GL_MIRROR_REPEAT OpenGL wrap mode.</div></div>
<div class="ttc" id="aa00857_html_gaa45ff5782fde5182afa7ab211f9758a3"><div class="ttname"><a href="a00857.html#gaa45ff5782fde5182afa7ab211f9758a3">glm::iround</a></div><div class="ttdeci">GLM_FUNC_DECL int iround(genType const &amp;x)</div><div class="ttdoc">Returns a value equal to the nearest integer to x.</div></div>
<div class="ttc" id="aa00857_html_ga27e260b1ff4d04c3ad4b864d26cbaf08"><div class="ttname"><a href="a00857.html#ga27e260b1ff4d04c3ad4b864d26cbaf08">glm::fmax</a></div><div class="ttdeci">GLM_FUNC_DECL T fmax(T a, T b, T C, T D)</div><div class="ttdoc">Returns the maximum component-wise values of 4 inputs.</div></div>
<div class="ttc" id="aa00857_html_ga2274b5e75ed84b0b1e50d8d22f1f2f67"><div class="ttname"><a href="a00857.html#ga2274b5e75ed84b0b1e50d8d22f1f2f67">glm::max</a></div><div class="ttdeci">GLM_FUNC_DECL T max(T a, T b, T c, T d)</div><div class="ttdoc">Returns the maximum component-wise values of 4 inputs.</div></div>
<div class="ttc" id="aa00857_html_ga6c0cc6bd1d67ea1008d2592e998bad33"><div class="ttname"><a href="a00857.html#ga6c0cc6bd1d67ea1008d2592e998bad33">glm::clamp</a></div><div class="ttdeci">GLM_FUNC_DECL genType clamp(genType const &amp;Texcoord)</div><div class="ttdoc">Simulate GL_CLAMP OpenGL wrap mode.</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>