public final class

CameraController.OutputSize

extends java.lang.Object

 java.lang.Object

↳androidx.camera.view.CameraController.OutputSize

Overview

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

Fields
public static final intUNASSIGNED_ASPECT_RATIO

A value that represents the aspect ratio is not assigned.

Constructors
publicOutputSize(int aspectRatio)

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

publicOutputSize(Size resolution)

Creates a CameraController.OutputSize that is based on resolution.

Methods
public intgetAspectRatio()

Gets the value of aspect ratio.

public SizegetResolution()

Gets the value of resolution.

public java.lang.StringtoString()

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Fields

public static final int UNASSIGNED_ASPECT_RATIO

A value that represents the aspect ratio is not assigned.

Constructors

public OutputSize(int aspectRatio)

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

See also:

public OutputSize(Size resolution)

Creates a CameraController.OutputSize that is based on resolution.

See also:

Methods

public int getAspectRatio()

Gets the value of aspect ratio.

Returns:

CameraController.OutputSize.UNASSIGNED_ASPECT_RATIO if the size is not based on aspect ratio.

public Size getResolution()

Gets the value of resolution.

Returns:

null if the size is not based on resolution.

public java.lang.String toString()