ViewfinderSurfaceRequest.Builder


class ViewfinderSurfaceRequest.Builder


Builder for ViewfinderSurfaceRequest.

Summary

Public constructors

Constructor for Builder.

Builder(resolution: Size)

Constructor for Builder.

Constructor for Builder.

Public functions

ViewfinderSurfaceRequest

Builds the ViewfinderSurfaceRequest.

ViewfinderSurfaceRequest.Builder

Sets the ImplementationMode.

ViewfinderSurfaceRequest.Builder
setOutputMirrorMode(outputMirrorMode: Int)

Sets the output mirror mode.

ViewfinderSurfaceRequest.Builder
setSourceOrientation(sourceOrientation: Int)

Sets the sensor orientation.

Public constructors

Builder

Added in 1.4.0-alpha10
Builder(builder: ViewfinderSurfaceRequest.Builder)

Constructor for Builder.

Creates a builder with other builder instance. The returned builder will be pre-populated with the state of the provided builder.

Parameters
builder: ViewfinderSurfaceRequest.Builder

Builder instance.

Builder

Added in 1.4.0-alpha10
Builder(resolution: Size)

Constructor for Builder.

Creates a builder with viewfinder resolution.

Parameters
resolution: Size

viewfinder resolution.

Builder

Added in 1.4.0-alpha10
Builder(surfaceRequest: ViewfinderSurfaceRequest)

Constructor for Builder.

Creates a builder with other ViewfinderSurfaceRequest instance. The returned builder will be pre-populated with the state of the provided ViewfinderSurfaceRequest instance.

Parameters
surfaceRequest: ViewfinderSurfaceRequest

ViewfinderSurfaceRequest instance.

Public functions

setImplementationMode

Added in 1.4.0-alpha10
fun setImplementationMode(implementationMode: ImplementationMode?): ViewfinderSurfaceRequest.Builder

Sets the ImplementationMode.

Possible values:

Parameters
implementationMode: ImplementationMode?

The ImplementationMode.

Returns
ViewfinderSurfaceRequest.Builder

This builder.

setOutputMirrorMode

Added in 1.4.0-alpha10
fun setOutputMirrorMode(outputMirrorMode: Int): ViewfinderSurfaceRequest.Builder

Sets the output mirror mode.

Possible values:

If not set, MIRROR_MODE_NONE will be used by default.

Parameters
outputMirrorMode: Int

The viewfinder output mirror mode.

Returns
ViewfinderSurfaceRequest.Builder

This builder.

setSourceOrientation

Added in 1.4.0-alpha10
fun setSourceOrientation(sourceOrientation: Int): ViewfinderSurfaceRequest.Builder

Sets the sensor orientation.

Range of valid values:

0, 90, 180, 270

If it is not set, 0 will be used by default.

Parameters
sourceOrientation: Int

The viewfinder source orientation.

Returns
ViewfinderSurfaceRequest.Builder

This builder.

Extension functions

populateFromCharacteristics

fun ViewfinderSurfaceRequest.Builder.populateFromCharacteristics(
    cameraCharacteristics: CameraCharacteristics
): ViewfinderSurfaceRequest.Builder

Populates ViewfinderSurfaceRequest.Builder from CameraCharacteristics.

The CameraCharacteristics will be used to populate information including lens facing, sensor orientation and ImplementationMode. If the hardware level is legacy, the ImplementationMode will be set to ImplementationMode.EMBEDDED.