TargetAspectRatio

@RequiresApi(21) open class TargetAspectRatio
kotlin.Any
   ↳ androidx.camera.camera2.internal.compat.workaround.TargetAspectRatio

Workaround to get corrected target aspect ratio.

Summary

Constants
static Int

16:9 standard aspect ratio.

static Int

4:3 standard aspect ratio.

static Int

The same aspect ratio as the maximum JPEG resolution.

static Int

No correction is needed.

Public constructors

Workaround to get corrected target aspect ratio.

Public methods
open Int
get(@NonNull imageOutputConfig: ImageOutputConfig, @NonNull cameraId: String, @NonNull cameraCharacteristicsCompat: CameraCharacteristicsCompat)

Gets corrected target aspect ratio based on device and camera quirks.

Constants

RATIO_16_9

static val RATIO_16_9: Int

16:9 standard aspect ratio.

Value: 1

RATIO_4_3

static val RATIO_4_3: Int

4:3 standard aspect ratio.

Value: 0

RATIO_MAX_JPEG

static val RATIO_MAX_JPEG: Int

The same aspect ratio as the maximum JPEG resolution.

Value: 2

RATIO_ORIGINAL

static val RATIO_ORIGINAL: Int

No correction is needed.

Value: 3

Public constructors

TargetAspectRatio

TargetAspectRatio()

Workaround to get corrected target aspect ratio.

Public methods

get

open fun get(
    @NonNull imageOutputConfig: ImageOutputConfig,
    @NonNull cameraId: String,
    @NonNull cameraCharacteristicsCompat: CameraCharacteristicsCompat
): Int

Gets corrected target aspect ratio based on device and camera quirks.