Tiled 2D Amortized Noise
A Program to Generate Infinite Grayscale Noise Textures with Amortized Noise
 All Classes Files Functions Variables Macros Pages
Functions | Variables
main.cpp File Reference

Main. More...

#include "defines.h"
#include "SaveImage.h"
#include <stdlib.h>
#include <stdio.h>
#include "InfiniteAmortizedNoise2D.h"
#include "FiniteAmortizedNoise2D.h"
#include "CPUtime.h"

Functions

float Generate2DNoise (float **cell, const int x, const int y, const int m0, const int m1, const int n)
 
void GenerateAndSave2DNoise (int nRow, int nCol, const int m0, const int m1, const int n, const int seed)
 
int main (int argc, char *argv[])
 

Variables

CFiniteAmortizedNoise2Dg_pFiniteAmortizedNoise = NULL
 Pointer to the finite amortized 2D noise generator.
 
CInfiniteAmortizedNoise2Dg_pInfiniteAmortizedNoise = NULL
 Pointer to the infinite amortized 2D noise generator.
 
bool g_bInfinite = true
 Whether to use infinite noise: true for infinite noise, false for finite noise.
 

Function Documentation

float Generate2DNoise ( float **  cell,
const int  x,
const int  y,
const int  m0,
const int  m1,
const int  n 
)

Generate a random cell of 2D noise.

Parameters
cellPointer to array in which to store the noise.
xTile column index.
yTile row index.
m0Largest octave.
m1Smallest octave.
nCell size.
void GenerateAndSave2DNoise ( int  nRow,
int  nCol,
const int  m0,
const int  m1,
const int  n,
const int  seed 
)

Generate a cell of 2D noise and save it as an image file.

Parameters
nRowTile row index.
nColTile column index.
m0Largest octave.
m1Smallest octave.
nCell size.
seedHash function seed.
int main ( int  argc,
char *  argv[] 
)

Main.

Parameters
argcArgument count
argvArguments.
Returns
0 for success, 1 for failure.