@UnstableApi
class GaussianBlur : 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

Creates an instance with numStandardDeviations set to 2.0f.

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

Creates an instance.

Public functions

ConvolutionFunction1D!
getConvolution(presentationTimeUs: Long)

Returns a 1D convolution function.

Inherited functions

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(inputWidth: Int, inputHeight: Int)

Returns whether a GlEffect applies no change at every timestamp.

From androidx.media3.effect.SeparableConvolution
GlShaderProgram!
toGlShaderProgram(context: Context!, useHdr: Boolean)

Returns a GlShaderProgram that applies the effect.

Public constructors

GaussianBlur

GaussianBlur(sigma: Float)

Creates an instance with numStandardDeviations set to 2.0f.

Parameters
sigma: Float

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

GaussianBlur

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

Creates an instance.

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

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

numStandardDeviations: @FloatRange(from = 0.0, fromInclusive = false) Float

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

Public functions

getConvolution

fun getConvolution(presentationTimeUs: Long): ConvolutionFunction1D!

Returns a 1D convolution function.

Parameters
presentationTimeUs: Long

The presentation timestamp of the input frame, in microseconds.