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

*** ** * ** ***


```
@UnstableApi
public final class HslAdjustment implements GlEffect
```

<br />

*** ** * ** ***

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

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/media3/effect/HslAdjustment.Builder` A builder for `HslAdjustment` instances. |

| ### Public fields |
|---|---|
| `final float` | `https://developer.android.com/reference/androidx/media3/effect/HslAdjustment#hueAdjustmentDegrees()` Indicates the hue adjustment in degrees. |
| `final float` | `https://developer.android.com/reference/androidx/media3/effect/HslAdjustment#lightnessAdjustment()` Indicates the lightness adjustment. |
| `final float` | `https://developer.android.com/reference/androidx/media3/effect/HslAdjustment#saturationAdjustment()` Indicates the saturation adjustment. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/effect/HslAdjustment#isNoOp(int,int)(int inputWidth, int inputHeight)` Returns whether a `https://developer.android.com/reference/androidx/media3/effect/GlEffect` applies no change at every timestamp. |
| `https://developer.android.com/reference/androidx/media3/effect/BaseGlShaderProgram` | `https://developer.android.com/reference/androidx/media3/effect/HslAdjustment#toGlShaderProgram(android.content.Context,boolean)(https://developer.android.com/reference/android/content/Context.html context, boolean useHdr)` Returns a `https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram` that applies the effect. |

| ### Inherited methods |
|---|
| From [androidx.media3.common.Effect](https://developer.android.com/reference/androidx/media3/common/Effect) |---|---| | `long` | `https://developer.android.com/reference/androidx/media3/common/Effect#getDurationAfterEffectApplied(long)(long durationUs)` Returns the expected duration of the output stream when the effect is applied given a input `durationUs`. | |

## Public fields

### hueAdjustmentDegrees

```
public final float hueAdjustmentDegrees
```

Indicates the hue adjustment in degrees.

### lightnessAdjustment

```
public final float lightnessAdjustment
```

Indicates the lightness adjustment.

### saturationAdjustment

```
public final float saturationAdjustment
```

Indicates the saturation adjustment.

## Public methods

### isNoOp

```
public boolean isNoOp(int inputWidth, int inputHeight)
```

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

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

| Parameters |
|---|---|
| `int inputWidth` | The input frame width, in pixels. |
| `int inputHeight` | The input frame height, in pixels. |

### toGlShaderProgram

```
public BaseGlShaderProgram toGlShaderProgram(Context context, boolean useHdr)
```

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

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