InputConfigurationCompat

class InputConfigurationCompat
kotlin.Any
   ↳ androidx.camera.camera2.impl.compat.params.InputConfigurationCompat

Helper for accessing features in InputConfiguration in a backwards compatible fashion.

Summary

Public constructors

<init>(width: Int, height: Int, format: Int)

Create an input configuration with the width, height, and user-defined format.

Public methods

Boolean
equals(other: Any?)

Check if this InputConfiguration is equal to another InputConfiguration.

Int

Get the format of this input configuration.

Int

Get the height of this input configuration.

Int

Get the width of this input configuration.

Int

String

Return this InputConfigurationCompat as a string representation.

Any?

Gets the underlying framework android.

static InputConfigurationCompat?
wrap(@Nullable inputConfiguration: Any?)

Creates an instance from a framework android.

Public constructors

<init>

InputConfigurationCompat(width: Int, height: Int, format: Int)

Create an input configuration with the width, height, and user-defined format.

Images of an user-defined format are accessible by applications. Use android.hardware.camera2.CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP to query supported input formats

Parameters
width Int: Width of the input buffers.
height Int: Height of the input buffers.
format Int: Format of the input buffers. One of ImageFormat or PixelFormat constants.

Public methods

equals

fun equals(other: Any?): Boolean

Check if this InputConfiguration is equal to another InputConfiguration.

Two input configurations are equal if and only if they have the same widths, heights, and formats.

Parameters
obj Any?: the object to compare this instance with.
Return
Boolean: true if the objects were equal, false otherwise.

getFormat

fun getFormat(): Int

Get the format of this input configuration.

Return
Int: format of this input configuration.

getHeight

fun getHeight(): Int

Get the height of this input configuration.

Return
Int: height of this input configuration.

getWidth

fun getWidth(): Int

Get the width of this input configuration.

Return
Int: width of this input configuration.

hashCode

fun hashCode(): Int

toString

fun toString(): String

Return this InputConfigurationCompat as a string representation.

"InputConfiguration(w:%d, h:%d, format:%d)", where %d represents the width, height, and format, respectively.

Return
String: string representation of InputConfigurationCompat

unwrap

@Nullable fun unwrap(): Any?

Gets the underlying framework android.hardware.camera2.params.InputConfiguration object.

This method always returns null on API <= 22.

Return
Any?: an equivalent android.hardware.camera2.params.InputConfiguration object, or null if not supported.

wrap

@Nullable static fun wrap(@Nullable inputConfiguration: Any?): InputConfigurationCompat?

Creates an instance from a framework android.hardware.camera2.params.InputConfiguration object.

This method always returns null on API <= 22.

Parameters
inputConfiguration Any?: an android.hardware.camera2.params.InputConfiguration object, or null if none.
Return
InputConfigurationCompat?: an equivalent InputConfigurationCompat object, or null if not supported.