Package swingtree
Enum Class UI.NoiseType
- All Implemented Interfaces:
Serializable
,Comparable<UI.NoiseType>
,Constable
,NoiseFunction
,UIEnum<UI.NoiseType>
- Enclosing class:
- UI
@Immutable
public static enum UI.NoiseType
extends Enum<UI.NoiseType>
implements UIEnum<UI.NoiseType>, NoiseFunction
Defines the different types of noise functions that can be used to render
a
Pass instances of this to
NoiseConf
style. Pass instances of this to
NoiseConf.function(NoiseFunction)
to configure the noise behaviour
as part of the style API (see UIForAnySwing.withStyle(Styler)
).-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionfloat
getFractionAt
(float x, float y) Get the noise value at the given coordinate.static UI.NoiseType
Returns the enum constant of this class with the specified name.static UI.NoiseType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface swingtree.api.NoiseFunction
andThen, compose
-
Enum Constant Details
-
CELLS
-
FIBERS
-
GRAINY
-
HARD_SPOTS
-
HARD_TOPOLOGY
-
HAZE
-
MANDELBROT
-
RETRO
-
STOCHASTIC
-
SMOOTH_TOPOLOGY
-
SMOOTH_SPOTS
-
SPIRALS
-
TILES
-
TISSUE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getFractionAt
public float getFractionAt(float x, float y) Description copied from interface:NoiseFunction
Get the noise value at the given coordinate.- Specified by:
getFractionAt
in interfaceNoiseFunction
- Parameters:
x
- The x coordinate in translated, scaled and rotated virtual space.y
- The y coordinate in translated, scaled and rotated virtual space.- Returns:
- The gradient value between 0 and 1 used to determine the color of a pixel in the color space / view space of the screen.
-