ExtensionSessionConfig.Builder


class ExtensionSessionConfig.Builder


Builder for ExtensionSessionConfig.

See also
getInstanceAsync

Summary

Public constructors

Builder(mode: Int, extensionsManager: ExtensionsManager)

Public functions

ExtensionSessionConfig.Builder

Adds a CameraEffect for the session.

ExtensionSessionConfig.Builder
addUseCase(useCase: UseCase)

Adds a UseCase to the session.

ExtensionSessionConfig

Builds an ExtensionSessionConfig from the current configuration.

ExtensionSessionConfig.Builder
setAutoRotationEnabled(autoRotationEnabled: Boolean)

Sets whether to use auto rotation.

ExtensionSessionConfig.Builder
setViewPort(viewPort: ViewPort)

Sets the ViewPort for the session.

Public properties

Boolean

Whether to use auto rotation.

ViewPort?

The ViewPort for the session.

Public constructors

Builder

Added in 1.6.0
Builder(mode: Int, extensionsManager: ExtensionsManager)
Parameters
mode: Int

The extension mode. See ExtensionMode for the list of available modes.

extensionsManager: ExtensionsManager

The ExtensionsManager instance.

Public functions

addEffect

Added in 1.6.0
fun addEffect(effect: CameraEffect): ExtensionSessionConfig.Builder

Adds a CameraEffect for the session.

addUseCase

Added in 1.6.0
fun addUseCase(useCase: UseCase): ExtensionSessionConfig.Builder

Adds a UseCase to the session.

build

Added in 1.6.0
fun build(): ExtensionSessionConfig

Builds an ExtensionSessionConfig from the current configuration.

Throws
IllegalArgumentException

if the given mode is not a valid extension mode.

setAutoRotationEnabled

Added in 1.7.0-alpha02
fun setAutoRotationEnabled(autoRotationEnabled: Boolean): ExtensionSessionConfig.Builder

Sets whether to use auto rotation.

When enabled, CameraX will monitor the device motion sensor and set the target rotation for ImageCapture and VideoCapture.

setViewPort

Added in 1.6.0
fun setViewPort(viewPort: ViewPort): ExtensionSessionConfig.Builder

Sets the ViewPort for the session.

Public properties

isAutoRotationEnabled

Added in 1.7.0-alpha02
var isAutoRotationEnabledBoolean

Whether to use auto rotation.

viewPort

Added in 1.7.0-alpha02
var viewPortViewPort?

The ViewPort for the session.