Documentation
¶
Index ¶
- Constants
- Variables
- func BlendChannel(channel0, channel1 uint8, alpha float64) uint8
- func ClampValue(value, lowerBound, upperBound int) int
- func ClampValueFloat(value, lowerBound, upperBound float64) float64
- func CubicInterp(n0, n1, n2, n3, a float64) float64
- func GradientCoherentNoise3D(x, y, z float64, seed, quality int) float64
- func GradientNoise3D(fx, fy, fz, ix, iy, iz float64, seed int) float64
- func IntValueNoise3D(x, y, z, seed int) int
- func LinearInterp(n0, n1, a float64) float64
- func LinearInterpColor(color0, color1 color.RGBA, alpha float64) color.RGBA
- func MakeMap(width, height int) [][]float64
- func MapToCylinder(angle, height float64, source Module) float64
- func MapToLine(sx, sy, sz, ex, ey, ez, p float64, attenuate bool, source Module) float64
- func MapToPlane(x, y float64, source Module) float64
- func MapToSphere(lat, lon float64, source Module) float64
- func NoiseMapCylinder(lowerAngleBound, upperAngleBound, lowerHeightBound, upperHeightBound float64, ...) [][]float64
- func NoiseMapPlane(lowerXBound, upperXBound, lowerZBound, upperZBound float64, width, height int, ...) [][]float64
- func NoiseMapSphere(eastBound, westBound, northBound, southBound float64, width, height int, ...) [][]float64
- func SCurve3(a float64) float64
- func SCurve5(a float64) float64
- func ValueCoherentNoise3D(x, y, z float64, seed, quality int) float64
- func ValueNoise3D(x, y, z, seed int) float64
- type Abs
- type Add
- type Billow
- type Blend
- type Checkerboard
- type Clamp
- type Constant
- type Curve
- type Cylinders
- type Displace
- func (d Displace) GetSourceModule(index int) Module
- func (d Displace) GetValue(x, y, z float64) float64
- func (d Displace) SetSourceModule(index int, sourceModule Module)
- func (d Displace) SetXDisplaceModule(source Module)
- func (d Displace) SetXYZDisplaceModule(sourceX, sourceY, sourceZ Module)
- func (d Displace) SetYDisplaceModule(source Module)
- func (d Displace) SetZDisplaceModule(source Module)
- type Exponent
- type GradientColor
- type Invert
- type Max
- type Min
- type Module
- type Multiply
- type Perlin
- type Power
- type RenderImage
- func (r *RenderImage) BuildGrayscaleGradient()
- func (r *RenderImage) BuildTerrainGradient()
- func (r *RenderImage) Render()
- func (r *RenderImage) RenderFile(filename string)
- func (r *RenderImage) SetLightAzimuth(azimuth float64)
- func (r *RenderImage) SetLightBrightness(brightness float64)
- func (r *RenderImage) SetLightContrast(contrast float64)
- func (r *RenderImage) SetLightElev(elev float64)
- func (r *RenderImage) SetLightIntensity(intensity float64)
- type Ridgedmulti
- type Rotatepoint
- func (r Rotatepoint) GetSourceModule(index int) Module
- func (r Rotatepoint) GetValue(x, y, z float64) float64
- func (r *Rotatepoint) SetAngles(xAngle, yAngle, zAngle float64)
- func (r Rotatepoint) SetSourceModule(index int, source Module)
- func (r *Rotatepoint) SetXAngle(xAngle float64)
- func (r *Rotatepoint) SetYAngle(yAngle float64)
- func (r *Rotatepoint) SetZAngle(zAngle float64)
- type ScaleBias
- type ScalePoint
- type Select
- type Spheres
- type Terrace
- type TranslatePoint
- type Turbulence
- func (t Turbulence) GetSourceModule(index int) Module
- func (t Turbulence) GetValue(x, y, z float64) float64
- func (t *Turbulence) SetFrequency(frequency float64)
- func (t *Turbulence) SetRoughness(roughness int)
- func (t *Turbulence) SetSeed(seed int)
- func (t Turbulence) SetSourceModule(index int, source Module)
- type Voronoi
Constants ¶
View Source
const ( QualitySTD = 0 QualityFAST = 1 QualityBEST = 2 )
View Source
const ( AbsModuleCount = 1 AddModuleCount = 2 BillowModuleCount = 0 BlendModuleCount = 3 ClampModuleCount = 1 DisplaceModuleCount = 4 ExponentModuleCount = 1 InvertModuleCount = 1 PowerModuleCount = 2 RotateModuleCount = 1 ScaleBiasModuleCount = 1 ScalePointModuleCount = 1 SelectModuleCount = 3 TerraceModuleCount = 1 TurbulenceModuleCount = 1 )
View Source
const ( XNoiseGen = 1619 YNoiseGen = 31337 ZNoiseGen = 6971 SeedNoiseGen = 1013 ShiftNoiseGen = 8 )
View Source
const ( DefaultPerlinFrequency = 1.0 DefaultPerlinLacunarity = 2.0 DefaultPerlinOctaveCount = 6 DefaultPerlinPersistence = 0.5 DefaultPerlinQuality = QualitySTD DefaultPerlinSeed = 0 PerlinMaxOctave = 30 )
View Source
const ( DefaultRidgedFrequency = 1.0 DefaultRidgedLacunarity = 2.0 DefaultRidgedOctaveCount = 6 DefaultRidgedQuality = QualitySTD DefaultRidgedSeed = 0 RidgedMaxOctave = 30 DefaultRidgedSpectralWeight = 1.0 DefaultRidgedOffset = 1.0 DefaultRidgedGain = 2.0 )
View Source
const ( DefaultRotateX = 0.0 DefaultRotateY = 0.0 DefaultRotateZ = 0.0 DegToRad = math.Pi / 180 )
View Source
const ( DefaultBias = 0.0 DefaultScale = 1.0 )
View Source
const ( DefaultScalePointX = 1.0 DefaultScalePointY = 1.0 DefaultScalePointZ = 1.0 )
View Source
const ( DefaultTurbulenceFrequency = DefaultPerlinFrequency DefaultTurbulencePower = 1.0 DefaultTurbulenceRoughness = 3 DefaultTurbulenceSeed = DefaultPerlinSeed )
View Source
const ( DefaultVoronoiDisplacement = 1.0 DefaultVoronoiFrequency = 1.0 DefaultVoronoiSeed = 0 )
View Source
const DefaultBillowFrequency = float64(1)
View Source
const DefaultBillowLacunarity = float64(2)
View Source
const DefaultBillowMaxOctave = 30
View Source
const DefaultBillowOctaveCount = 6
View Source
const DefaultBillowPersistence = float64(0.5)
View Source
const DefaultBillowQuality = QualitySTD
View Source
const DefaultBillowSeed = 0
View Source
const DefaultClampLowerBound = -1.0
View Source
const DefaultClampUpperBound = 1.0
View Source
const DefaultCylinderFrequency = 1.0
View Source
const DefaultExp = 1.0
View Source
const DefaultSelectEdgeFalloff = 0.0
View Source
const DefaultSelectLowerBound = -1.0
View Source
const DefaultSelectUpperBound = 1.0
View Source
const DefaultSphereFrequency = 1.0
View Source
const SQRT_2 = 1.4142135623730951
View Source
const SQRT_3 = 1.7320508075688772
Variables ¶
View Source
var RandomVectors = []float64{}/* 1024 elements not displayed */
Really should be a constant, but no constant arrays in Go
Functions ¶
func BlendChannel ¶
func ClampValue ¶
func ClampValueFloat ¶
func CubicInterp ¶
Performs a cubic interpolation between two values bound between two other values.
func GradientCoherentNoise3D ¶
func GradientNoise3D ¶
func IntValueNoise3D ¶
func LinearInterp ¶
Performs a linear interpolation between two values
func LinearInterpColor ¶
func MapToCylinder ¶
func MapToPlane ¶
func MapToSphere ¶
func NoiseMapCylinder ¶
func NoiseMapPlane ¶
func NoiseMapSphere ¶
func ValueCoherentNoise3D ¶
func ValueNoise3D ¶
Types ¶
type Abs ¶
type Abs struct {
SourceModule []Module
}
func (Abs) GetSourceModule ¶
func (Abs) SetSourceModule ¶
type Add ¶
type Add struct {
SourceModule []Module
}
func (Add) GetSourceModule ¶
func (Add) SetSourceModule ¶
type Billow ¶
type Billow struct { SourceModule []Module Frequency, Lacunarity, Persistence float64 Seed, Quality, OctaveCount int }
func DefaultBillow ¶
func DefaultBillow() Billow
func (Billow) GetSourceModule ¶
func (Billow) SetSourceModule ¶
type Blend ¶
type Blend struct {
SourceModule []Module
}
func (Blend) GetSourceModule ¶
func (Blend) SetSourceModule ¶
type Checkerboard ¶
type Checkerboard struct{}
func (Checkerboard) GetSourceModule ¶
func (c Checkerboard) GetSourceModule(index int) Module
func (Checkerboard) GetValue ¶
func (c Checkerboard) GetValue(x, y, z float64) float64
func (Checkerboard) SetSourceModule ¶
func (c Checkerboard) SetSourceModule(index int, sourceModule Module)
type Constant ¶
type Constant struct {
Value float64
}
func (Constant) GetSourceModule ¶
func (Constant) GetSourceModuleCount ¶
func (Constant) SetSourceModule ¶
type Curve ¶
func (*Curve) AddControlPoint ¶
func (*Curve) ClearAllControlPoints ¶
func (c *Curve) ClearAllControlPoints()
func (Curve) GetSourceModule ¶
func (Curve) SetSourceModule ¶
type Cylinders ¶
type Cylinders struct {
Frequency float64
}
func DefaultCylinders ¶
func DefaultCylinders() Cylinders
func (Cylinders) GetSourceModule ¶
func (Cylinders) SetSourceModule ¶
type Displace ¶
type Displace struct {
SourceModule []Module
}
func (Displace) GetSourceModule ¶
func (Displace) SetSourceModule ¶
func (Displace) SetXDisplaceModule ¶
func (Displace) SetXYZDisplaceModule ¶
func (Displace) SetYDisplaceModule ¶
func (Displace) SetZDisplaceModule ¶
type Exponent ¶
func DefaultExponent ¶
func DefaultExponent() Exponent
func (Exponent) GetSourceModule ¶
func (Exponent) SetSourceModule ¶
type GradientColor ¶
func (*GradientColor) AddGradientPoint ¶
func (g *GradientColor) AddGradientPoint(position float64, color color.RGBA)
func (*GradientColor) ClearGradient ¶
func (g *GradientColor) ClearGradient()
type Invert ¶
type Invert struct {
SourceModule []Module
}
func (Invert) GetSourceModule ¶
func (Invert) SetSourceModule ¶
type Max ¶
type Max struct {
SourceModule []Module
}
func (Max) GetSourceModule ¶
func (Max) SetSourceModule ¶
type Min ¶
type Min struct {
SourceModule []Module
}
func (Min) GetSourceModule ¶
func (Min) SetSourceModule ¶
type Module ¶
type Module interface { //Returns a source module connected to thise noise module. GetSourceModule(index int) Module //Generates an output value given the coordinates of the specified input // value. Before an applicaion can call this method, it must first connect // all required source modules via SetSourceModule(). If these source modules // are not connected to this module, this method raises an error. GetValue(x, y, z float64) float64 //Sets a source module in the given index. SetSourceModule(index int, sourceModule Module) }
type Multiply ¶
type Multiply struct {
SourceModule []Module
}
func (Multiply) GetSourceModule ¶
func (Multiply) SetSourceModule ¶
type Perlin ¶
func DefaultPerlin ¶
func DefaultPerlin() Perlin
func (Perlin) GetSourceModule ¶
func (*Perlin) SetOctaveCount ¶
SetOctaveCount sets the number of octaves performed in the noise calculation. Automatically clamps the given value to [1, PerlinMaxOctave].
func (Perlin) SetSourceModule ¶
type Power ¶
type Power struct {
SourceModule []Module
}
func (Power) GetSourceModule ¶
func (Power) SetSourceModule ¶
type RenderImage ¶
type RenderImage struct {
CosAzimuth, CosElev, SinAzimuth, SinElev float64
LightAzimuth, LightBrightness, LightContrast float64
LightElev, LightIntensity float64
Gradient GradientColor
LightEnabled, WrapEnabled, RecalculateLight bool
LightColor color.RGBA
BackgroundImage image.RGBA
DestinationImage image.RGBA
NoiseMap [][]float64
}
func (*RenderImage) BuildGrayscaleGradient ¶
func (r *RenderImage) BuildGrayscaleGradient()
func (*RenderImage) BuildTerrainGradient ¶
func (r *RenderImage) BuildTerrainGradient()
func (*RenderImage) Render ¶
func (r *RenderImage) Render()
func (*RenderImage) RenderFile ¶
func (r *RenderImage) RenderFile(filename string)
func (*RenderImage) SetLightAzimuth ¶
func (r *RenderImage) SetLightAzimuth(azimuth float64)
func (*RenderImage) SetLightBrightness ¶
func (r *RenderImage) SetLightBrightness(brightness float64)
func (*RenderImage) SetLightContrast ¶
func (r *RenderImage) SetLightContrast(contrast float64)
func (*RenderImage) SetLightElev ¶
func (r *RenderImage) SetLightElev(elev float64)
func (*RenderImage) SetLightIntensity ¶
func (r *RenderImage) SetLightIntensity(intensity float64)
type Ridgedmulti ¶
type Ridgedmulti struct {
Frequency, Lacunarity, SpectralWeight, Offset, Gain float64
OctaveCount, Quality, Seed int
SpectralWeights []float64
}
func DefaultRidgedmulti ¶
func DefaultRidgedmulti() Ridgedmulti
func (Ridgedmulti) CalcSpectralWeights ¶
func (r Ridgedmulti) CalcSpectralWeights()
func (Ridgedmulti) GetSourceModule ¶
func (r Ridgedmulti) GetSourceModule(index int) Module
func (Ridgedmulti) GetValue ¶
func (r Ridgedmulti) GetValue(x, y, z float64) float64
func (*Ridgedmulti) SetOctaveCount ¶
func (r *Ridgedmulti) SetOctaveCount(octave int)
SetOctaveCount sets the number of octaves performed in the noise calculation. Automatically clamps the given value to [1, PerlinMaxOctave].
func (Ridgedmulti) SetSourceModule ¶
func (r Ridgedmulti) SetSourceModule(index int, source Module)
type Rotatepoint ¶
type Rotatepoint struct {
X1Matrix, X2Matrix, X3Matrix float64
Y1Matrix, Y2Matrix, Y3Matrix float64
Z1Matrix, Z2Matrix, Z3Matrix float64
XAngle, YAngle, ZAngle float64
SourceModule []Module
}
func DefaultRotatepoint ¶
func DefaultRotatepoint() Rotatepoint
func (Rotatepoint) GetSourceModule ¶
func (r Rotatepoint) GetSourceModule(index int) Module
func (Rotatepoint) GetValue ¶
func (r Rotatepoint) GetValue(x, y, z float64) float64
func (*Rotatepoint) SetAngles ¶
func (r *Rotatepoint) SetAngles(xAngle, yAngle, zAngle float64)
func (Rotatepoint) SetSourceModule ¶
func (r Rotatepoint) SetSourceModule(index int, source Module)
func (*Rotatepoint) SetXAngle ¶
func (r *Rotatepoint) SetXAngle(xAngle float64)
func (*Rotatepoint) SetYAngle ¶
func (r *Rotatepoint) SetYAngle(yAngle float64)
func (*Rotatepoint) SetZAngle ¶
func (r *Rotatepoint) SetZAngle(zAngle float64)
type ScaleBias ¶
func DefaultScaleBias ¶
func DefaultScaleBias() ScaleBias
func (ScaleBias) GetSourceModule ¶
func (ScaleBias) SetSourceModule ¶
type ScalePoint ¶
func DefaultScalePoint ¶
func DefaultScalePoint() ScalePoint
func (ScalePoint) GetSourceModule ¶
func (a ScalePoint) GetSourceModule(index int) Module
func (ScalePoint) GetValue ¶
func (a ScalePoint) GetValue(x, y, z float64) float64
func (ScalePoint) SetSourceModule ¶
func (a ScalePoint) SetSourceModule(index int, source Module)
type Select ¶
func DefaultSelect ¶
func DefaultSelect() Select
func (Select) GetSourceModule ¶
func (*Select) SetEdgeFalloff ¶
func (Select) SetSourceModule ¶
type Spheres ¶
type Spheres struct {
Frequency float64
}
func DefaultSpheres ¶
func DefaultSpheres() Spheres
func (Spheres) GetSourceModule ¶
func (Spheres) SetSourceModule ¶
type Terrace ¶
func DefaultTerrace ¶
func DefaultTerrace() Terrace
func (Terrace) AddControlPoint ¶
func (Terrace) ClearAllControlPoints ¶
func (t Terrace) ClearAllControlPoints()
func (Terrace) GetSourceModule ¶
func (Terrace) MakeControlPoints ¶
func (Terrace) SetSourceModule ¶
type TranslatePoint ¶
func (TranslatePoint) GetSourceModule ¶
func (t TranslatePoint) GetSourceModule(index int) Module
func (TranslatePoint) GetValue ¶
func (t TranslatePoint) GetValue(x, y, z float64) float64
func (TranslatePoint) SetSourceModule ¶
func (t TranslatePoint) SetSourceModule(index int, source Module)
func (*TranslatePoint) SetTranslatePoints ¶
func (t *TranslatePoint) SetTranslatePoints(x, y, z float64)
type Turbulence ¶
type Turbulence struct { Power float64 XDistortModule, YDistortModule, ZDistortModule Perlin SourceModules []Module }
func DefaultTurbulence ¶
func DefaultTurbulence() Turbulence
func (Turbulence) GetSourceModule ¶
func (t Turbulence) GetSourceModule(index int) Module
func (Turbulence) GetValue ¶
func (t Turbulence) GetValue(x, y, z float64) float64
func (*Turbulence) SetFrequency ¶
func (t *Turbulence) SetFrequency(frequency float64)
func (*Turbulence) SetRoughness ¶
func (t *Turbulence) SetRoughness(roughness int)
func (*Turbulence) SetSeed ¶
func (t *Turbulence) SetSeed(seed int)
func (Turbulence) SetSourceModule ¶
func (t Turbulence) SetSourceModule(index int, source Module)
type Voronoi ¶
func DefaultVoronoi ¶
func DefaultVoronoi() Voronoi
func (Voronoi) GetSourceModule ¶
func (Voronoi) SetSourceModule ¶
Source Files
¶
- abs.go
- add.go
- billow.go
- blend.go
- checkerboard.go
- clamp.go
- colorutil.go
- const.go
- constant.go
- curve.go
- cylinders.go
- displace.go
- exponent.go
- gradientcolor.go
- interp.go
- invert.go
- max.go
- min.go
- module.go
- multiply.go
- noisegen.go
- noisemap.go
- perlin.go
- power.go
- renderimage.go
- ridgedmulti.go
- rotatepoint.go
- scalebias.go
- scalepoint.go
- select.go
- spheres.go
- terrace.go
- translatepoint.go
- turbulence.go
- voronoi.go
Click to show internal directories.
Click to hide internal directories.