# GaussianFunction

Artifact: [androidx.media3:media3-effect](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/effect/GaussianFunction.java+class:androidx.media3.effect.GaussianFunction)

*** ** * ** ***


```
@UnstableApi
public final class GaussianFunction implements ConvolutionFunction1D
```

<br />

*** ** * ** ***

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 |
|---|
| `https://developer.android.com/reference/androidx/media3/effect/GaussianFunction#GaussianFunction(float,float)( @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) float sigma, @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) float numStandardDeviations )` Creates an instance. |

| ### Public methods |
|---|---|
| `float` | `https://developer.android.com/reference/androidx/media3/effect/GaussianFunction#domainEnd()()` Returns the end of the domain. |
| `float` | `https://developer.android.com/reference/androidx/media3/effect/GaussianFunction#domainStart()()` Returns the start of the domain. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/effect/GaussianFunction#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html o)` |
| `int` | `https://developer.android.com/reference/androidx/media3/effect/GaussianFunction#hashCode()()` |
| `float` | `https://developer.android.com/reference/androidx/media3/effect/GaussianFunction#value(float)(float samplePosition)` Returns the value of the function at the `samplePosition`. |

| ### Inherited methods |
|---|
| From [androidx.media3.effect.ConvolutionFunction1D](https://developer.android.com/reference/androidx/media3/effect/ConvolutionFunction1D) |---|---| | `float` | `https://developer.android.com/reference/androidx/media3/effect/ConvolutionFunction1D#width()()` 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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) float sigma` | The one standard deviation, in pixels. |
| `@https://developer.android.com/reference/androidx/annotation/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`.