@UnstableApi
public final class GaussianBlur extends SeparableConvolution


A SeparableConvolution to apply a Gaussian blur on image data.

The width of the blur is specified in pixels and applied symmetrically.

Summary

Public constructors

GaussianBlur(float sigma)

Creates an instance with numStandardDeviations set to 2.0f.

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

Creates an instance.

Public methods

ConvolutionFunction1D
getConvolution(long presentationTimeUs)

Returns a 1D convolution function.

Inherited methods

From androidx.media3.common.Effect
long

Returns the expected duration of the output stream when the effect is applied given a input durationUs.

From androidx.media3.effect.GlEffect
boolean
isNoOp(int inputWidth, int inputHeight)

Returns whether a GlEffect applies no change at every timestamp.

From androidx.media3.effect.SeparableConvolution
GlShaderProgram
toGlShaderProgram(Context context, boolean useHdr)

Returns a GlShaderProgram that applies the effect.

Public constructors

GaussianBlur

public GaussianBlur(float sigma)

Creates an instance with numStandardDeviations set to 2.0f.

Parameters
float sigma

The half-width of 1 standard deviation, in pixels.

GaussianBlur

public GaussianBlur(
    @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 half-width of 1 standard deviation, in pixels.

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

The size of function domain, measured in the number of standard deviations.

Public methods

getConvolution

public ConvolutionFunction1D getConvolution(long presentationTimeUs)

Returns a 1D convolution function.

Parameters
long presentationTimeUs

The presentation timestamp of the input frame, in microseconds.