# ColorLut

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

*** ** * ** ***


```
@UnstableApi
public interface ColorLut extends GlEffect
```

<br />

Known direct subclasses [SingleColorLut](https://developer.android.com/reference/androidx/media3/effect/SingleColorLut)

|---|---|
| `https://developer.android.com/reference/androidx/media3/effect/SingleColorLut` | Transforms the colors of a frame by applying the same color lookup table to each frame. |

*** ** * ** ***

Specifies color transformations using color lookup tables to apply to each frame in the fragment shader.

## Summary

| ### Public methods |
|---|---|
| `abstract int` | `https://developer.android.com/reference/androidx/media3/effect/ColorLut#getLength(long)(long presentationTimeUs)` Returns the length N of the 3D N x N x N LUT cube with the given timestamp. |
| `abstract int` | `https://developer.android.com/reference/androidx/media3/effect/ColorLut#getLutTextureId(long)(long presentationTimeUs)` Returns the OpenGL texture ID of the LUT to apply to the pixels of the frame with the given timestamp. |
| `abstract void` | `https://developer.android.com/reference/androidx/media3/effect/ColorLut#release()()` Releases the OpenGL texture of the LUT. |
| `default https://developer.android.com/reference/androidx/media3/effect/GlShaderProgram` | `https://developer.android.com/reference/androidx/media3/effect/ColorLut#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) |---|---| | `default 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`. | |
| From [androidx.media3.effect.GlEffect](https://developer.android.com/reference/androidx/media3/effect/GlEffect) |---|---| | `default boolean` | `https://developer.android.com/reference/androidx/media3/effect/GlEffect#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. | |

## Public methods

### getLength

```
abstract int getLength(long presentationTimeUs)
```

Returns the length N of the 3D N x N x N LUT cube with the given timestamp.

### getLutTextureId

```
abstract int getLutTextureId(long presentationTimeUs)
```

Returns the OpenGL texture ID of the LUT to apply to the pixels of the frame with the given timestamp.

### release

```
abstract void release()
```

Releases the OpenGL texture of the LUT.

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/util/GlUtil.GlException` |   |

### toGlShaderProgram

```
default GlShaderProgram 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`. |