blob: 7379f542587964d91558637a3c8849a687d00c2e [file] [log] [blame]
<!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>/usr/local/google/home/srhines/android_trees/jb-mr2-dev/frameworks/rs/scriptc/rs_math.rsh File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<!-- Generated by Doxygen 1.7.5.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Overview</span></a></li>
<li class="current"><a href="globals.html"><span>Globals</span></a></li>
<li><a href="annotated.html"><span>Structs</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">/usr/local/google/home/srhines/android_trees/jb-mr2-dev/frameworks/rs/scriptc/rs_math.rsh File Reference</div> </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#ad9106e5aae5b1248870f21061f36a1c9">rsRand</a> (int max_value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a01edf1cf3cdaecb1629761b69148e189">rsRand</a> (int min_value, int max_value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a03e898d810ac44158e7461b2b2b1c356">rsRand</a> (float max_value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a84b2e7468314873b3aa02969e310d9e4">rsRand</a> (float min_value, float max_value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#ac4f127e78da0849321c7f6db14f9e989">rsFrac</a> (float)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a5de277f7518a61646c3d74f3a0b9e893">rsClamp</a> (<a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> amount, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> low, <a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> high)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#ad5732b8b1f1d0d53d605a7dc6908dc85">rsClamp</a> (int amount, int low, int high)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#af5e17f571b13c3391d860eac172be1c6">rsClamp</a> (<a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> amount, <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> low, <a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> high)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a40eddbf6c2462eada177a581a49bd3c6">rsClamp</a> (short amount, short low, short high)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a2845f16757fe9eb7204bfb6f94d7fcc6">rsClamp</a> (<a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> amount, <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> low, <a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> high)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a33122202f10764687e2d3ab1a8c27062">rsClamp</a> (char amount, char low, char high)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static __inline__ void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a191f9c687c56322c18b7d71491602122">rsExtractFrustumPlanes</a> (const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *viewProj, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *left, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *right, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *top, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *bottom, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *near, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *far)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static __inline__ bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a7bbeaf44838e08e68d5cf3e3d7b0818c">rsIsSphereInFrustum</a> (<a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *sphere, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *left, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *right, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *top, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *bottom, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *near, <a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *far)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a5e20d326a6e2532d19a493b01f948c17">rsPackColorTo8888</a> (float r, float g, float b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a1f1107cf778cf1f614edfb5b8ac436a0">rsPackColorTo8888</a> (float r, float g, float b, float a)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#ac30a8c020eade2b57fd5966cb7c8665e">rsPackColorTo8888</a> (<a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a> color)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs__math_8rsh.html#a48bb0c2e7b1f2b62b2a8970c7d709eca">rsUnpackColor8888</a> (<a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> c)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>todo-jsams </p>
<p>Definition in file <a class="el" href="rs__math_8rsh_source.html">rs_math.rsh</a>.</p>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="a5de277f7518a61646c3d74f3a0b9e893"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="a5de277f7518a61646c3d74f3a0b9e893" args="(uint amount, uint low, uint high)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a> rsClamp </td>
<td>(</td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
<td class="paramname"><em>amount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
<td class="paramname"><em>low</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
<td class="paramname"><em>high</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Clamp the value amount between low and high.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">amount</td><td>The value to clamp </td></tr>
<tr><td class="paramname">low</td><td></td></tr>
<tr><td class="paramname">high</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ad5732b8b1f1d0d53d605a7dc6908dc85"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="ad5732b8b1f1d0d53d605a7dc6908dc85" args="(int amount, int low, int high)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rsClamp </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>amount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>low</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>high</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a class="anchor" id="af5e17f571b13c3391d860eac172be1c6"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="af5e17f571b13c3391d860eac172be1c6" args="(ushort amount, ushort low, ushort high)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a> rsClamp </td>
<td>(</td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td>
<td class="paramname"><em>amount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td>
<td class="paramname"><em>low</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a9e58a7bf060b7a5fbf6a401d3020adca">ushort</a>&#160;</td>
<td class="paramname"><em>high</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a class="anchor" id="a40eddbf6c2462eada177a581a49bd3c6"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="a40eddbf6c2462eada177a581a49bd3c6" args="(short amount, short low, short high)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">short rsClamp </td>
<td>(</td>
<td class="paramtype">short&#160;</td>
<td class="paramname"><em>amount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">short&#160;</td>
<td class="paramname"><em>low</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">short&#160;</td>
<td class="paramname"><em>high</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a class="anchor" id="a2845f16757fe9eb7204bfb6f94d7fcc6"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="a2845f16757fe9eb7204bfb6f94d7fcc6" args="(uchar amount, uchar low, uchar high)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a> rsClamp </td>
<td>(</td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td>
<td class="paramname"><em>amount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td>
<td class="paramname"><em>low</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a27c902d5ca78afa82d5ed75554d5cedc">uchar</a>&#160;</td>
<td class="paramname"><em>high</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a class="anchor" id="a33122202f10764687e2d3ab1a8c27062"></a><!-- doxytag: member="rs_math.rsh::rsClamp" ref="a33122202f10764687e2d3ab1a8c27062" args="(char amount, char low, char high)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char rsClamp </td>
<td>(</td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>amount</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>low</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char&#160;</td>
<td class="paramname"><em>high</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a class="anchor" id="a191f9c687c56322c18b7d71491602122"></a><!-- doxytag: member="rs_math.rsh::rsExtractFrustumPlanes" ref="a191f9c687c56322c18b7d71491602122" args="(const rs_matrix4x4 *viewProj, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static __inline__ void rsExtractFrustumPlanes </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structrs__matrix4x4.html">rs_matrix4x4</a> *&#160;</td>
<td class="paramname"><em>viewProj</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>left</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>right</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>top</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>bottom</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>near</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>far</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Computes 6 frustum planes from the view projection matrix </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">viewProj</td><td>matrix to extract planes from </td></tr>
<tr><td class="paramname">left</td><td>plane </td></tr>
<tr><td class="paramname">right</td><td>plane </td></tr>
<tr><td class="paramname">top</td><td>plane </td></tr>
<tr><td class="paramname">bottom</td><td>plane </td></tr>
<tr><td class="paramname">near</td><td>plane </td></tr>
<tr><td class="paramname">far</td><td>plane </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="rs__math_8rsh_source.html#l00102">102</a> of file <a class="el" href="rs__math_8rsh_source.html">rs_math.rsh</a>.</p>
</div>
</div>
<a class="anchor" id="ac4f127e78da0849321c7f6db14f9e989"></a><!-- doxytag: member="rs_math.rsh::rsFrac" ref="ac4f127e78da0849321c7f6db14f9e989" args="(float)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float rsFrac </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the fractional part of a float </p>
</div>
</div>
<a class="anchor" id="a7bbeaf44838e08e68d5cf3e3d7b0818c"></a><!-- doxytag: member="rs_math.rsh::rsIsSphereInFrustum" ref="a7bbeaf44838e08e68d5cf3e3d7b0818c" args="(float4 *sphere, float4 *left, float4 *right, float4 *top, float4 *bottom, float4 *near, float4 *far)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static __inline__ bool rsIsSphereInFrustum </td>
<td>(</td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>sphere</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>left</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>right</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>top</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>bottom</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>near</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> *&#160;</td>
<td class="paramname"><em>far</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Checks if a sphere is withing the 6 frustum planes </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">sphere</td><td>float4 representing the sphere </td></tr>
<tr><td class="paramname">left</td><td>plane </td></tr>
<tr><td class="paramname">right</td><td>plane </td></tr>
<tr><td class="paramname">top</td><td>plane </td></tr>
<tr><td class="paramname">bottom</td><td>plane </td></tr>
<tr><td class="paramname">near</td><td>plane </td></tr>
<tr><td class="paramname">far</td><td>plane </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="rs__math_8rsh_source.html#l00162">162</a> of file <a class="el" href="rs__math_8rsh_source.html">rs_math.rsh</a>.</p>
</div>
</div>
<a class="anchor" id="a5e20d326a6e2532d19a493b01f948c17"></a><!-- doxytag: member="rs_math.rsh::rsPackColorTo8888" ref="a5e20d326a6e2532d19a493b01f948c17" args="(float r, float g, float b)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> rsPackColorTo8888 </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>r</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>g</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>b</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">r</td><td></td></tr>
<tr><td class="paramname">g</td><td></td></tr>
<tr><td class="paramname">b</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>uchar4 </dd></dl>
</div>
</div>
<a class="anchor" id="a1f1107cf778cf1f614edfb5b8ac436a0"></a><!-- doxytag: member="rs_math.rsh::rsPackColorTo8888" ref="a1f1107cf778cf1f614edfb5b8ac436a0" args="(float r, float g, float b, float a)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> rsPackColorTo8888 </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>r</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>g</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>b</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Pack floating point (0-1) RGBA values into a uchar4.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">r</td><td></td></tr>
<tr><td class="paramname">g</td><td></td></tr>
<tr><td class="paramname">b</td><td></td></tr>
<tr><td class="paramname">a</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>uchar4 </dd></dl>
</div>
</div>
<a class="anchor" id="ac30a8c020eade2b57fd5966cb7c8665e"></a><!-- doxytag: member="rs_math.rsh::rsPackColorTo8888" ref="ac30a8c020eade2b57fd5966cb7c8665e" args="(float3 color)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a> rsPackColorTo8888 </td>
<td>(</td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#a0046fa0f208d0899adbcf1f8b5aafadd">float3</a>&#160;</td>
<td class="paramname"><em>color</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Pack floating point (0-1) RGB values into a uchar4. The alpha component is set to 255 (1.0).</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">color</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>uchar4</dd></dl>
<p>Pack floating point (0-1) RGBA values into a uchar4.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">color</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>uchar4 </dd></dl>
</div>
</div>
<a class="anchor" id="ad9106e5aae5b1248870f21061f36a1c9"></a><!-- doxytag: member="rs_math.rsh::rsRand" ref="ad9106e5aae5b1248870f21061f36a1c9" args="(int max_value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rsRand </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>max_value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return a random value between 0 (or min_value) and max_malue. </p>
</div>
</div>
<a class="anchor" id="a01edf1cf3cdaecb1629761b69148e189"></a><!-- doxytag: member="rs_math.rsh::rsRand" ref="a01edf1cf3cdaecb1629761b69148e189" args="(int min_value, int max_value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rsRand </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>min_value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>max_value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a class="anchor" id="a03e898d810ac44158e7461b2b2b1c356"></a><!-- doxytag: member="rs_math.rsh::rsRand" ref="a03e898d810ac44158e7461b2b2b1c356" args="(float max_value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float rsRand </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>max_value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a class="anchor" id="a84b2e7468314873b3aa02969e310d9e4"></a><!-- doxytag: member="rs_math.rsh::rsRand" ref="a84b2e7468314873b3aa02969e310d9e4" args="(float min_value, float max_value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float rsRand </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>min_value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>max_value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a class="anchor" id="a48bb0c2e7b1f2b62b2a8970c7d709eca"></a><!-- doxytag: member="rs_math.rsh::rsUnpackColor8888" ref="a48bb0c2e7b1f2b62b2a8970c7d709eca" args="(uchar4 c)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="rs__types_8rsh.html#adb5162dc168ddd471d948faa60b37c5e">float4</a> rsUnpackColor8888 </td>
<td>(</td>
<td class="paramtype"><a class="el" href="rs__types_8rsh.html#ae6ed52a87d4ff920c303b13b00f7396d">uchar4</a>&#160;</td>
<td class="paramname"><em>c</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Unpack a uchar4 color to float4. The resulting float range will be (0-1).</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>float4 </dd></dl>
</div>
</div>
</div>
</body>
</html>