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. |
|
InputConfiguration(multiResolutionInputs: MutableCollection<MultiResolutionStreamInfo!>, format: Int) Create an input configuration with the format and a list of multi-resolution input stream info. |
Public methods | |
---|---|
Boolean |
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 |
getWidth() Get the width of this input configuration. |
Int |
hashCode() Returns a hash code value for the object. |
Boolean |
Whether this input configuration is of multi-resolution. |
String |
toString() Return this |
Public constructors
InputConfiguration
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
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.
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 |
the object to compare this instance with. This value may be null . |
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
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 inequals
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 thehashCode
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 thehashCode
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
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
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 |