HslAdjustment


@UnstableApi
public final class HslAdjustment implements GlEffect


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

Summary

Nested types

public final class HslAdjustment.Builder

A builder for HslAdjustment instances.

Public fields

final float

Indicates the hue adjustment in degrees.

final float

Indicates the lightness adjustment.

final float

Indicates the saturation adjustment.

Public methods

boolean
isNoOp(int inputWidth, int inputHeight)

Returns whether a GlEffect applies no change at every timestamp.

BaseGlShaderProgram
toGlShaderProgram(Context context, boolean useHdr)

Returns a GlShaderProgram that applies the effect.

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 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 GlShaderProgram that applies the effect.

Parameters
Context context

A Context.

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
androidx.media3.common.VideoFrameProcessingException

If an error occurs while creating the .