Class OverlaySettings.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.effect.OverlaySettings.Builder
-
- Enclosing class:
- OverlaySettings
public static final class OverlaySettings.Builder extends Object
A builder forOverlaySettingsinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Creates a newOverlaySettings.Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OverlaySettingsbuild()Creates an instance ofOverlaySettings, using defaults if values are unset.OverlaySettings.BuildersetAlpha(float alpha)Sets the alpha value of the overlay, altering its transparency.OverlaySettings.BuildersetAnchor(float x, float y)Sets the coordinates for the anchor point of the overlay.OverlaySettings.BuildersetMatrix(float[] matrix)Sets theMatrixused to transform the overlay before applying it to a frame.OverlaySettings.BuildersetUsesHdr(boolean useHdr)Sets whether input overlay comes from an HDR source.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a newOverlaySettings.Builder.
-
-
Method Detail
-
setUsesHdr
@CanIgnoreReturnValue public OverlaySettings.Builder setUsesHdr(boolean useHdr)
Sets whether input overlay comes from an HDR source. Iftrue, colors will be in linear RGB BT.2020. Iffalse, colors will be in linear RGB BT.709.Set to
falseby default.
-
setMatrix
@CanIgnoreReturnValue public OverlaySettings.Builder setMatrix(float[] matrix)
Sets theMatrixused to transform the overlay before applying it to a frame.Set to always return the identity matrix by default.
-
setAlpha
@CanIgnoreReturnValue public OverlaySettings.Builder 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
1by default.
-
setAnchor
@CanIgnoreReturnValue public OverlaySettings.Builder 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 build()
Creates an instance ofOverlaySettings, using defaults if values are unset.
-
-