GaussianBlurWithFrameOverlaid


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

GaussianBlurWithFrameOverlaid(
    sigma: Float,
    scaleSharpX: Float,
    scaleSharpY: Float
)

Creates an instance with numStandardDeviations set to 2.0f.

GaussianBlurWithFrameOverlaid(
    sigma: @FloatRange(from = 0.0, fromInclusive = false) Float,
    numStandardDeviations: @FloatRange(from = 0.0, fromInclusive = false) Float,
    scaleSharpX: Float,
    scaleSharpY: Float
)

Creates an instance.

Public functions

ConvolutionFunction1D!
getConvolution(presentationTimeUs: Long)

Returns a 1D convolution function.

GlShaderProgram!
toGlShaderProgram(context: Context!, useHdr: Boolean)

Returns a GlShaderProgram that applies the effect.

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.

Public constructors

GaussianBlurWithFrameOverlaid

GaussianBlurWithFrameOverlaid(
    sigma: Float,
    scaleSharpX: Float,
    scaleSharpY: Float
)

Creates an instance with numStandardDeviations set to 2.0f.

Parameters
sigma: Float

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

scaleSharpX: Float

The scaling factor used to determine the size of the sharp image in the output frame relative to the whole output frame in the horizontal direction.

scaleSharpY: Float

The scaling factor used to determine the size of the sharp image in the output frame relative to the whole output frame in the vertical direction.

GaussianBlurWithFrameOverlaid

GaussianBlurWithFrameOverlaid(
    sigma: @FloatRange(from = 0.0, fromInclusive = false) Float,
    numStandardDeviations: @FloatRange(from = 0.0, fromInclusive = false) Float,
    scaleSharpX: Float,
    scaleSharpY: 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.

scaleSharpX: Float

The scaling factor used to determine the size of the sharp image in the output frame relative to the whole output frame in the horizontal direction.

scaleSharpY: Float

The scaling factor used to determine the size of the sharp image in the output frame relative to the whole output frame in the vertical direction.

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.

toGlShaderProgram

fun toGlShaderProgram(context: Context!, useHdr: Boolean): GlShaderProgram!

Returns a GlShaderProgram that applies the effect.

Parameters
context: Context!

A Context.

useHdr: Boolean

Whether input textures come from an HDR source. If true, colors will be in linear RGB BT.2020. If false, colors will be in linear RGB BT.709.

Throws
androidx.media3.common.VideoFrameProcessingException

If an error occurs while creating the .