Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Builder

*** ** * ** ***

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.hardware.camera2.MultiResolutionImageReader.Builder](https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.Builder#) |

Builder class for `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader` objects.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.Builder#Builder(kotlin.collections.MutableCollection,%20kotlin.Int,%20kotlin.Int)(streams: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html<https://developer.android.com/reference/kotlin/android/hardware/camera2/params/MultiResolutionStreamInfo!>, format: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, maxImages: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Constructs a new builder for `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader`. |

| Public methods ||
|---|---|
| [MultiResolutionImageReader](https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader) | `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.Builder#build()()` Build a new MultiResolutionImageReader object. |
| [MultiResolutionImageReader.Builder](https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.Builder#setConcurrentOutputsEnabled(kotlin.Boolean)(enable: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` Turn on/off concurrent outputs for the internal ImageReaders. |
| [MultiResolutionImageReader.Builder](https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.Builder#) | `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.Builder#setUsage(kotlin.Long)(usage: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Set the intended android. |

## Public constructors

### Builder

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
Builder(
    streams: MutableCollection<MultiResolutionStreamInfo!>, 
    format: Int, 
    maxImages: Int)
```

Constructs a new builder for `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader`.

See `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader#MultiResolutionImageReader(kotlin.collections.MutableCollection,%20kotlin.Int,%20kotlin.Int,%20kotlin.Long)` for detailed explanations of the constructor parameters.

| Parameters ||
|---|---|
| `streams` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[MultiResolutionStreamInfo](https://developer.android.com/reference/kotlin/android/hardware/camera2/params/MultiResolutionStreamInfo)!\>: The group of multi-resolution stream info returned from `https://developer.android.com/reference/kotlin/android/hardware/camera2/params/MultiResolutionStreamConfigurationMap#getOutputFormats()`. This value cannot be `null`. |
| `format` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The format of the Image that this multi-resolution reader will produce. |
| `maxImages` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The maximum number of images the user will want to access simultaneously. Value is 1 or greater |

## Public methods

### build

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun build(): MultiResolutionImageReader
```

Build a new MultiResolutionImageReader object.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader` | The new MultiResolutionImageReader object. This value cannot be `null`. |

### setConcurrentOutputsEnabled

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun setConcurrentOutputsEnabled(enable: Boolean): MultiResolutionImageReader.Builder
```

Turn on/off concurrent outputs for the internal ImageReaders.

If `https://developer.android.com/reference/kotlin/android/hardware/camera2/params/MultiResolutionStreamConfigurationMap#isConcurrentReadersSupported(kotlin.Int)` returns `true`, the camera device supports concurrent outputs from multiple internal ImageReaders (for example, in scenarios where multiple sensors run at the same time). By default, concurrent outputs are disabled. The application can enable such mode by calling this function with `true`.

| Parameters ||
|---|---|
| `enable` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): Whether to allow the camera device to output concurrent readers for this MultiResolutionImageReader. If set to true for a device that doesn't support MultiResolutionImageReader concurrency, android.hardware.camera2.CameraDevice#createCaptureSession will fail. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.Builder#` | the Builder instance with concurrency enabled. This value cannot be `null`. |

### setUsage

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun setUsage(usage: Long): MultiResolutionImageReader.Builder
```

Set the intended android.hardware.HardwareBuffer.Usage of the images produced by the internal ImageReaders.

The default usage is `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_CPU_READ_OFTEN:kotlin.Long`, unless the format is `https://developer.android.com/reference/kotlin/android/graphics/ImageFormat.html#PRIVATE:kotlin.Int`, in which case the default usage is 0.

| Parameters ||
|---|---|
| `usage` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): The intended android.hardware.HardwareBuffer.Usage of the images produced by the internal ImageReaders. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_CPU_READ_RARELY:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_CPU_READ_OFTEN:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_CPU_WRITE_RARELY:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_CPU_WRITE_OFTEN:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_GPU_SAMPLED_IMAGE:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_GPU_COLOR_OUTPUT:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_COMPOSER_OVERLAY:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_PROTECTED_CONTENT:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_VIDEO_ENCODE:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_GPU_DATA_BUFFER:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_SENSOR_DIRECT_DATA:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_GPU_CUBE_MAP:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_GPU_MIPMAP_COMPLETE:kotlin.Long` - `https://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer.html#USAGE_FRONT_BUFFER:kotlin.Long` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/hardware/camera2/MultiResolutionImageReader.Builder#` | the Builder instance with customized usage value. This value cannot be `null`. |