glm/doc/api-0.9.3/a00170.html

430 lines
18 KiB
HTML
Raw Normal View History

2011-10-24 14:24:48 +00:00
<!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>GLM_GTX_bit: Extended bitwise operations</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
2011-11-12 23:26:02 +00:00
<!-- Generated by Doxygen 1.7.3 -->
2011-10-24 14:24:48 +00:00
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
2011-11-12 23:26:02 +00:00
<td id="projectlogo"><img alt="Logo" src="logo-mini.png"></td>
2011-10-24 14:24:48 +00:00
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
2011-11-12 23:26:02 +00:00
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
2011-10-24 14:24:48 +00:00
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
2011-11-12 23:26:02 +00:00
<h1>GLM_GTX_bit: Extended bitwise operations</h1> </div>
<div class="ingroups"><a class="el" href="a00152.html">GTX Extensions (Experimental)</a></div></div>
2011-10-24 14:24:48 +00:00
<div class="contents">
<p>Allow to perform bit operations on integer values.
2011-11-12 23:26:02 +00:00
<a href="#_details">More...</a></p>
2011-10-24 14:24:48 +00:00
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#ga1c1f542c65b528ece3ef686fb5d81ba1">bitRevert</a> (genType const &amp;value)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#ga05eb060b6dd7c97fafd161b00e9b38f1">bitRotateLeft</a> (genType const &amp;In, std::size_t Shift)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#ga9bdf75ccffa293713db6f4d711129077">bitRotateRight</a> (genType const &amp;In, std::size_t Shift)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genIUType , typename sizeType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">genIUType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#ga2ced7c6243ed5d1e28063ba90d9de008">extractField</a> (genIUType const &amp;v, sizeType const &amp;first, sizeType const &amp;count)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genIUType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genIUType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#gae42f1f6dd35271781f2c1029dd1c0a09">fillBitfieldWithOne</a> (genIUType const &amp;Value, int const &amp;FromBit, int const &amp;ToBit)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genIUType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genIUType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#ga4ba23fa82e64b0840b4b0b910217f730">fillBitfieldWithZero</a> (genIUType const &amp;Value, int const &amp;FromBit, int const &amp;ToBit)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#gaf6631fa5cb5cac607706ec020e2cc718">highestBit</a> (genType const &amp;value)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#ga63ffd8b9d5a1e3fe3213059196c8369b">highestBitValue</a> (genType const &amp;value)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#ga46b94af83e87d1e7e9de92ef2465fe4e">isPowerOfTwo</a> (genType const &amp;value)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#ga93c2f76f0b437371de1dcb0923a4918d">lowestBit</a> (genType const &amp;value)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genIType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">genIType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#ga02e7aad9f8900fe483177b84d03037a1">mask</a> (genIType const &amp;count)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#gad618ae43f546aadc27c80c138c155772">powerOfTwoAbove</a> (genType const &amp;value)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#gae5e33169af7437396eef62776fdccc7a">powerOfTwoBelow</a> (genType const &amp;value)</td></tr>
2011-10-24 14:24:48 +00:00
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
2011-11-12 23:26:02 +00:00
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00170.html#gad0944ea5228ef8b5c1e449e5a5f876d1">powerOfTwoNearest</a> (genType const &amp;value)</td></tr>
2011-10-24 14:24:48 +00:00
</table>
2011-11-12 23:26:02 +00:00
<hr/><a name="_details"></a><h2>Detailed Description</h2>
2011-10-24 14:24:48 +00:00
<p>Allow to perform bit operations on integer values. </p>
2011-11-12 23:26:02 +00:00
<p>&lt;<a class="el" href="a00025.html" title="OpenGL Mathematics (glm.g-truc.net)">glm/gtx/bit.hpp</a>&gt; need to be included to use these functionalities. </p>
2011-10-24 14:24:48 +00:00
<hr/><h2>Function Documentation</h2>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="ga1c1f542c65b528ece3ef686fb5d81ba1"></a><!-- doxytag: member="glm::bitRevert" ref="ga1c1f542c65b528ece3ef686fb5d81ba1" args="(genType const &amp;value)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genType glm::bitRevert </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Revert all bits of any integer based type. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="ga05eb060b6dd7c97fafd161b00e9b38f1"></a><!-- doxytag: member="glm::bitRotateLeft" ref="ga05eb060b6dd7c97fafd161b00e9b38f1" args="(genType const &amp;In, std::size_t Shift)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genType glm::bitRotateLeft </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>In</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>Shift</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Rotate all bits to the left. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="ga9bdf75ccffa293713db6f4d711129077"></a><!-- doxytag: member="glm::bitRotateRight" ref="ga9bdf75ccffa293713db6f4d711129077" args="(genType const &amp;In, std::size_t Shift)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genType glm::bitRotateRight </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>In</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>Shift</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Rotate all bits to the right. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="ga2ced7c6243ed5d1e28063ba90d9de008"></a><!-- doxytag: member="glm::extractField" ref="ga2ced7c6243ed5d1e28063ba90d9de008" args="(genIUType const &amp;v, sizeType const &amp;first, sizeType const &amp;count)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genIUType glm::extractField </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genIUType const &amp;&#160;</td>
<td class="paramname"><em>v</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">sizeType const &amp;&#160;</td>
<td class="paramname"><em>first</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">sizeType const &amp;&#160;</td>
<td class="paramname"><em>count</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Component wise extraction of bit fields. </p>
<p>genType and genIType could be a scalar or a vector. From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="gae42f1f6dd35271781f2c1029dd1c0a09"></a><!-- doxytag: member="glm::fillBitfieldWithOne" ref="gae42f1f6dd35271781f2c1029dd1c0a09" args="(genIUType const &amp;Value, int const &amp;FromBit, int const &amp;ToBit)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genIUType glm::fillBitfieldWithOne </td>
<td>(</td>
<td class="paramtype">genIUType const &amp;&#160;</td>
<td class="paramname"><em>Value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int const &amp;&#160;</td>
<td class="paramname"><em>FromBit</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int const &amp;&#160;</td>
<td class="paramname"><em>ToBit</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set to 1 a range of bits. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
<a class="anchor" id="ga4ba23fa82e64b0840b4b0b910217f730"></a><!-- doxytag: member="glm::fillBitfieldWithZero" ref="ga4ba23fa82e64b0840b4b0b910217f730" args="(genIUType const &amp;Value, int const &amp;FromBit, int const &amp;ToBit)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genIUType glm::fillBitfieldWithZero </td>
<td>(</td>
<td class="paramtype">genIUType const &amp;&#160;</td>
<td class="paramname"><em>Value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int const &amp;&#160;</td>
<td class="paramname"><em>FromBit</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int const &amp;&#160;</td>
<td class="paramname"><em>ToBit</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set to 0 a range of bits. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
<a class="anchor" id="gaf6631fa5cb5cac607706ec020e2cc718"></a><!-- doxytag: member="glm::highestBit" ref="gaf6631fa5cb5cac607706ec020e2cc718" args="(genType const &amp;value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int glm::highestBit </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Find the highest bit set to 1 in a integer variable. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="ga63ffd8b9d5a1e3fe3213059196c8369b"></a><!-- doxytag: member="glm::highestBitValue" ref="ga63ffd8b9d5a1e3fe3213059196c8369b" args="(genType const &amp;value)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genType glm::highestBitValue </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Find the highest bit set to 1 in a integer variable and return its value. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="ga46b94af83e87d1e7e9de92ef2465fe4e"></a><!-- doxytag: member="glm::isPowerOfTwo" ref="ga46b94af83e87d1e7e9de92ef2465fe4e" args="(genType const &amp;value)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">bool glm::isPowerOfTwo </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return true if the value is a power of two number. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="ga93c2f76f0b437371de1dcb0923a4918d"></a><!-- doxytag: member="glm::lowestBit" ref="ga93c2f76f0b437371de1dcb0923a4918d" args="(genType const &amp;value)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">int glm::lowestBit </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Find the lowest bit set to 1 in a integer variable. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="ga02e7aad9f8900fe483177b84d03037a1"></a><!-- doxytag: member="glm::mask" ref="ga02e7aad9f8900fe483177b84d03037a1" args="(genIType const &amp;count)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genIType glm::mask </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genIType const &amp;&#160;</td>
<td class="paramname"><em>count</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Build a mask of 'count' bits From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="gad618ae43f546aadc27c80c138c155772"></a><!-- doxytag: member="glm::powerOfTwoAbove" ref="gad618ae43f546aadc27c80c138c155772" args="(genType const &amp;value)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genType glm::powerOfTwoAbove </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the power of two number which value is just higher the input value. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="gae5e33169af7437396eef62776fdccc7a"></a><!-- doxytag: member="glm::powerOfTwoBelow" ref="gae5e33169af7437396eef62776fdccc7a" args="(genType const &amp;value)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genType glm::powerOfTwoBelow </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the power of two number which value is just lower the input value. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
2011-11-12 23:26:02 +00:00
<a class="anchor" id="gad0944ea5228ef8b5c1e449e5a5f876d1"></a><!-- doxytag: member="glm::powerOfTwoNearest" ref="gad0944ea5228ef8b5c1e449e5a5f876d1" args="(genType const &amp;value)" -->
2011-10-24 14:24:48 +00:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2011-11-12 23:26:02 +00:00
<td class="memname">genType glm::powerOfTwoNearest </td>
2011-10-24 14:24:48 +00:00
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the power of two number which value is the closet to the input value. </p>
<p>From GLM_GTX_bit extension. </p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated by&#160;
<a href="http://www.doxygen.org/index.html">
2011-11-12 23:26:02 +00:00
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
2011-10-24 14:24:48 +00:00
</body>
</html>