NoiseNode


public final class NoiseNode extends ValueNode


A ValueNode that produces a smooth random function.

Summary

Public constructors

NoiseNode(int seed, @NonNull ProgressDomain varyOver, float basePeriod)

Creates a NoiseNode that produces a random variation.

Public methods

boolean
equals(Object other)
final float

The base period of the random function.

final int

The seed for the random number generator.

final @NonNull ProgressDomain

The source of the varying over which the random function is evaluated.

int
@NonNull String

Inherited methods

From androidx.ink.brush.behavior.Node
final @NonNull List<@NonNull ValueNode>

The ordered list of inputs that this node directly depends on.

Public constructors

NoiseNode

Added in 1.1.0-alpha03
public NoiseNode(int seed, @NonNull ProgressDomain varyOver, float basePeriod)

Creates a NoiseNode that produces a random variation.

A new random value between 0 and 1 will be generated every basePeriod units along the varyOver domain, with the output of this node shifting smoothly between successive random values.

If varyOver is ProgressDomain.DISTANCE_IN_CENTIMETERS and the stroke input data does not indicate the relationship between stroke units and physical units (e.g. as may be the case for programmatically-generated inputs), then the output value will be null.

Parameters
int seed

the seed for the random number generator

@NonNull ProgressDomain varyOver

the source of the varying over which the random function is evaluated

float basePeriod

the base period of the random function

Public methods

equals

public boolean equals(Object other)

getBasePeriod

Added in 1.1.0-alpha03
public final float getBasePeriod()

The base period of the random function.

getSeed

Added in 1.1.0-alpha03
public final int getSeed()

The seed for the random number generator.

getVaryOver

Added in 1.1.0-alpha03
public final @NonNull ProgressDomain getVaryOver()

The source of the varying over which the random function is evaluated.

hashCode

public int hashCode()

toString

public @NonNull String toString()