File: noisegen_8h-source.html

package info (click to toggle)
libnoise 1.0.0%2Brepack-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 6,552 kB
  • ctags: 1,688
  • sloc: cpp: 6,111; makefile: 113
file content (193 lines) | stat: -rw-r--r-- 9,073 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!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&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">src</a></div>
<h1>noisegen.h</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">// noisegen.h</span>
00002 <span class="comment">//</span>
00003 <span class="comment">// Copyright (C) 2003, 2004 Jason Bevins</span>
00004 <span class="comment">//</span>
00005 <span class="comment">// This library is free software; you can redistribute it and/or modify it</span>
00006 <span class="comment">// under the terms of the GNU Lesser General Public License as published by</span>
00007 <span class="comment">// the Free Software Foundation; either version 2.1 of the License, or (at</span>
00008 <span class="comment">// your option) any later version.</span>
00009 <span class="comment">//</span>
00010 <span class="comment">// This library is distributed in the hope that it will be useful, but WITHOUT</span>
00011 <span class="comment">// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</span>
00012 <span class="comment">// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public</span>
00013 <span class="comment">// License (COPYING.txt) for more details.</span>
00014 <span class="comment">//</span>
00015 <span class="comment">// You should have received a copy of the GNU Lesser General Public License</span>
00016 <span class="comment">// along with this library; if not, write to the Free Software Foundation,</span>
00017 <span class="comment">// Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span>
00018 <span class="comment">//</span>
00019 <span class="comment">// The developer's email is jlbezigvins@gmzigail.com (for great email, take</span>
00020 <span class="comment">// off every 'zig'.)</span>
00021 <span class="comment">//</span>
00022 
00023 <span class="preprocessor">#ifndef NOISE_NOISEGEN_H</span>
00024 <span class="preprocessor"></span><span class="preprocessor">#define NOISE_NOISEGEN_H</span>
00025 <span class="preprocessor"></span>
00026 <span class="preprocessor">#include &lt;math.h&gt;</span>
00027 <span class="preprocessor">#include "basictypes.h"</span>
00028 
00029 <span class="keyword">namespace </span>noise
00030 {
00031 
00034 
<a name="l00036"></a><a class="code" href="group__libnoise.html#ga26">00036</a>   <span class="keyword">enum</span> NoiseQuality
00037   {
00038 
00044     QUALITY_FAST = 0,
00045 
00051     QUALITY_STD = 1,
00052 
00058     QUALITY_BEST = 2
00059 
00060   };
00061 
00077   <span class="keywordtype">double</span> <a class="code" href="group__libnoise.html#ga20">GradientCoherentNoise3D</a> (<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> z, <span class="keywordtype">int</span> seed = 0,
00078     NoiseQuality noiseQuality = QUALITY_STD);
00079 
00121   <span class="keywordtype">double</span> <a class="code" href="group__libnoise.html#ga21">GradientNoise3D</a> (<span class="keywordtype">double</span> fx, <span class="keywordtype">double</span> fy, <span class="keywordtype">double</span> fz, <span class="keywordtype">int</span> ix, <span class="keywordtype">int</span> iy,
00122     <span class="keywordtype">int</span> iz, <span class="keywordtype">int</span> seed = 0);
00123 
00139   <span class="keywordtype">int</span> <a class="code" href="group__libnoise.html#ga22">IntValueNoise3D</a> (<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> z, <span class="keywordtype">int</span> seed = 0);
00140 
<a name="l00158"></a><a class="code" href="group__libnoise.html#ga23">00158</a>   <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="group__libnoise.html#ga23">MakeInt32Range</a> (<span class="keywordtype">double</span> n)
00159   {
00160     <span class="keywordflow">if</span> (n &gt;= 1073741824.0) {
00161       <span class="keywordflow">return</span> (2.0 * fmod (n, 1073741824.0)) - 1073741824.0;
00162     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (n &lt;= -1073741824.0) {
00163       <span class="keywordflow">return</span> (2.0 * fmod (n, 1073741824.0)) + 1073741824.0;
00164     } <span class="keywordflow">else</span> {
00165       <span class="keywordflow">return</span> n;
00166     }
00167   }
00168 
00184   <span class="keywordtype">double</span> <a class="code" href="group__libnoise.html#ga24">ValueCoherentNoise3D</a> (<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> z, <span class="keywordtype">int</span> seed = 0,
00185     NoiseQuality noiseQuality = QUALITY_STD);
00186 
00202   <span class="keywordtype">double</span> <a class="code" href="group__libnoise.html#ga25">ValueNoise3D</a> (<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> z, <span class="keywordtype">int</span> seed = 0);
00203 
00205 
00206 }
00207 
00208 <span class="preprocessor">#endif</span>
</pre></div><!-- end rich gooey content -->

    </td>
   </tr>
   <tr>
    <td class='footer' colspan='2'>
     <p>
      &copy; 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>