# HslAdjustment

# HslAdjustment

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

*** ** * ** ***

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

<br />

```
@UnstableApi
class HslAdjustment : GlEffect
```

<br />

*** ** * ** ***

Adjusts the HSL (Hue, Saturation, and Lightness) of a frame.

## Summary

|                                                                          ### Nested types                                                                           |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[HslAdjustment.Builder](https://developer.android.com/reference/kotlin/androidx/media3/effect/HslAdjustment.Builder) A builder for`HslAdjustment`instances. |

|                                                ### Public functions                                                 |
|---------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                 | [isNoOp](https://developer.android.com/reference/kotlin/androidx/media3/effect/HslAdjustment#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.                                             |
| [BaseGlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/BaseGlShaderProgram)`!` | [toGlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/HslAdjustment#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. |

|                              ### Public properties                              |
|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [hueAdjustmentDegrees](https://developer.android.com/reference/kotlin/androidx/media3/effect/HslAdjustment#hueAdjustmentDegrees()) Indicates the hue adjustment in degrees. |
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [lightnessAdjustment](https://developer.android.com/reference/kotlin/androidx/media3/effect/HslAdjustment#lightnessAdjustment()) Indicates the lightness adjustment.        |
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [saturationAdjustment](https://developer.android.com/reference/kotlin/androidx/media3/effect/HslAdjustment#saturationAdjustment()) Indicates the saturation adjustment.     |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### 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`. | |

## Public functions

### isNoOp

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

Returns whether a[GlEffect](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: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)  | The input frame width, in pixels.  |
| `inputHeight: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The input frame height, in pixels. |

### toGlShaderProgram

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

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). |

## Public properties

### hueAdjustmentDegrees

```
val hueAdjustmentDegrees: Float
```

Indicates the hue adjustment in degrees.  

### lightnessAdjustment

```
val lightnessAdjustment: Float
```

Indicates the lightness adjustment.  

### saturationAdjustment

```
val saturationAdjustment: Float
```

Indicates the saturation adjustment.