OverlaySettings.Builder


class OverlaySettings.Builder


A builder for OverlaySettings instances.

Summary

Public constructors

Creates a new Builder.

Public functions

OverlaySettings!

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

OverlaySettings.Builder!

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

OverlaySettings.Builder!
@CanIgnoreReturnValue
setBackgroundFrameAnchor(
    x: @FloatRange(from = "-1", to = 1) Float,
    y: @FloatRange(from = "-1", to = 1) Float
)

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

OverlaySettings.Builder!
@CanIgnoreReturnValue
setOverlayFrameAnchor(
    x: @FloatRange(from = "-1", to = 1) Float,
    y: @FloatRange(from = "-1", to = 1) Float
)

Sets the coordinates for the anchor point of the overlay frame.

OverlaySettings.Builder!

Sets the rotation of the overlay, counter-clockwise.

OverlaySettings.Builder!

Sets the scaling of the overlay.

OverlaySettings.Builder!

Sets whether input overlay comes from an HDR source.

Public constructors

Builder

Builder()

Creates a new Builder.

Public functions

build

fun build(): OverlaySettings!

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

setAlphaScale

@CanIgnoreReturnValue
fun setAlphaScale(alphaScale: @FloatRange(from = 0) Float): OverlaySettings.Builder!

Sets 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.

Set to always return 1 by default.

setBackgroundFrameAnchor

@CanIgnoreReturnValue
fun setBackgroundFrameAnchor(
    x: @FloatRange(from = "-1", to = 1) Float,
    y: @FloatRange(from = "-1", to = 1) Float
): OverlaySettings.Builder!

Sets 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. Set to always return (0,0) (the center of the background frame) by default.

For example, a value of (+1,+1) will move the overlay frames's anchor point to the top right corner of the background frame.

Parameters
x: @FloatRange(from = "-1", to = 1) Float

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

y: @FloatRange(from = "-1", to = 1) Float

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

setOverlayFrameAnchor

@CanIgnoreReturnValue
fun setOverlayFrameAnchor(
    x: @FloatRange(from = "-1", to = 1) Float,
    y: @FloatRange(from = "-1", to = 1) Float
): OverlaySettings.Builder!

Sets the coordinates for the anchor point of the overlay frame.

The anchor point is the point inside the overlay frame that is placed on the background frame anchor

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

For example, a value of (+1,-1) will result in the overlay frame being positioned with its bottom right corner positioned at the background frame anchor.

Parameters
x: @FloatRange(from = "-1", to = 1) Float

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

y: @FloatRange(from = "-1", to = 1) Float

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

setRotationDegrees

@CanIgnoreReturnValue
fun setRotationDegrees(rotationDegree: Float): OverlaySettings.Builder!

Sets the rotation of the overlay, counter-clockwise.

The overlay is rotated at the center of its frame.

Parameters
rotationDegree: Float

The desired degrees of rotation, counter-clockwise.

setScale

@CanIgnoreReturnValue
fun setScale(x: Float, y: Float): OverlaySettings.Builder!

Sets the scaling of the overlay.

Parameters
x: Float

The desired scaling in the x axis of the overlay.

y: Float

The desired scaling in the y axis of the overlay.

setUsesHdr

@CanIgnoreReturnValue
fun setUsesHdr(useHdr: Boolean): OverlaySettings.Builder!

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.