CameraController.OutputSize

public static final class CameraController.OutputSize
extends Object

java.lang.Object
   ↳ androidx.camera.view.CameraController.OutputSize


Represents the output size of a UseCase.

This class is a preferred output size to be used with CameraController. The preferred output size can be based on either resolution or aspect ratio, but not both.

Summary

Constants

int UNASSIGNED_ASPECT_RATIO

A value that represents the aspect ratio is not assigned.

Public constructors

OutputSize(int aspectRatio)

Creates a CameraController.OutputSize that is based on aspect ratio.

OutputSize(Size resolution)

Creates a CameraController.OutputSize that is based on resolution.

Public methods

int getAspectRatio()

Gets the value of aspect ratio.

Size getResolution()

Gets the value of resolution.

String toString()

Inherited methods

Constants

UNASSIGNED_ASPECT_RATIO

public static final int UNASSIGNED_ASPECT_RATIO

A value that represents the aspect ratio is not assigned.

Constant Value: -1 (0xffffffff)

Public constructors

OutputSize

public OutputSize (int aspectRatio)

Creates a CameraController.OutputSize that is based on aspect ratio.

Parameters
aspectRatio int

OutputSize

public OutputSize (Size resolution)

Creates a CameraController.OutputSize that is based on resolution.

Parameters
resolution Size

Public methods

getAspectRatio

public int getAspectRatio ()

Gets the value of aspect ratio.

Returns
int UNASSIGNED_ASPECT_RATIO if the size is not based on aspect ratio.

getResolution

public Size getResolution ()

Gets the value of resolution.

Returns
Size null if the size is not based on resolution.

toString

public String toString ()

Returns
String