GaussianFunction


@UnstableApi
public final class GaussianFunction implements ConvolutionFunction1D


Implementation of a symmetric Gaussian function with a limited domain.

The half-width of the domain is sigma times numStdDev. Values strictly outside of that range are zero.

Summary

Public constructors

GaussianFunction(
    @FloatRange(from = 0.0, fromInclusive = false) float sigma,
    @FloatRange(from = 0.0, fromInclusive = false) float numStandardDeviations
)

Creates an instance.

Public methods

float

Returns the end of the domain.

float

Returns the start of the domain.

boolean
int
float
value(float samplePosition)

Returns the value of the function at the samplePosition.

Inherited methods

From androidx.media3.effect.ConvolutionFunction1D
float

Returns the width of the domain.

Public constructors

GaussianFunction

public GaussianFunction(
    @FloatRange(from = 0.0, fromInclusive = false) float sigma,
    @FloatRange(from = 0.0, fromInclusive = false) float numStandardDeviations
)

Creates an instance.

Parameters
@FloatRange(from = 0.0, fromInclusive = false) float sigma

The one standard deviation, in pixels.

@FloatRange(from = 0.0, fromInclusive = false) float numStandardDeviations

The half-width of function domain, measured in the number of standard deviations.

Public methods

domainEnd

public float domainEnd()

Returns the end of the domain.

domainStart

public float domainStart()

Returns the start of the domain.

equals

public boolean equals(@Nullable Object o)

hashCode

public int hashCode()

value

public float value(float samplePosition)

Returns the value of the function at the samplePosition.