# OverlaySettings

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/OverlaySettings.java+class:androidx.media3.common.OverlaySettings)

*** ** * ** ***


```
@UnstableApi
public interface OverlaySettings
```

<br />

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

|---|---|
| `https://developer.android.com/reference/androidx/media3/effect/StaticOverlaySettings` | A statically valued `https://developer.android.com/reference/androidx/media3/common/OverlaySettings`. |

*** ** * ** ***

Provides information of how an input texture (for example, a `TextureOverlay` or in `
VideoCompositor`) is presented.

## Summary

| ### Constants |
|---|---|
| `default static final float` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_ALPHA_SCALE() = 1.0f` The default alpha scale value of the overlay. |
| `default static final https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Float.html, https://developer.android.com/reference/java/lang/Float.html>` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_BACKGROUND_FRAME_ANCHOR()` The default coordinates for the anchor point of the overlay within the background frame. |
| `default static final float` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_HDR_LUMINANCE_MULTIPLIER() = 1.0f` The default luminance multiplier of an SDR overlay when overlaid on a HDR frame. |
| `default static final https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Float.html, https://developer.android.com/reference/java/lang/Float.html>` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_OVERLAY_FRAME_ANCHOR()` The default coordinates for the anchor point of the overlay frame. |
| `default static final float` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_ROTATION_DEGREES() = 0.0f` The default rotation of the overlay, counter-clockwise. |
| `default static final https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Float.html, https://developer.android.com/reference/java/lang/Float.html>` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_SCALE()` The default scaling of the overlay. |

| ### Public methods |
|---|---|
| `default float` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getAlphaScale()()` Returns the alpha scale value of the overlay, altering its translucency. |
| `default https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Float.html, https://developer.android.com/reference/java/lang/Float.html>` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getBackgroundFrameAnchor()()` Returns the coordinates for the anchor point of the overlay within the background frame. |
| `default float` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getHdrLuminanceMultiplier()()` Returns the luminance multiplier of an SDR overlay when overlaid on a HDR frame. |
| `default https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Float.html, https://developer.android.com/reference/java/lang/Float.html>` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getOverlayFrameAnchor()()` Returns the coordinates for the anchor point within the overlay. |
| `default float` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getRotationDegrees()()` Returns the rotation of the overlay, counter-clockwise. |
| `default https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Float.html, https://developer.android.com/reference/java/lang/Float.html>` | `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getScale()()` Returns the scaling of the overlay. |

## Constants

### DEFAULT_ALPHA_SCALE

```
default static final float DEFAULT_ALPHA_SCALE = 1.0f
```

The default alpha scale value of the overlay.

### DEFAULT_BACKGROUND_FRAME_ANCHOR

```
default static final Pair<Float, Float> DEFAULT_BACKGROUND_FRAME_ANCHOR
```

The default coordinates for the anchor point of the overlay within the background frame.

### DEFAULT_HDR_LUMINANCE_MULTIPLIER

```
default static final float DEFAULT_HDR_LUMINANCE_MULTIPLIER = 1.0f
```

The default luminance multiplier of an SDR overlay when overlaid on a HDR frame.

### DEFAULT_OVERLAY_FRAME_ANCHOR

```
default static final Pair<Float, Float> DEFAULT_OVERLAY_FRAME_ANCHOR
```

The default coordinates for the anchor point of the overlay frame.

### DEFAULT_ROTATION_DEGREES

```
default static final float DEFAULT_ROTATION_DEGREES = 0.0f
```

The default rotation of the overlay, counter-clockwise.

### DEFAULT_SCALE

```
default static final Pair<Float, Float> DEFAULT_SCALE
```

The default scaling of the overlay.

## Public methods

### getAlphaScale

```
default float getAlphaScale()
```

Returns the alpha scale value of the overlay, altering its translucency.

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

The default value is `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_ALPHA_SCALE()`.

### getBackgroundFrameAnchor

```
default Pair<Float, Float> getBackgroundFrameAnchor()
```

Returns the coordinates for the anchor point of the overlay within the background frame.

The coordinates are specified in Normalised Device Coordinates (NDCs) relative to the background frame. The ranges for x and y are from `-1` to `1`. The default value is `(0,0)`, the center of the background frame.

The overlay's `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getOverlayFrameAnchor()` will be positioned at the anchor point returned from this method. For example, a value of `(1,1)` will move the `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getOverlayFrameAnchor()` to the top right corner. That is, if the overlay's anchor is at `(1,1)` (the top right corner), the overlay's top right corner will be aligned with that of the background frame; whereas if the overlay's anchor is at `
(0,0)` (the center), the overlay's center will be positioned at the top right corner of the background frame.

The default value is `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_BACKGROUND_FRAME_ANCHOR()`.

### getHdrLuminanceMultiplier

```
default float getHdrLuminanceMultiplier()
```

Returns the luminance multiplier of an SDR overlay when overlaid on a HDR frame.

Scales the luminance of the overlay to adjust the output brightness of the overlay on the frame. The default value is 1, which scales the overlay colors into the standard HDR luminance within the processing pipeline. Use 0.5 to scale the luminance of the overlay to SDR range, so that no extra luminance is added.

Currently only supported on text overlays

The default value is `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_HDR_LUMINANCE_MULTIPLIER()`.

### getOverlayFrameAnchor

```
default Pair<Float, Float> getOverlayFrameAnchor()
```

Returns the coordinates for the anchor point within the overlay.

The anchor point is the point inside the overlay that is placed on the `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getBackgroundFrameAnchor()`

The coordinates are specified in Normalised Device Coordinates (NDCs) relative to the overlay. The ranges for x and y are from `-1` to `1`. The default value is `
(0,0)`, the center of the overlay.

See `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#getBackgroundFrameAnchor()` for examples of how to position an overlay.

The default value is `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_OVERLAY_FRAME_ANCHOR()`.

### getRotationDegrees

```
default float getRotationDegrees()
```

Returns the rotation of the overlay, counter-clockwise.

The overlay is rotated at the center of its frame.

The default value is `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_ROTATION_DEGREES()`.

### getScale

```
default Pair<Float, Float> getScale()
```

Returns the scaling of the overlay.

The default value is `https://developer.android.com/reference/androidx/media3/common/OverlaySettings#DEFAULT_SCALE()`.