# AlphaScale

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

*** ** * ** ***


```
@UnstableApi
class AlphaScale : GlEffect
```

<br />

*** ** * ** ***

Scales the alpha value (i.e. the translucency) of a frame.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/AlphaScale#AlphaScale(float)(alphaScale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Creates a new instance to scale the entire frame's alpha values by `alphaScale`, to modify translucency. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/AlphaScale#isNoOp(int,int)(inputWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, inputHeight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns whether a `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect` applies no change at every timestamp. |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/AlphaScale#toGlShaderProgram(android.content.Context,boolean)(context: https://developer.android.com/reference/android/content/Context.html!, useHdr: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Returns a `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) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/common/Effect#getDurationAfterEffectApplied(long)(durationUs: 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`. | |

## Public constructors

### AlphaScale

```
AlphaScale(alphaScale: @FloatRange(from = 0) Float)
```

Creates a new instance to scale the entire frame's alpha values by `alphaScale`, to modify translucency.

An `alphaScale` value of `1` means no change is applied. A value below `1` increases translucency, and a value above `1` reduces translucency.

## Public functions

### isNoOp

```
fun isNoOp(inputWidth: Int, inputHeight: Int): Boolean
```

Returns whether a `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlEffect` applies no change at every timestamp.

This can be used as a hint to skip this instance.

| Parameters |
|---|---|
| `inputWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The input frame width, in pixels. |
| `inputHeight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The input frame height, in pixels. |

### toGlShaderProgram

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

Returns a `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram` that applies the effect.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` | A `https://developer.android.com/reference/android/content/Context.html`. |
| `useHdr: 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 |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessingException` | If an error occurs while creating the `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram`. |