# MutableImageWrapper

Artifact: [androidx.camera:camera-common](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/common/ImageWrapper.kt+class:androidx.camera.common.MutableImageWrapper) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

*** ** * ** ***


```
interface MutableImageWrapper : ImageWrapper
```

<br />

Known direct subclasses [FakeImage](https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeImage)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeImage` | Fake implementation of `https://developer.android.com/reference/kotlin/androidx/camera/common/MutableImageWrapper` for testing. |

*** ** * ** ***

A mutable extension of `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper` that allows modifying properties of the image.

This interface is useful when modifying the metadata of an image, such as its crop rectangle, timestamp, or synchronization fence.

## Summary

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/MutableImageWrapper#cropRect()` The crop rectangle of the image. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/MutableImageWrapper#dataSpace()` The dataspace associated with this image. |
| `https://developer.android.com/reference/android/hardware/SyncFence.html?` | `https://developer.android.com/reference/kotlin/androidx/camera/common/MutableImageWrapper#syncFence()` The sync fence associated with this image, or `null` if there is no fence. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/MutableImageWrapper#timestamp()` The timestamp associated with this image, in nanoseconds. |

### Inherited functions

From [androidx.camera.common.ImageWrapper](https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper#close()()`

Closes the underlying image and releases any associated resources.
From [androidx.camera.common.UnsafeWrapper](https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper) `T?` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)(type: https://developer.android.com/reference/java/lang/Class.html<T>)`

Attempts to unwrap this object into the specified underlying `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`.

### Inherited properties

From [androidx.camera.common.ImageWrapper](https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper#format()`

The format of the image.
`open https://developer.android.com/reference/android/hardware/HardwareBuffer.html?` `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper#hardwareBuffer()`

The handle to the underlying image's hardware buffer, or `null` if this image does not support hardware buffers.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper#height()`

The height of the image in pixels.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/ImagePlane>` `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper#imagePlanes()`

The list of pixel planes for this image.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageWrapper#width()`

The width of the image in pixels.

## Public properties

### cropRect

```
var cropRect: Rect
```

The crop rectangle of the image.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/Image.html#setCropRect(android.graphics.Rect)` |   |

### dataSpace

```
var dataSpace: Int
```

The dataspace associated with this image.

The value set must be one of the constants defined in `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageDataSpace`.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/Image.html#setDataSpace(int)` |   |
| `https://developer.android.com/reference/kotlin/androidx/camera/common/ImageDataSpace` |   |

### syncFence

```
var syncFence: SyncFence?
```

The sync fence associated with this image, or `null` if there is no fence.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/Image.html#setFence(android.hardware.SyncFence)` |   |

### timestamp

```
var timestamp: Long
```

The timestamp associated with this image, in nanoseconds.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/Image.html#setTimestamp(long)` |   |