Noisex.Noise (Noisex v0.1.2-rc) View Source

Provide functions to work with different types of noises.

This library provides Elixir bindings to the rust's bracket-noise library, which is a rust port of FastNoise.

Link to this section Summary

Types

A coordinate {x, y} in a cartesian plane.

A reference to the noise generator. This is needed for most of the library functions.

A noisemap object, represented by a list containing lists of floats (the noise values).

Options available when initializing the noise.

A tuple containing width and height

Functions

Returns a 2D noise map from start_point to end_point

Returns the noise value for two given floats f1 and f2.

Returns a new noise object. Use default noise options if options are not provided.

Generates a 2D noise map of size and returns it.

Link to this section Types

Specs

coord() :: {integer(), integer()}

A coordinate {x, y} in a cartesian plane.

Specs

noise_ref() :: reference()

A reference to the noise generator. This is needed for most of the library functions.

Specs

noisemap() :: [[float()]]

A noisemap object, represented by a list containing lists of floats (the noise values).

Specs

options() :: Noisex.Options.t()

Options available when initializing the noise.

Specs

size() :: {non_neg_integer(), non_neg_integer()}

A tuple containing width and height

Link to this section Functions

Link to this function

chunk(noise, start_point, end_point)

View Source

Specs

chunk(noise_ref(), coord(), coord()) :: noisemap()

Returns a 2D noise map from start_point to end_point

Link to this function

get_noise(noise, f1, f2)

View Source

Specs

get_noise(noise_ref(), float(), float()) :: float()

Returns the noise value for two given floats f1 and f2.

Returns a new noise object. Use default noise options if options are not provided.

Specs

new(options()) :: {atom(), noise_ref()}

Specs

noise_map(reference(), size()) :: noisemap()

Generates a 2D noise map of size and returns it.