Added in API level 23

InputConfiguration

class InputConfiguration
kotlin.Any
   ↳ android.hardware.camera2.params.InputConfiguration

Immutable class to store an input configuration that is used to create a reprocessable capture session.

Summary

Public constructors
InputConfiguration(width: Int, height: Int, format: Int)

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

Create an input configuration with the format and a list of multi-resolution input stream info.

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

Returns a hash code value for the object.

Boolean

Whether this input configuration is of multi-resolution.

String

Return this InputConfiguration as a string representation.

Public constructors

InputConfiguration

Added in API level 23
InputConfiguration(
    width: Int,
    height: Int,
    format: Int)

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

Images of a 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.

InputConfiguration

Added in API level 23
InputConfiguration(
    multiResolutionInputs: MutableCollection<MultiResolutionStreamInfo!>,
    format: Int)

Create an input configuration with the format and a list of multi-resolution input stream info.

Use android.hardware.camera2.CameraCharacteristics#SCALER_MULTI_RESOLUTION_STREAM_CONFIGURATION_MAP to query supported multi-resolution input formats.

To do reprocessing with variable resolution input, the application calls ImageWriter.queueInputImage using an image from an ImageReader or . See android.hardware.camera2.CameraDevice#createReprocessCaptureRequest for more details on camera reprocessing.

Parameters
multiResolutionInputs MutableCollection<MultiResolutionStreamInfo!>: A group of multi-resolution input info for the specified format. This value cannot be null.
format Int: Format of the input buffers. One of ImageFormat or PixelFormat constants. Value is android.graphics.ImageFormat#UNKNOWN, android.graphics.PixelFormat#RGBA_8888, android.graphics.PixelFormat#RGBX_8888, android.graphics.PixelFormat#RGB_888, android.graphics.ImageFormat#RGB_565, android.graphics.ImageFormat#YV12, android.graphics.ImageFormat#Y8, android.graphics.ImageFormat.Y16, android.graphics.ImageFormat#YCBCR_P010, android.graphics.ImageFormat#NV16, android.graphics.ImageFormat#NV21, android.graphics.ImageFormat#YUY2, android.graphics.ImageFormat#JPEG, android.graphics.ImageFormat#DEPTH_JPEG, android.graphics.ImageFormat#YUV_420_888, android.graphics.ImageFormat#YUV_422_888, android.graphics.ImageFormat#YUV_444_888, android.graphics.ImageFormat#FLEX_RGB_888, android.graphics.ImageFormat#FLEX_RGBA_8888, android.graphics.ImageFormat#RAW_SENSOR, android.graphics.ImageFormat#RAW_PRIVATE, android.graphics.ImageFormat#RAW10, android.graphics.ImageFormat#RAW12, android.graphics.ImageFormat#DEPTH16, android.graphics.ImageFormat#DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, android.graphics.ImageFormat#PRIVATE, android.graphics.ImageFormat#HEIC, or android.graphics.ImageFormat#JPEG_R

Public methods

equals

Added in API level 23
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 the object to compare this instance with. This value may be null.
Return
Boolean true if the objects were equal, false otherwise.

getFormat

Added in API level 23
fun getFormat(): Int

Get the format of this input configuration.

Return
Int format of this input configuration.

getHeight

Added in API level 23
fun getHeight(): Int

Get the height of this input configuration.

Return
Int height of this input configuration.

getWidth

Added in API level 23
fun getWidth(): Int

Get the width of this input configuration.

Return
Int width of this input configuration.

hashCode

Added in API level 23
fun hashCode(): Int

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Return
Int a hash code value for this object.

isMultiResolution

Added in API level 31
fun isMultiResolution(): Boolean

Whether this input configuration is of multi-resolution.

An multi-resolution InputConfiguration means that the reprocessing session created from it allows input images of different sizes.

Return
Boolean this input configuration is multi-resolution or not.

toString

Added in API level 23
fun toString(): String

Return this InputConfiguration as a string representation.

"InputConfiguration(w:%d, h:%d, format:%d, isMultiResolution:%d)", where %d represents the width, height, format, and multi-resolution flag respectively.

Return
String string representation of InputConfiguration