a00372.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  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.9 API documentation: Floating-Point Pack and Unpack Functions</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="search/search.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="search/searchdata.js"></script>
  13. <script type="text/javascript" src="search/search.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(function() { init_search(); });
  16. </script>
  17. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body>
  20. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  21. <div id="titlearea">
  22. <table cellspacing="0" cellpadding="0">
  23. <tbody>
  24. <tr style="height: 56px;">
  25. <td id="projectlogo"><img alt="Logo" src="logo-mini.png"/></td>
  26. <td id="projectalign" style="padding-left: 0.5em;">
  27. <div id="projectname">0.9.9 API documentation
  28. </div>
  29. </td>
  30. </tr>
  31. </tbody>
  32. </table>
  33. </div>
  34. <!-- end header part -->
  35. <!-- Generated by Doxygen 1.8.10 -->
  36. <script type="text/javascript">
  37. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  38. </script>
  39. <div id="navrow1" class="tabs">
  40. <ul class="tablist">
  41. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  42. <li><a href="modules.html"><span>Modules</span></a></li>
  43. <li><a href="files.html"><span>Files</span></a></li>
  44. <li>
  45. <div id="MSearchBox" class="MSearchBoxInactive">
  46. <span class="left">
  47. <img id="MSearchSelect" src="search/mag_sel.png"
  48. onmouseover="return searchBox.OnSearchSelectShow()"
  49. onmouseout="return searchBox.OnSearchSelectHide()"
  50. alt=""/>
  51. <input type="text" id="MSearchField" value="Search" accesskey="S"
  52. onfocus="searchBox.OnSearchFieldFocus(true)"
  53. onblur="searchBox.OnSearchFieldFocus(false)"
  54. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  55. </span><span class="right">
  56. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  57. </span>
  58. </div>
  59. </li>
  60. </ul>
  61. </div>
  62. </div><!-- top -->
  63. <!-- window showing the filter options -->
  64. <div id="MSearchSelectWindow"
  65. onmouseover="return searchBox.OnSearchSelectShow()"
  66. onmouseout="return searchBox.OnSearchSelectHide()"
  67. onkeydown="return searchBox.OnSearchSelectKey(event)">
  68. </div>
  69. <!-- iframe showing the search results (closed by default) -->
  70. <div id="MSearchResultsWindow">
  71. <iframe src="javascript:void(0)" frameborder="0"
  72. name="MSearchResults" id="MSearchResults">
  73. </iframe>
  74. </div>
  75. <div class="header">
  76. <div class="summary">
  77. <a href="#func-members">Functions</a> </div>
  78. <div class="headertitle">
  79. <div class="title">Floating-Point Pack and Unpack Functions<div class="ingroups"><a class="el" href="a00280.html">Core features</a></div></div> </div>
  80. </div><!--header-->
  81. <div class="contents">
  82. <p>Provides GLSL functions to pack and unpack half, single and double-precision floating point values into more compact integer types.
  83. <a href="#details">More...</a></p>
  84. <table class="memberdecls">
  85. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  86. Functions</h2></td></tr>
  87. <tr class="memitem:gaa916ca426b2bb0343ba17e3753e245c2"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#gaa916ca426b2bb0343ba17e3753e245c2">packDouble2x32</a> (uvec2 const &amp;v)</td></tr>
  88. <tr class="memdesc:gaa916ca426b2bb0343ba17e3753e245c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a double-qualifier value obtained by packing the components of v into a 64-bit value. <a href="a00372.html#gaa916ca426b2bb0343ba17e3753e245c2">More...</a><br /></td></tr>
  89. <tr class="separator:gaa916ca426b2bb0343ba17e3753e245c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  90. <tr class="memitem:ga20f134b07db3a3d3a38efb2617388c92"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#ga20f134b07db3a3d3a38efb2617388c92">packHalf2x16</a> (vec2 const &amp;v)</td></tr>
  91. <tr class="memdesc:ga20f134b07db3a3d3a38efb2617388c92"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an unsigned integer obtained by converting the components of a two-component floating-point vector to the 16-bit floating-point representation found in the OpenGL Specification, and then packing these two 16- bit integers into a 32-bit unsigned integer. <a href="a00372.html#ga20f134b07db3a3d3a38efb2617388c92">More...</a><br /></td></tr>
  92. <tr class="separator:ga20f134b07db3a3d3a38efb2617388c92"><td class="memSeparator" colspan="2">&#160;</td></tr>
  93. <tr class="memitem:ga977ab172da5494e5ac63e952afacfbe2"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#ga977ab172da5494e5ac63e952afacfbe2">packSnorm2x16</a> (vec2 const &amp;v)</td></tr>
  94. <tr class="memdesc:ga977ab172da5494e5ac63e952afacfbe2"><td class="mdescLeft">&#160;</td><td class="mdescRight">First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. <a href="a00372.html#ga977ab172da5494e5ac63e952afacfbe2">More...</a><br /></td></tr>
  95. <tr class="separator:ga977ab172da5494e5ac63e952afacfbe2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  96. <tr class="memitem:ga85e8f17627516445026ab7a9c2e3531a"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#ga85e8f17627516445026ab7a9c2e3531a">packSnorm4x8</a> (vec4 const &amp;v)</td></tr>
  97. <tr class="memdesc:ga85e8f17627516445026ab7a9c2e3531a"><td class="mdescLeft">&#160;</td><td class="mdescRight">First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. <a href="a00372.html#ga85e8f17627516445026ab7a9c2e3531a">More...</a><br /></td></tr>
  98. <tr class="separator:ga85e8f17627516445026ab7a9c2e3531a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:ga0e2d107039fe608a209497af867b85fb"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#ga0e2d107039fe608a209497af867b85fb">packUnorm2x16</a> (vec2 const &amp;v)</td></tr>
  100. <tr class="memdesc:ga0e2d107039fe608a209497af867b85fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. <a href="a00372.html#ga0e2d107039fe608a209497af867b85fb">More...</a><br /></td></tr>
  101. <tr class="separator:ga0e2d107039fe608a209497af867b85fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  102. <tr class="memitem:gaf7d2f7341a9eeb4a436929d6f9ad08f2"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#gaf7d2f7341a9eeb4a436929d6f9ad08f2">packUnorm4x8</a> (vec4 const &amp;v)</td></tr>
  103. <tr class="memdesc:gaf7d2f7341a9eeb4a436929d6f9ad08f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. <a href="a00372.html#gaf7d2f7341a9eeb4a436929d6f9ad08f2">More...</a><br /></td></tr>
  104. <tr class="separator:gaf7d2f7341a9eeb4a436929d6f9ad08f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  105. <tr class="memitem:ga5f4296dc5f12f0aa67ac05b8bb322483"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL uvec2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#ga5f4296dc5f12f0aa67ac05b8bb322483">unpackDouble2x32</a> (double v)</td></tr>
  106. <tr class="memdesc:ga5f4296dc5f12f0aa67ac05b8bb322483"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a two-component unsigned integer vector representation of v. <a href="a00372.html#ga5f4296dc5f12f0aa67ac05b8bb322483">More...</a><br /></td></tr>
  107. <tr class="separator:ga5f4296dc5f12f0aa67ac05b8bb322483"><td class="memSeparator" colspan="2">&#160;</td></tr>
  108. <tr class="memitem:gaf59b52e6b28da9335322c4ae19b5d745"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL vec2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#gaf59b52e6b28da9335322c4ae19b5d745">unpackHalf2x16</a> (uint v)</td></tr>
  109. <tr class="memdesc:gaf59b52e6b28da9335322c4ae19b5d745"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, and converting them to 32-bit floating-point values. <a href="a00372.html#gaf59b52e6b28da9335322c4ae19b5d745">More...</a><br /></td></tr>
  110. <tr class="separator:gaf59b52e6b28da9335322c4ae19b5d745"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. <tr class="memitem:gacd8f8971a3fe28418be0d0fa1f786b38"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL vec2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#gacd8f8971a3fe28418be0d0fa1f786b38">unpackSnorm2x16</a> (uint p)</td></tr>
  112. <tr class="memdesc:gacd8f8971a3fe28418be0d0fa1f786b38"><td class="mdescLeft">&#160;</td><td class="mdescRight">First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. <a href="a00372.html#gacd8f8971a3fe28418be0d0fa1f786b38">More...</a><br /></td></tr>
  113. <tr class="separator:gacd8f8971a3fe28418be0d0fa1f786b38"><td class="memSeparator" colspan="2">&#160;</td></tr>
  114. <tr class="memitem:ga2db488646d48b7c43d3218954523fe82"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL vec4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#ga2db488646d48b7c43d3218954523fe82">unpackSnorm4x8</a> (uint p)</td></tr>
  115. <tr class="memdesc:ga2db488646d48b7c43d3218954523fe82"><td class="mdescLeft">&#160;</td><td class="mdescRight">First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. <a href="a00372.html#ga2db488646d48b7c43d3218954523fe82">More...</a><br /></td></tr>
  116. <tr class="separator:ga2db488646d48b7c43d3218954523fe82"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. <tr class="memitem:ga1f66188e5d65afeb9ffba1ad971e4007"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL vec2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#ga1f66188e5d65afeb9ffba1ad971e4007">unpackUnorm2x16</a> (uint p)</td></tr>
  118. <tr class="memdesc:ga1f66188e5d65afeb9ffba1ad971e4007"><td class="mdescLeft">&#160;</td><td class="mdescRight">First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. <a href="a00372.html#ga1f66188e5d65afeb9ffba1ad971e4007">More...</a><br /></td></tr>
  119. <tr class="separator:ga1f66188e5d65afeb9ffba1ad971e4007"><td class="memSeparator" colspan="2">&#160;</td></tr>
  120. <tr class="memitem:ga7f903259150b67e9466f5f8edffcd197"><td class="memItemLeft" align="right" valign="top">GLM_FUNC_DECL vec4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00372.html#ga7f903259150b67e9466f5f8edffcd197">unpackUnorm4x8</a> (uint p)</td></tr>
  121. <tr class="memdesc:ga7f903259150b67e9466f5f8edffcd197"><td class="mdescLeft">&#160;</td><td class="mdescRight">First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. <a href="a00372.html#ga7f903259150b67e9466f5f8edffcd197">More...</a><br /></td></tr>
  122. <tr class="separator:ga7f903259150b67e9466f5f8edffcd197"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. </table>
  124. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  125. <p>Provides GLSL functions to pack and unpack half, single and double-precision floating point values into more compact integer types. </p>
  126. <p>These functions do not operate component-wise, rather as described in each case.</p>
  127. <p>Include &lt;<a class="el" href="a00120.html" title="Core features ">glm/packing.hpp</a>&gt; to use these core features. </p>
  128. <h2 class="groupheader">Function Documentation</h2>
  129. <a class="anchor" id="gaa916ca426b2bb0343ba17e3753e245c2"></a>
  130. <div class="memitem">
  131. <div class="memproto">
  132. <table class="memname">
  133. <tr>
  134. <td class="memname">GLM_FUNC_DECL double glm::packDouble2x32 </td>
  135. <td>(</td>
  136. <td class="paramtype"><a class="el" href="a00281.html#ga2f6d9ec3ae14813ade37d6aee3715fdb">uvec2</a> const &amp;&#160;</td>
  137. <td class="paramname"><em>v</em></td><td>)</td>
  138. <td></td>
  139. </tr>
  140. </table>
  141. </div><div class="memdoc">
  142. <p>Returns a double-qualifier value obtained by packing the components of v into a 64-bit value. </p>
  143. <p>If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. Otherwise, the bit- level representation of v is preserved. The first vector component specifies the 32 least significant bits; the second component specifies the 32 most significant bits.</p>
  144. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a> </dd>
  145. <dd>
  146. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  147. </div>
  148. </div>
  149. <a class="anchor" id="ga20f134b07db3a3d3a38efb2617388c92"></a>
  150. <div class="memitem">
  151. <div class="memproto">
  152. <table class="memname">
  153. <tr>
  154. <td class="memname">GLM_FUNC_DECL uint glm::packHalf2x16 </td>
  155. <td>(</td>
  156. <td class="paramtype"><a class="el" href="a00281.html#gabe65c061834f61b4f7cb6037b19006a4">vec2</a> const &amp;&#160;</td>
  157. <td class="paramname"><em>v</em></td><td>)</td>
  158. <td></td>
  159. </tr>
  160. </table>
  161. </div><div class="memdoc">
  162. <p>Returns an unsigned integer obtained by converting the components of a two-component floating-point vector to the 16-bit floating-point representation found in the OpenGL Specification, and then packing these two 16- bit integers into a 32-bit unsigned integer. </p>
  163. <p>The first vector component specifies the 16 least-significant bits of the result; the second component specifies the 16 most-significant bits.</p>
  164. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> </dd>
  165. <dd>
  166. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  167. </div>
  168. </div>
  169. <a class="anchor" id="ga977ab172da5494e5ac63e952afacfbe2"></a>
  170. <div class="memitem">
  171. <div class="memproto">
  172. <table class="memname">
  173. <tr>
  174. <td class="memname">GLM_FUNC_DECL uint glm::packSnorm2x16 </td>
  175. <td>(</td>
  176. <td class="paramtype"><a class="el" href="a00281.html#gabe65c061834f61b4f7cb6037b19006a4">vec2</a> const &amp;&#160;</td>
  177. <td class="paramname"><em>v</em></td><td>)</td>
  178. <td></td>
  179. </tr>
  180. </table>
  181. </div><div class="memdoc">
  182. <p>First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. </p>
  183. <p>Then, the results are packed into the returned 32-bit unsigned integer.</p>
  184. <p>The conversion for component c of v to fixed point is done as follows: packSnorm2x16: round(clamp(v, -1, +1) * 32767.0)</p>
  185. <p>The first component of the vector will be written to the least significant bits of the output; the last component will be written to the most significant bits.</p>
  186. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a> </dd>
  187. <dd>
  188. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  189. </div>
  190. </div>
  191. <a class="anchor" id="ga85e8f17627516445026ab7a9c2e3531a"></a>
  192. <div class="memitem">
  193. <div class="memproto">
  194. <table class="memname">
  195. <tr>
  196. <td class="memname">GLM_FUNC_DECL uint glm::packSnorm4x8 </td>
  197. <td>(</td>
  198. <td class="paramtype"><a class="el" href="a00281.html#gac215a35481a6597d1bf622a382e9d6e2">vec4</a> const &amp;&#160;</td>
  199. <td class="paramname"><em>v</em></td><td>)</td>
  200. <td></td>
  201. </tr>
  202. </table>
  203. </div><div class="memdoc">
  204. <p>First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. </p>
  205. <p>Then, the results are packed into the returned 32-bit unsigned integer.</p>
  206. <p>The conversion for component c of v to fixed point is done as follows: packSnorm4x8: round(clamp(c, -1, +1) * 127.0)</p>
  207. <p>The first component of the vector will be written to the least significant bits of the output; the last component will be written to the most significant bits.</p>
  208. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> </dd>
  209. <dd>
  210. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  211. </div>
  212. </div>
  213. <a class="anchor" id="ga0e2d107039fe608a209497af867b85fb"></a>
  214. <div class="memitem">
  215. <div class="memproto">
  216. <table class="memname">
  217. <tr>
  218. <td class="memname">GLM_FUNC_DECL uint glm::packUnorm2x16 </td>
  219. <td>(</td>
  220. <td class="paramtype"><a class="el" href="a00281.html#gabe65c061834f61b4f7cb6037b19006a4">vec2</a> const &amp;&#160;</td>
  221. <td class="paramname"><em>v</em></td><td>)</td>
  222. <td></td>
  223. </tr>
  224. </table>
  225. </div><div class="memdoc">
  226. <p>First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. </p>
  227. <p>Then, the results are packed into the returned 32-bit unsigned integer.</p>
  228. <p>The conversion for component c of v to fixed point is done as follows: packUnorm2x16: round(clamp(c, 0, +1) * 65535.0)</p>
  229. <p>The first component of the vector will be written to the least significant bits of the output; the last component will be written to the most significant bits.</p>
  230. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a> </dd>
  231. <dd>
  232. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  233. </div>
  234. </div>
  235. <a class="anchor" id="gaf7d2f7341a9eeb4a436929d6f9ad08f2"></a>
  236. <div class="memitem">
  237. <div class="memproto">
  238. <table class="memname">
  239. <tr>
  240. <td class="memname">GLM_FUNC_DECL uint glm::packUnorm4x8 </td>
  241. <td>(</td>
  242. <td class="paramtype"><a class="el" href="a00281.html#gac215a35481a6597d1bf622a382e9d6e2">vec4</a> const &amp;&#160;</td>
  243. <td class="paramname"><em>v</em></td><td>)</td>
  244. <td></td>
  245. </tr>
  246. </table>
  247. </div><div class="memdoc">
  248. <p>First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. </p>
  249. <p>Then, the results are packed into the returned 32-bit unsigned integer.</p>
  250. <p>The conversion for component c of v to fixed point is done as follows: packUnorm4x8: round(clamp(c, 0, +1) * 255.0)</p>
  251. <p>The first component of the vector will be written to the least significant bits of the output; the last component will be written to the most significant bits.</p>
  252. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> </dd>
  253. <dd>
  254. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  255. </div>
  256. </div>
  257. <a class="anchor" id="ga5f4296dc5f12f0aa67ac05b8bb322483"></a>
  258. <div class="memitem">
  259. <div class="memproto">
  260. <table class="memname">
  261. <tr>
  262. <td class="memname">GLM_FUNC_DECL uvec2 glm::unpackDouble2x32 </td>
  263. <td>(</td>
  264. <td class="paramtype">double&#160;</td>
  265. <td class="paramname"><em>v</em></td><td>)</td>
  266. <td></td>
  267. </tr>
  268. </table>
  269. </div><div class="memdoc">
  270. <p>Returns a two-component unsigned integer vector representation of v. </p>
  271. <p>The bit-level representation of v is preserved. The first component of the vector contains the 32 least significant bits of the double; the second component consists the 32 most significant bits.</p>
  272. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a> </dd>
  273. <dd>
  274. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  275. </div>
  276. </div>
  277. <a class="anchor" id="gaf59b52e6b28da9335322c4ae19b5d745"></a>
  278. <div class="memitem">
  279. <div class="memproto">
  280. <table class="memname">
  281. <tr>
  282. <td class="memname">GLM_FUNC_DECL vec2 glm::unpackHalf2x16 </td>
  283. <td>(</td>
  284. <td class="paramtype">uint&#160;</td>
  285. <td class="paramname"><em>v</em></td><td>)</td>
  286. <td></td>
  287. </tr>
  288. </table>
  289. </div><div class="memdoc">
  290. <p>Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, and converting them to 32-bit floating-point values. </p>
  291. <p>The first component of the vector is obtained from the 16 least-significant bits of v; the second component is obtained from the 16 most-significant bits of v.</p>
  292. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a> </dd>
  293. <dd>
  294. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  295. </div>
  296. </div>
  297. <a class="anchor" id="gacd8f8971a3fe28418be0d0fa1f786b38"></a>
  298. <div class="memitem">
  299. <div class="memproto">
  300. <table class="memname">
  301. <tr>
  302. <td class="memname">GLM_FUNC_DECL vec2 glm::unpackSnorm2x16 </td>
  303. <td>(</td>
  304. <td class="paramtype">uint&#160;</td>
  305. <td class="paramname"><em>p</em></td><td>)</td>
  306. <td></td>
  307. </tr>
  308. </table>
  309. </div><div class="memdoc">
  310. <p>First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. </p>
  311. <p>Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.</p>
  312. <p>The conversion for unpacked fixed-point value f to floating point is done as follows: unpackSnorm2x16: clamp(f / 32767.0, -1, +1)</p>
  313. <p>The first component of the returned vector will be extracted from the least significant bits of the input; the last component will be extracted from the most significant bits.</p>
  314. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a> </dd>
  315. <dd>
  316. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  317. </div>
  318. </div>
  319. <a class="anchor" id="ga2db488646d48b7c43d3218954523fe82"></a>
  320. <div class="memitem">
  321. <div class="memproto">
  322. <table class="memname">
  323. <tr>
  324. <td class="memname">GLM_FUNC_DECL vec4 glm::unpackSnorm4x8 </td>
  325. <td>(</td>
  326. <td class="paramtype">uint&#160;</td>
  327. <td class="paramname"><em>p</em></td><td>)</td>
  328. <td></td>
  329. </tr>
  330. </table>
  331. </div><div class="memdoc">
  332. <p>First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. </p>
  333. <p>Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.</p>
  334. <p>The conversion for unpacked fixed-point value f to floating point is done as follows: unpackSnorm4x8: clamp(f / 127.0, -1, +1)</p>
  335. <p>The first component of the returned vector will be extracted from the least significant bits of the input; the last component will be extracted from the most significant bits.</p>
  336. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> </dd>
  337. <dd>
  338. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  339. </div>
  340. </div>
  341. <a class="anchor" id="ga1f66188e5d65afeb9ffba1ad971e4007"></a>
  342. <div class="memitem">
  343. <div class="memproto">
  344. <table class="memname">
  345. <tr>
  346. <td class="memname">GLM_FUNC_DECL vec2 glm::unpackUnorm2x16 </td>
  347. <td>(</td>
  348. <td class="paramtype">uint&#160;</td>
  349. <td class="paramname"><em>p</em></td><td>)</td>
  350. <td></td>
  351. </tr>
  352. </table>
  353. </div><div class="memdoc">
  354. <p>First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. </p>
  355. <p>Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.</p>
  356. <p>The conversion for unpacked fixed-point value f to floating point is done as follows: unpackUnorm2x16: f / 65535.0</p>
  357. <p>The first component of the returned vector will be extracted from the least significant bits of the input; the last component will be extracted from the most significant bits.</p>
  358. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> </dd>
  359. <dd>
  360. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  361. </div>
  362. </div>
  363. <a class="anchor" id="ga7f903259150b67e9466f5f8edffcd197"></a>
  364. <div class="memitem">
  365. <div class="memproto">
  366. <table class="memname">
  367. <tr>
  368. <td class="memname">GLM_FUNC_DECL vec4 glm::unpackUnorm4x8 </td>
  369. <td>(</td>
  370. <td class="paramtype">uint&#160;</td>
  371. <td class="paramname"><em>p</em></td><td>)</td>
  372. <td></td>
  373. </tr>
  374. </table>
  375. </div><div class="memdoc">
  376. <p>First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. </p>
  377. <p>Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.</p>
  378. <p>The conversion for unpacked fixed-point value f to floating point is done as follows: unpackUnorm4x8: f / 255.0</p>
  379. <p>The first component of the returned vector will be extracted from the least significant bits of the input; the last component will be extracted from the most significant bits.</p>
  380. <dl class="section see"><dt>See also</dt><dd><a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> </dd>
  381. <dd>
  382. <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> </dd></dl>
  383. </div>
  384. </div>
  385. </div><!-- contents -->
  386. <!-- start footer part -->
  387. <hr class="footer"/><address class="footer"><small>
  388. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  389. <img class="footer" src="doxygen.png" alt="doxygen"/>
  390. </a> 1.8.10
  391. </small></address>
  392. </body>
  393. </html>