a00165.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.10"/>
  7. <title>0.9.8: GLM_GTC_integer</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  12. </head>
  13. <body>
  14. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  15. <div id="titlearea">
  16. <table cellspacing="0" cellpadding="0">
  17. <tbody>
  18. <tr style="height: 56px;">
  19. <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  20. <td id="projectalign" style="padding-left: 0.5em;">
  21. <div id="projectname">0.9.8
  22. </div>
  23. </td>
  24. </tr>
  25. </tbody>
  26. </table>
  27. </div>
  28. <!-- end header part -->
  29. <!-- Generated by Doxygen 1.8.10 -->
  30. <div id="navrow1" class="tabs">
  31. <ul class="tablist">
  32. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  33. <li><a href="modules.html"><span>Modules</span></a></li>
  34. <li><a href="files.html"><span>Files</span></a></li>
  35. </ul>
  36. </div>
  37. </div><!-- top -->
  38. <div class="header">
  39. <div class="summary">
  40. <a href="#func-members">Functions</a> </div>
  41. <div class="headertitle">
  42. <div class="title">GLM_GTC_integer<div class="ingroups"><a class="el" href="a00154.html">GTC Extensions (Stable)</a></div></div> </div>
  43. </div><!--header-->
  44. <div class="contents">
  45. <table class="memberdecls">
  46. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  47. Functions</h2></td></tr>
  48. <tr class="memitem:ga0a42ffb863cc980e91f98d2f5766de20"><td class="memTemplParams" colspan="2">template&lt;typename T , precision P, template&lt; typename, precision &gt; class vecType&gt; </td></tr>
  49. <tr class="memitem:ga0a42ffb863cc980e91f98d2f5766de20"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vecType&lt; int, P &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00165.html#ga0a42ffb863cc980e91f98d2f5766de20">iround</a> (vecType&lt; T, P &gt; const &amp;x)</td></tr>
  50. <tr class="separator:ga0a42ffb863cc980e91f98d2f5766de20"><td class="memSeparator" colspan="2">&#160;</td></tr>
  51. <tr class="memitem:ga9bd682e74bfacb005c735305207ec417"><td class="memTemplParams" colspan="2">template&lt;typename genIUType &gt; </td></tr>
  52. <tr class="memitem:ga9bd682e74bfacb005c735305207ec417"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL genIUType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00165.html#ga9bd682e74bfacb005c735305207ec417">log2</a> (genIUType x)</td></tr>
  53. <tr class="separator:ga9bd682e74bfacb005c735305207ec417"><td class="memSeparator" colspan="2">&#160;</td></tr>
  54. <tr class="memitem:ga75c6fd2a143fc44e5f7b871abad539e0"><td class="memTemplParams" colspan="2">template&lt;typename genIUType &gt; </td></tr>
  55. <tr class="memitem:ga75c6fd2a143fc44e5f7b871abad539e0"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL genIUType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00165.html#ga75c6fd2a143fc44e5f7b871abad539e0">mod</a> (genIUType x, genIUType y)</td></tr>
  56. <tr class="separator:ga75c6fd2a143fc44e5f7b871abad539e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  57. <tr class="memitem:gac76ae7d82ff22526bcf6d6a1b51af6c3"><td class="memTemplParams" colspan="2">template&lt;typename T , precision P, template&lt; typename, precision &gt; class vecType&gt; </td></tr>
  58. <tr class="memitem:gac76ae7d82ff22526bcf6d6a1b51af6c3"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vecType&lt; T, P &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00165.html#gac76ae7d82ff22526bcf6d6a1b51af6c3">mod</a> (vecType&lt; T, P &gt; const &amp;x, T y)</td></tr>
  59. <tr class="separator:gac76ae7d82ff22526bcf6d6a1b51af6c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  60. <tr class="memitem:gaf5ae5330f6b30b4a35fb95f9a73d6134"><td class="memTemplParams" colspan="2">template&lt;typename T , precision P, template&lt; typename, precision &gt; class vecType&gt; </td></tr>
  61. <tr class="memitem:gaf5ae5330f6b30b4a35fb95f9a73d6134"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vecType&lt; T, P &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00165.html#gaf5ae5330f6b30b4a35fb95f9a73d6134">mod</a> (vecType&lt; T, P &gt; const &amp;x, vecType&lt; T, P &gt; const &amp;y)</td></tr>
  62. <tr class="separator:gaf5ae5330f6b30b4a35fb95f9a73d6134"><td class="memSeparator" colspan="2">&#160;</td></tr>
  63. <tr class="memitem:gab61b8546aafdf58f119eb892b212607c"><td class="memTemplParams" colspan="2">template&lt;typename T , precision P, template&lt; typename, precision &gt; class vecType&gt; </td></tr>
  64. <tr class="memitem:gab61b8546aafdf58f119eb892b212607c"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL vecType&lt; uint, P &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00165.html#gab61b8546aafdf58f119eb892b212607c">uround</a> (vecType&lt; T, P &gt; const &amp;x)</td></tr>
  65. <tr class="separator:gab61b8546aafdf58f119eb892b212607c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  66. </table>
  67. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  68. <p>Allow to perform bit operations on integer values. </p>
  69. <p>&lt;<a class="el" href="a00044.html" title="GLM_GTC_integer ">glm/gtc/integer.hpp</a>&gt; need to be included to use these functionalities. </p>
  70. <h2 class="groupheader">Function Documentation</h2>
  71. <a class="anchor" id="ga0a42ffb863cc980e91f98d2f5766de20"></a>
  72. <div class="memitem">
  73. <div class="memproto">
  74. <table class="memname">
  75. <tr>
  76. <td class="memname">GLM_FUNC_DECL vecType&lt;int, P&gt; glm::iround </td>
  77. <td>(</td>
  78. <td class="paramtype">vecType&lt; T, P &gt; const &amp;&#160;</td>
  79. <td class="paramname"><em>x</em></td><td>)</td>
  80. <td></td>
  81. </tr>
  82. </table>
  83. </div><div class="memdoc">
  84. <p>Returns a value equal to the nearest integer to x. </p>
  85. <p>The fraction 0.5 will round in a direction chosen by the implementation, presumably the direction that is fastest.</p>
  86. <dl class="params"><dt>Parameters</dt><dd>
  87. <table class="params">
  88. <tr><td class="paramname">x</td><td>The values of the argument must be greater or equal to zero. </td></tr>
  89. </table>
  90. </dd>
  91. </dl>
  92. <dl class="tparams"><dt>Template Parameters</dt><dd>
  93. <table class="tparams">
  94. <tr><td class="paramname">T</td><td>floating point scalar types. </td></tr>
  95. <tr><td class="paramname">vecType</td><td>vector types.</td></tr>
  96. </table>
  97. </dd>
  98. </dl>
  99. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a> </dd>
  100. <dd>
  101. <a class="el" href="a00165.html" title="Allow to perform bit operations on integer values. ">GLM_GTC_integer</a> </dd></dl>
  102. </div>
  103. </div>
  104. <a class="anchor" id="ga9bd682e74bfacb005c735305207ec417"></a>
  105. <div class="memitem">
  106. <div class="memproto">
  107. <table class="memname">
  108. <tr>
  109. <td class="memname">GLM_FUNC_DECL genIUType glm::log2 </td>
  110. <td>(</td>
  111. <td class="paramtype">genIUType&#160;</td>
  112. <td class="paramname"><em>x</em></td><td>)</td>
  113. <td></td>
  114. </tr>
  115. </table>
  116. </div><div class="memdoc">
  117. <p>Returns the log2 of x for integer values. </p>
  118. <p>Can be reliably using to compute mipmap count from the texture size. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="a00165.html" title="Allow to perform bit operations on integer values. ">GLM_GTC_integer</a> </dd></dl>
  119. </div>
  120. </div>
  121. <a class="anchor" id="ga75c6fd2a143fc44e5f7b871abad539e0"></a>
  122. <div class="memitem">
  123. <div class="memproto">
  124. <table class="memname">
  125. <tr>
  126. <td class="memname">GLM_FUNC_DECL genIUType glm::mod </td>
  127. <td>(</td>
  128. <td class="paramtype">genIUType&#160;</td>
  129. <td class="paramname"><em>x</em>, </td>
  130. </tr>
  131. <tr>
  132. <td class="paramkey"></td>
  133. <td></td>
  134. <td class="paramtype">genIUType&#160;</td>
  135. <td class="paramname"><em>y</em>&#160;</td>
  136. </tr>
  137. <tr>
  138. <td></td>
  139. <td>)</td>
  140. <td></td><td></td>
  141. </tr>
  142. </table>
  143. </div><div class="memdoc">
  144. <p>Modulus. </p>
  145. <p>Returns x % y for each component in x using the floating point value y.</p>
  146. <dl class="tparams"><dt>Template Parameters</dt><dd>
  147. <table class="tparams">
  148. <tr><td class="paramname">genIUType</td><td>Integer-point scalar or vector types.</td></tr>
  149. </table>
  150. </dd>
  151. </dl>
  152. <dl class="section see"><dt>See also</dt><dd><a class="el" href="a00165.html" title="Allow to perform bit operations on integer values. ">GLM_GTC_integer</a> </dd>
  153. <dd>
  154. <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> </dd>
  155. <dd>
  156. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> </dd></dl>
  157. </div>
  158. </div>
  159. <a class="anchor" id="gac76ae7d82ff22526bcf6d6a1b51af6c3"></a>
  160. <div class="memitem">
  161. <div class="memproto">
  162. <table class="memname">
  163. <tr>
  164. <td class="memname">GLM_FUNC_DECL vecType&lt; T, P &gt; mod </td>
  165. <td>(</td>
  166. <td class="paramtype">vecType&lt; T, P &gt; const &amp;&#160;</td>
  167. <td class="paramname"><em>x</em>, </td>
  168. </tr>
  169. <tr>
  170. <td class="paramkey"></td>
  171. <td></td>
  172. <td class="paramtype">T&#160;</td>
  173. <td class="paramname"><em>y</em>&#160;</td>
  174. </tr>
  175. <tr>
  176. <td></td>
  177. <td>)</td>
  178. <td></td><td></td>
  179. </tr>
  180. </table>
  181. </div><div class="memdoc">
  182. <p>Modulus. </p>
  183. <p>Returns x % y for each component in x using the floating point value y.</p>
  184. <dl class="tparams"><dt>Template Parameters</dt><dd>
  185. <table class="tparams">
  186. <tr><td class="paramname">T</td><td>Integer scalar types. </td></tr>
  187. <tr><td class="paramname">vecType</td><td>vector types.</td></tr>
  188. </table>
  189. </dd>
  190. </dl>
  191. <dl class="section see"><dt>See also</dt><dd><a class="el" href="a00165.html" title="Allow to perform bit operations on integer values. ">GLM_GTC_integer</a> </dd>
  192. <dd>
  193. <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> </dd>
  194. <dd>
  195. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> </dd></dl>
  196. </div>
  197. </div>
  198. <a class="anchor" id="gaf5ae5330f6b30b4a35fb95f9a73d6134"></a>
  199. <div class="memitem">
  200. <div class="memproto">
  201. <table class="memname">
  202. <tr>
  203. <td class="memname">GLM_FUNC_DECL vecType&lt; T, P &gt; mod </td>
  204. <td>(</td>
  205. <td class="paramtype">vecType&lt; T, P &gt; const &amp;&#160;</td>
  206. <td class="paramname"><em>x</em>, </td>
  207. </tr>
  208. <tr>
  209. <td class="paramkey"></td>
  210. <td></td>
  211. <td class="paramtype">vecType&lt; T, P &gt; const &amp;&#160;</td>
  212. <td class="paramname"><em>y</em>&#160;</td>
  213. </tr>
  214. <tr>
  215. <td></td>
  216. <td>)</td>
  217. <td></td><td></td>
  218. </tr>
  219. </table>
  220. </div><div class="memdoc">
  221. <p>Modulus. </p>
  222. <p>Returns x % y for each component in x using the floating point value y.</p>
  223. <dl class="tparams"><dt>Template Parameters</dt><dd>
  224. <table class="tparams">
  225. <tr><td class="paramname">T</td><td>Integer scalar types. </td></tr>
  226. <tr><td class="paramname">vecType</td><td>vector types.</td></tr>
  227. </table>
  228. </dd>
  229. </dl>
  230. <dl class="section see"><dt>See also</dt><dd><a class="el" href="a00165.html" title="Allow to perform bit operations on integer values. ">GLM_GTC_integer</a> </dd>
  231. <dd>
  232. <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> </dd>
  233. <dd>
  234. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> </dd></dl>
  235. </div>
  236. </div>
  237. <a class="anchor" id="gab61b8546aafdf58f119eb892b212607c"></a>
  238. <div class="memitem">
  239. <div class="memproto">
  240. <table class="memname">
  241. <tr>
  242. <td class="memname">GLM_FUNC_DECL vecType&lt;uint, P&gt; glm::uround </td>
  243. <td>(</td>
  244. <td class="paramtype">vecType&lt; T, P &gt; const &amp;&#160;</td>
  245. <td class="paramname"><em>x</em></td><td>)</td>
  246. <td></td>
  247. </tr>
  248. </table>
  249. </div><div class="memdoc">
  250. <p>Returns a value equal to the nearest integer to x. </p>
  251. <p>The fraction 0.5 will round in a direction chosen by the implementation, presumably the direction that is fastest.</p>
  252. <dl class="params"><dt>Parameters</dt><dd>
  253. <table class="params">
  254. <tr><td class="paramname">x</td><td>The values of the argument must be greater or equal to zero. </td></tr>
  255. </table>
  256. </dd>
  257. </dl>
  258. <dl class="tparams"><dt>Template Parameters</dt><dd>
  259. <table class="tparams">
  260. <tr><td class="paramname">T</td><td>floating point scalar types. </td></tr>
  261. <tr><td class="paramname">vecType</td><td>vector types.</td></tr>
  262. </table>
  263. </dd>
  264. </dl>
  265. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a> </dd>
  266. <dd>
  267. <a class="el" href="a00165.html" title="Allow to perform bit operations on integer values. ">GLM_GTC_integer</a> </dd></dl>
  268. </div>
  269. </div>
  270. </div><!-- contents -->
  271. <!-- start footer part -->
  272. <hr class="footer"/><address class="footer"><small>
  273. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  274. <img class="footer" src="doxygen.png" alt="doxygen"/>
  275. </a> 1.8.10
  276. </small></address>
  277. </body>
  278. </html>