Tiled 2D Amortized Noise
A Program to Generate Infinite Grayscale Noise Textures with Amortized Noise
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Macros
Pages
InfiniteAmortizedNoise2D.h
Go to the documentation of this file.
1
2
3
4
// Copyright Ian Parberry, September 2013.
5
//
6
// This file is made available under the GNU All-Permissive License.
7
//
8
// Copying and distribution of this file, with or without modification,
9
// are permitted in any medium without royalty provided the copyright
10
// notice and this notice are preserved. This file is offered as-is,
11
// without any warranty.
12
//
13
// Created by Ian Parberry, September 2013.
14
// Last updated April 10, 2014.
15
16
#pragma once
17
21
22
class
CInfiniteAmortizedNoise2D
{
23
private
:
//Amortized noise stuff
24
float
*
uax
;
25
float
*
vax
;
26
float
*
ubx
;
27
float
*
vbx
;
28
float
*
uay
;
29
float
*
vay
;
30
float
*
uby
;
31
float
*
vby
;
32
float
*
spline
;
33
unsigned
int
seed
;
34
35
unsigned
int
h
(
const
unsigned
int
x,
const
unsigned
int
y);
36
37
void
FillUp
(
float
* t,
const
float
s,
const
int
n);
38
void
FillDn
(
float
* t,
const
float
s,
const
int
n);
39
40
void
initEdgeTables
(
const
int
x,
const
int
y,
const
int
n);
41
void
initSplineTable
(
const
int
n);
42
43
float
getNoise
(
const
int
i,
const
int
j);
44
void
getNoise
(
const
int
n,
const
int
i0,
const
int
j0,
float
** cell);
45
void
addNoise
(
const
int
n,
const
int
i0,
const
int
j0,
const
float
scale,
float
** cell);
46
47
public
:
48
CInfiniteAmortizedNoise2D
(
const
unsigned
n,
const
unsigned
int
s);
49
~CInfiniteAmortizedNoise2D
();
50
float
generate
(
int
x,
int
y,
const
int
m0,
const
int
m1,
const
int
n,
float
** cell);
51
};
//CInfiniteAmortizedNoise2D
Generated on Wed May 7 2014 19:39:42 for Tiled 2D Amortized Noise by
1.8.2