<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>libnoise: Documentation</title> <link rel='stylesheet' type='text/css' href='doxygen.css'> <meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'> </head> <body> <table class='layout'> <tr> <td class='sidebar' rowspan='2'> <p> Navigation menu </p> <ul class='toc'> <li> <a href='http://libnoise.sourceforge.net/index.html'>Main</a> </li> <li> <a href='http://libnoise.sourceforge.net/downloads/index.html'>Downloads</a> </li> <li> <a href='http://libnoise.sourceforge.net/coherentnoise/index.html'>What is coherent noise?</a> </li> <li> <a href='http://libnoise.sourceforge.net/noisegen/index.html'>Generating coherent noise</a> </li> <li> <a href='http://libnoise.sourceforge.net/glossary/index.html'>Glossary</a> </li> <li> <a href='http://libnoise.sourceforge.net/examples/index.html'>Examples</a> <ul class='toc'> <li> <a href='http://libnoise.sourceforge.net/examples/textures/index.html'>Procedural textures</a> </li> <li> <a href='http://libnoise.sourceforge.net/examples/complexplanet/index.html'>Complex planetary surface</a> </li> <li> <a href='http://libnoise.sourceforge.net/examples/worms/index.html'>Perlin worms</a> </li> </ul> </li> <li> <strong>Docs</strong> </li> <li> <a href='tutorials/index.html'>Tutorials</a> <ul class='toc'> <li> <a href='http://libnoise.sourceforge.net/tutorials/tutorial1.html'>Tutorial 1</a> </li> <li> <a href='http://libnoise.sourceforge.net/tutorials/tutorial2.html'>Tutorial 2</a> </li> <li> <a href='http://libnoise.sourceforge.net/tutorials/tutorial3.html'>Tutorial 3</a> </li> <li> <a href='http://libnoise.sourceforge.net/tutorials/tutorial4.html'>Tutorial 4</a> </li> <li> <a href='http://libnoise.sourceforge.net/tutorials/tutorial5.html'>Tutorial 5</a> </li> <li> <a href='http://libnoise.sourceforge.net/tutorials/tutorial6.html'>Tutorial 6</a> </li> <li> <a href='http://libnoise.sourceforge.net/tutorials/tutorial7.html'>Tutorial 7</a> </li> <li> <a href='http://libnoise.sourceforge.net/tutorials/tutorial8.html'>Tutorial 8</a> </li> </ul> </li> <li> <a href='http://libnoise.sourceforge.net/cvs/index.html'>CVS</a> </li> <li> <a href='http://libnoise.sourceforge.net/links/index.html'>Links</a> </li> </ul> </td> <td class='header'> <p> <img src='libnoise.png' alt='libnoise logo'> </p> <p> A portable, open-source, coherent noise-generating library for C++ </p> <hr> </td> </tr> <tr> <td class='content'> <!-- start rich gooey content --> <!-- Generated by Doxygen 1.3.9.1 --> <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a></div> <h1>noise::module::ScaleBias Class Reference<br> <small> [<a class="el" href="group__modifiermodules.html">Modifier Modules</a>]</small> </h1><code>#include <<a class="el" href="scalebias_8h-source.html">scalebias.h</a>></code> <p> <p>Inheritance diagram for noise::module::ScaleBias: <p><center><img src="classnoise_1_1module_1_1ScaleBias.png" usemap="#noise::module::ScaleBias_map" border="0" alt=""></center> <map name="noise::module::ScaleBias_map"> <area href="classnoise_1_1module_1_1Module.html" alt="noise::module::Module" shape="rect" coords="0,0,150,24"> </map> <a href="classnoise_1_1module_1_1ScaleBias-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2> Noise module that applies a scaling factor and a bias to the output value from a source module. <p> <div align="center"> <img src="modulescalebias.png" alt="modulescalebias.png"> </div> <p> The <a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a4">GetValue()</a> method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.<p> This noise module requires one source module. <p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a0">ScaleBias</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a0"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a1">GetBias</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the bias to apply to the scaled output value from the source module. <a href="#a1"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a2">GetScale</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the scaling factor to apply to the output value from the source module. <a href="#a2"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a3">GetSourceModuleCount</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of source modules required by this noise module. <a href="#a3"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual double </td><td class="memItemRight" valign="bottom"><a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a4">GetValue</a> (double x, double y, double z) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Generates an output value given the coordinates of the specified input value. <a href="#a4"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a5">SetBias</a> (double bias)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the bias to apply to the scaled output value from the source module. <a href="#a5"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a6">SetScale</a> (double scale)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the scaling factor to apply to the output value from the source module. <a href="#a6"></a><br></td></tr> <tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="p0" doxytag="noise::module::ScaleBias::m_bias"></a> double </td><td class="memItemRight" valign="bottom"><a class="el" href="classnoise_1_1module_1_1ScaleBias.html#p0">m_bias</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Bias to apply to the scaled output value from the source module. <br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="p1" doxytag="noise::module::ScaleBias::m_scale"></a> double </td><td class="memItemRight" valign="bottom"><a class="el" href="classnoise_1_1module_1_1ScaleBias.html#p1">m_scale</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Scaling factor to apply to the output value from the source module. <br></td></tr> </table> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="a0" doxytag="noise::module::ScaleBias::ScaleBias"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">ScaleBias::ScaleBias </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td> <p> Constructor. <p> The default bias is set to <a class="el" href="group__modifiermodules.html#ga3">noise::module::DEFAULT_BIAS</a>.<p> The default scaling factor is set to <a class="el" href="group__modifiermodules.html#ga4">noise::module::DEFAULT_SCALE</a>. </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="a1" doxytag="noise::module::ScaleBias::GetBias"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">double noise::module::ScaleBias::GetBias </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td> <p> Returns the bias to apply to the scaled output value from the source module. <p> <dl compact><dt><b>Returns:</b></dt><dd>The bias to apply.</dd></dl> The <a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a4">GetValue()</a> method retrieves the output value from the source module, multiplies it with the scaling factor, adds the bias to it, then outputs the value. </td> </tr> </table> <a class="anchor" name="a2" doxytag="noise::module::ScaleBias::GetScale"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">double noise::module::ScaleBias::GetScale </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td> <p> Returns the scaling factor to apply to the output value from the source module. <p> <dl compact><dt><b>Returns:</b></dt><dd>The scaling factor to apply.</dd></dl> The <a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a4">GetValue()</a> method retrieves the output value from the source module, multiplies it with the scaling factor, adds the bias to it, then outputs the value. </td> </tr> </table> <a class="anchor" name="a3" doxytag="noise::module::ScaleBias::GetSourceModuleCount"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">virtual int noise::module::ScaleBias::GetSourceModuleCount </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline, virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td> <p> Returns the number of source modules required by this noise module. <p> <dl compact><dt><b>Returns:</b></dt><dd>The number of source modules required by this noise module. </dd></dl> <p> Implements <a class="el" href="classnoise_1_1module_1_1Module.html#a3">noise::module::Module</a>. </td> </tr> </table> <a class="anchor" name="a4" doxytag="noise::module::ScaleBias::GetValue"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">double ScaleBias::GetValue </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">double </td> <td class="mdname" nowrap> <em>x</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>double </td> <td class="mdname" nowrap> <em>y</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>double </td> <td class="mdname" nowrap> <em>z</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"> const<code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td> <p> Generates an output value given the coordinates of the specified input value. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>The <em>x</em> coordinate of the input value. </td></tr> <tr><td valign="top"></td><td valign="top"><em>y</em> </td><td>The <em>y</em> coordinate of the input value. </td></tr> <tr><td valign="top"></td><td valign="top"><em>z</em> </td><td>The <em>z</em> coordinate of the input value.</td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>The output value.</dd></dl> <dl compact><dt><b>Precondition:</b></dt><dd>All source modules required by this noise module have been passed to the <a class="el" href="classnoise_1_1module_1_1Module.html#a5">SetSourceModule()</a> method.</dd></dl> Before an application can call this method, it must first connect all required source modules via the <a class="el" href="classnoise_1_1module_1_1Module.html#a5">SetSourceModule()</a> method. If these source modules are not connected to this noise module, this method raises a debug assertion.<p> To determine the number of source modules required by this noise module, call the <a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a3">GetSourceModuleCount()</a> method. <p> Implements <a class="el" href="classnoise_1_1module_1_1Module.html#a4">noise::module::Module</a>. </td> </tr> </table> <a class="anchor" name="a5" doxytag="noise::module::ScaleBias::SetBias"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void noise::module::ScaleBias::SetBias </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">double </td> <td class="mdname1" valign="top" nowrap> <em>bias</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td> <p> Sets the bias to apply to the scaled output value from the source module. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>bias</em> </td><td>The bias to apply.</td></tr> </table> </dl> The <a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a4">GetValue()</a> method retrieves the output value from the source module, multiplies it with the scaling factor, adds the bias to it, then outputs the value. </td> </tr> </table> <a class="anchor" name="a6" doxytag="noise::module::ScaleBias::SetScale"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void noise::module::ScaleBias::SetScale </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">double </td> <td class="mdname1" valign="top" nowrap> <em>scale</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td> <p> Sets the scaling factor to apply to the output value from the source module. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>scale</em> </td><td>The scaling factor to apply.</td></tr> </table> </dl> The <a class="el" href="classnoise_1_1module_1_1ScaleBias.html#a4">GetValue()</a> method retrieves the output value from the source module, multiplies it with the scaling factor, adds the bias to it, then outputs the value. </td> </tr> </table> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="scalebias_8h-source.html">scalebias.h</a><li>scalebias.cpp</ul> <!-- end rich gooey content --> </td> </tr> <tr> <td class='footer' colspan='2'> <p> © 2003-2005 Jason Bevins </p> <p> <a href='http://www.doxygen.org/'><img src='doxygen.png' alt='Doxygen logo'></a> <br> The libnoise source documentation was generated by <a href='http://www.doxygen.org/'>doxygen</a> 1.3.9.1 </p> </td> </tr> </table> </body> </html>