mirror of
https://github.com/g-truc/glm.git
synced 2024-11-15 14:24:36 +00:00
127 lines
10 KiB
HTML
127 lines
10 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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"/>
|
|
<title>func_integer.hpp Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<!-- Generated by Doxygen 1.7.4 -->
|
|
<div id="top">
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="logo-mini.png"/></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">func_integer.hpp</div> </div>
|
|
</div>
|
|
<div class="contents">
|
|
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
|
|
<a name="l00002"></a>00002 <span class="comment">// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)</span>
|
|
<a name="l00004"></a>00004 <span class="comment"></span><span class="comment">// Created : 2010-03-17</span>
|
|
<a name="l00005"></a>00005 <span class="comment">// Updated : 2010-03-31</span>
|
|
<a name="l00006"></a>00006 <span class="comment">// Licence : This source is under MIT License</span>
|
|
<a name="l00007"></a>00007 <span class="comment">// File : glm/core/func_integer.hpp</span>
|
|
<a name="l00009"></a>00009 <span class="comment"></span>
|
|
<a name="l00010"></a>00010 <span class="preprocessor">#ifndef glm_core_func_integer</span>
|
|
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define glm_core_func_integer</span>
|
|
<a name="l00012"></a>00012 <span class="preprocessor"></span>
|
|
<a name="l00013"></a>00013 <span class="keyword">namespace </span>glm
|
|
<a name="l00014"></a>00014 {
|
|
<a name="l00015"></a>00015 <span class="keyword">namespace </span>core{
|
|
<a name="l00016"></a>00016 <span class="keyword">namespace </span>function{
|
|
<a name="l00018"></a><a class="code" href="a00149.html">00018</a> <span class="keyword">namespace </span>integer{
|
|
<a name="l00019"></a>00019
|
|
<a name="l00022"></a>00022
|
|
<a name="l00029"></a>00029 <span class="keyword">template</span> <<span class="keyword">typename</span> genUType>
|
|
<a name="l00030"></a>00030 genUType <a class="code" href="a00238.html#ga8d63fd56743cc93286f09742baed4002" title="Adds 32-bit unsigned integer x and y, returning the sum modulo pow(2, 32).">uaddCarry</a>(
|
|
<a name="l00031"></a>00031 genUType <span class="keyword">const</span> & x,
|
|
<a name="l00032"></a>00032 genUType <span class="keyword">const</span> & y,
|
|
<a name="l00033"></a>00033 genUType & carry);
|
|
<a name="l00034"></a>00034
|
|
<a name="l00041"></a>00041 <span class="keyword">template</span> <<span class="keyword">typename</span> genUType>
|
|
<a name="l00042"></a>00042 genUType <a class="code" href="a00238.html#ga5ea2ea51e7cf73056069ce7583d61560" title="Subtracts the 32-bit unsigned integer y from x, returning the difference if non-negative, or pow(2, 32) plus the difference otherwise.">usubBorrow</a>(
|
|
<a name="l00043"></a>00043 genUType <span class="keyword">const</span> & x,
|
|
<a name="l00044"></a>00044 genUType <span class="keyword">const</span> & y,
|
|
<a name="l00045"></a>00045 genUType & borrow);
|
|
<a name="l00046"></a>00046
|
|
<a name="l00053"></a>00053 <span class="keyword">template</span> <<span class="keyword">typename</span> genUType>
|
|
<a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="a00238.html#gad9b60d1c7e161b78682b7f8b071e213e" title="Multiplies 32-bit integers x and y, producing a 64-bit result.">umulExtended</a>(
|
|
<a name="l00055"></a>00055 genUType <span class="keyword">const</span> & x,
|
|
<a name="l00056"></a>00056 genUType <span class="keyword">const</span> & y,
|
|
<a name="l00057"></a>00057 genUType & msb,
|
|
<a name="l00058"></a>00058 genUType & lsb);
|
|
<a name="l00059"></a>00059
|
|
<a name="l00066"></a>00066 <span class="keyword">template</span> <<span class="keyword">typename</span> genIType>
|
|
<a name="l00067"></a>00067 <span class="keywordtype">void</span> <a class="code" href="a00238.html#gac01a66145ce9472afb6a3bee837c0bd6" title="Multiplies 32-bit integers x and y, producing a 64-bit result.">imulExtended</a>(
|
|
<a name="l00068"></a>00068 genIType <span class="keyword">const</span> & x,
|
|
<a name="l00069"></a>00069 genIType <span class="keyword">const</span> & y,
|
|
<a name="l00070"></a>00070 genIType & msb,
|
|
<a name="l00071"></a>00071 genIType & lsb);
|
|
<a name="l00072"></a>00072
|
|
<a name="l00086"></a>00086 <span class="keyword">template</span> <<span class="keyword">typename</span> genIUType>
|
|
<a name="l00087"></a>00087 genIUType <a class="code" href="a00238.html#ga3b4804e700ade895189ea8bde142c822" title="Extracts bits [offset, offset + bits - 1] from value, returning them in the least significant bits of...">bitfieldExtract</a>(
|
|
<a name="l00088"></a>00088 genIUType <span class="keyword">const</span> & Value,
|
|
<a name="l00089"></a>00089 <span class="keywordtype">int</span> <span class="keyword">const</span> & Offset,
|
|
<a name="l00090"></a>00090 <span class="keywordtype">int</span> <span class="keyword">const</span> & Bits);
|
|
<a name="l00091"></a>00091
|
|
<a name="l00104"></a>00104 <span class="keyword">template</span> <<span class="keyword">typename</span> genIUType>
|
|
<a name="l00105"></a>00105 genIUType <a class="code" href="a00238.html#ga90d0bc8e79f637da58b8fad2fc8f3275" title="Returns the insertion the bits least-significant bits of insert into base.">bitfieldInsert</a>(
|
|
<a name="l00106"></a>00106 genIUType <span class="keyword">const</span> & Base,
|
|
<a name="l00107"></a>00107 genIUType <span class="keyword">const</span> & Insert,
|
|
<a name="l00108"></a>00108 <span class="keywordtype">int</span> <span class="keyword">const</span> & Offset,
|
|
<a name="l00109"></a>00109 <span class="keywordtype">int</span> <span class="keyword">const</span> & Bits);
|
|
<a name="l00110"></a>00110
|
|
<a name="l00117"></a>00117 <span class="keyword">template</span> <<span class="keyword">typename</span> genIUType>
|
|
<a name="l00118"></a>00118 genIUType <a class="code" href="a00238.html#ga68bdb2c3debc414d5567935b4cbca62f" title="Returns the reversal of the bits of value.">bitfieldReverse</a>(genIUType <span class="keyword">const</span> & value);
|
|
<a name="l00119"></a>00119
|
|
<a name="l00124"></a>00124 <span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">template</span> <<span class="keyword">typename</span>> <span class="keyword">class </span>C>
|
|
<a name="l00125"></a>00125 <span class="keyword">typename</span> C<T>::signed_type <a class="code" href="a00238.html#ga29cfb04fafbaa1939955f11fef28ff38" title="Returns the number of bits set to 1 in the binary representation of value.">bitCount</a>(C<T> <span class="keyword">const</span> & Value);
|
|
<a name="l00126"></a>00126
|
|
<a name="l00133"></a>00133 <span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">template</span> <<span class="keyword">typename</span>> <span class="keyword">class </span>C>
|
|
<a name="l00134"></a>00134 <span class="keyword">typename</span> C<T>::signed_type <a class="code" href="a00238.html#ga9890456d065156a3c3c9786b14638486" title="Returns the bit number of the least significant bit set to 1 in the binary representation of value...">findLSB</a>(C<T> <span class="keyword">const</span> & Value);
|
|
<a name="l00135"></a>00135
|
|
<a name="l00143"></a>00143 <span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">template</span> <<span class="keyword">typename</span>> <span class="keyword">class </span>C>
|
|
<a name="l00144"></a>00144 <span class="keyword">typename</span> C<T>::signed_type <a class="code" href="a00238.html#ga0f50b6fe121f170c3725a8abb53ff077" title="Returns the bit number of the most significant bit in the binary representation of value...">findMSB</a>(C<T> <span class="keyword">const</span> & Value);
|
|
<a name="l00145"></a>00145
|
|
<a name="l00147"></a>00147
|
|
<a name="l00148"></a>00148 }<span class="comment">//namespace integer</span>
|
|
<a name="l00149"></a>00149 }<span class="comment">//namespace function</span>
|
|
<a name="l00150"></a>00150 }<span class="comment">//namespace core</span>
|
|
<a name="l00151"></a>00151
|
|
<a name="l00152"></a>00152 <span class="keyword">using namespace </span>core::function::integer;
|
|
<a name="l00153"></a>00153 }<span class="comment">//namespace glm</span>
|
|
<a name="l00154"></a>00154
|
|
<a name="l00155"></a>00155 <span class="preprocessor">#include "func_integer.inl"</span>
|
|
<a name="l00156"></a>00156
|
|
<a name="l00157"></a>00157 <span class="preprocessor">#endif//glm_core_func_integer</span>
|
|
<a name="l00158"></a>00158 <span class="preprocessor"></span>
|
|
</pre></div></div>
|
|
</div>
|
|
<hr class="footer"/><address class="footer"><small>Generated by 
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
|
</body>
|
|
</html>
|