Back to Exoplayer

OverlaySettings.Builder (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/effect/OverlaySettings.Builder.html

latest4.6 KB
Original Source

Package com.google.android.exoplayer2.effect

Class OverlaySettings.Builder


public static final classOverlaySettings.Builderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

A builder for OverlaySettings instances.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | Builder() | Creates a new OverlaySettings.Builder. |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | OverlaySettings | build() | Creates an instance of OverlaySettings, using defaults if values are unset. | | OverlaySettings.Builder | setAlpha​(float alpha) | Sets the alpha value of the overlay, altering its transparency. | | OverlaySettings.Builder | setAnchor​(float x, float y) | Sets the coordinates for the anchor point of the overlay. | | OverlaySettings.Builder | setMatrix​(float[] matrix) | Sets the Matrix used to transform the overlay before applying it to a frame. | | OverlaySettings.Builder | setUsesHdr​(boolean useHdr) | Sets whether input overlay comes from an HDR source. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

Builder

public Builder()

Creates a new OverlaySettings.Builder.

Method Detail

- 

setUsesHdr

@CanIgnoreReturnValue
public[OverlaySettings.Builder](OverlaySettings.Builder.html "class in com.google.android.exoplayer2.effect")setUsesHdr​(boolean useHdr)

Sets whether input overlay comes from an HDR source. If true, colors will be in linear RGB BT.2020. If false, colors will be in linear RGB BT.709.

Set to false by default.

- 

setMatrix

@CanIgnoreReturnValue
public[OverlaySettings.Builder](OverlaySettings.Builder.html "class in com.google.android.exoplayer2.effect")setMatrix​(float[] matrix)

Sets the Matrix used to transform the overlay before applying it to a frame.

Set to always return the identity matrix by default.

- 

setAlpha

@CanIgnoreReturnValue
public[OverlaySettings.Builder](OverlaySettings.Builder.html "class in com.google.android.exoplayer2.effect")setAlpha​(@FloatRange(from=0.0,to=1.0)
                                        float alpha)

Sets the alpha value of the overlay, altering its transparency.

Alpha values range from 0 (all transparent) to 1 (completely opaque).

Set to always return 1 by default.

- 

setAnchor

@CanIgnoreReturnValue
public[OverlaySettings.Builder](OverlaySettings.Builder.html "class in com.google.android.exoplayer2.effect")setAnchor​(@FloatRange(from=-1.0,to=1.0)
                                         float x,
                                         @FloatRange(from=-1.0,to=1.0)
                                         float y)

Sets the coordinates for the anchor point of the overlay.

The anchor point is the point inside the overlay that the overlay is positioned from.

The coordinates are specified in Normalised Device Coordinates (NDCs). Set to always return (0,0) (the center) by default.

Parameters:x - The NDC x-coordinate in the range [-1, 1].y - The NDC y-coordinate in the range [-1, 1].

- 

build

public[OverlaySettings](OverlaySettings.html "class in com.google.android.exoplayer2.effect")build()

Creates an instance of OverlaySettings, using defaults if values are unset.