# GaussianBlurWithFrameOverlaid

# GaussianBlurWithFrameOverlaid

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/GaussianBlurWithFrameOverlaid.java+class:androidx.media3.effect.GaussianBlurWithFrameOverlaid)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/effect/GaussianBlurWithFrameOverlaid "View this page in Java")

<br />

```
@UnstableApi
class GaussianBlurWithFrameOverlaid : SeparableConvolution
```

<br />

|---|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                                |||
| ↳ | [androidx.media3.effect.SeparableConvolution](https://developer.android.com/reference/kotlin/androidx/media3/effect/SeparableConvolution)                      ||
|   | ↳ | [androidx.media3.effect.GaussianBlurWithFrameOverlaid](https://developer.android.com/reference/kotlin/androidx/media3/effect/GaussianBlurWithFrameOverlaid) |

*** ** * ** ***

A[SeparableConvolution](https://developer.android.com/reference/kotlin/androidx/media3/effect/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](https://developer.android.com/reference/kotlin/androidx/media3/effect/GaussianBlurWithFrameOverlaid#GaussianBlurWithFrameOverlaid(float,float,float))`(` ` sigma: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` scaleSharpX: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` scaleSharpY: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) `)` Creates an instance with`numStandardDeviations`set to`2.0f`.                                                                                                                                                                                                                                                                                                                                                |
| [GaussianBlurWithFrameOverlaid](https://developer.android.com/reference/kotlin/androidx/media3/effect/GaussianBlurWithFrameOverlaid#GaussianBlurWithFrameOverlaid(float,float,float,float))`(` ` sigma: @`[FloatRange](https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange)`(from = 0.0, fromInclusive = false) `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` numStandardDeviations: @`[FloatRange](https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange)`(from = 0.0, fromInclusive = false) `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` scaleSharpX: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` scaleSharpY: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) `)` Creates an instance. |

|                                                  ### Public functions                                                   |
|-------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ConvolutionFunction1D](https://developer.android.com/reference/kotlin/androidx/media3/effect/ConvolutionFunction1D)`!` | [getConvolution](https://developer.android.com/reference/kotlin/androidx/media3/effect/GaussianBlurWithFrameOverlaid#getConvolution(long))`(presentationTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Returns a[1D convolution function](https://developer.android.com/reference/kotlin/androidx/media3/effect/ConvolutionFunction1D).                                                                                                                                  |
| [GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)`!`             | [toGlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GaussianBlurWithFrameOverlaid#toGlShaderProgram(android.content.Context,boolean))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!, useHdr: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns a[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)that applies the effect. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.media3.common.Effect](https://developer.android.com/reference/kotlin/androidx/media3/common/Effect) |-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [getDurationAfterEffectApplied](https://developer.android.com/reference/kotlin/androidx/media3/common/Effect#getDurationAfterEffectApplied(long))`(durationUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Returns the expected duration of the output stream when the effect is applied given a input`durationUs`. |                                                                                                                                                                                                   |
| From[androidx.media3.effect.GlEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect) |-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isNoOp](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect#isNoOp(int,int))`(inputWidth: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, inputHeight: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns whether a[GlEffect](https://developer.android.com/reference/kotlin/androidx/media3/effect/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)       | The half-width of 1 standard deviation, in pixels.                                                                                                   |
| `scaleSharpX: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | 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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | 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](https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange)`(from = 0.0, fromInclusive = false) `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                 | The half-width of 1 standard deviation, in pixels.                                                                                                   |
| `numStandardDeviations: @`[FloatRange](https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange)`(from = 0.0, fromInclusive = false) `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The size of function domain, measured in the number of standard deviations.                                                                          |
| `scaleSharpX: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                                                                                                                                             | 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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                                                                                                                                             | 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](https://developer.android.com/reference/kotlin/androidx/media3/effect/ConvolutionFunction1D).  

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| `presentationTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The presentation timestamp of the input frame, in microseconds. |

### toGlShaderProgram

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

Returns a[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)that applies the effect.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!` | A[Context](https://developer.android.com/reference/android/content/Context.html).                                                               |
| `useHdr: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | 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](https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessingException) | If an error occurs while creating the[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram). |