# ImageProxy.PlaneProxy

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/ImageProxy.java+class:androidx.camera.core.ImageProxy.PlaneProxy) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

*** ** * ** ***


```
interface ImageProxy.PlaneProxy : ImagePlane
```

<br />

*** ** * ** ***

A plane proxy which has an analogous interface as `https://developer.android.com/reference/android/media/Image.Plane.html`.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/java/nio/ByteBuffer.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy.PlaneProxy#getBuffer()()` Returns the pixels buffer. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy.PlaneProxy#getPixelStride()()` Returns the pixel stride. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy.PlaneProxy#getRowStride()()` Returns the row stride. |
| `T?` | `<T> https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy.PlaneProxy#unwrapAs(java.lang.Class<T>)(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)`. |

## Public functions

### getBuffer

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

```
fun getBuffer(): ByteBuffer
```

Returns the pixels buffer.

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

### getPixelStride

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

```
fun getPixelStride(): Int
```

Returns the pixel stride.

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

### getRowStride

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

```
fun getRowStride(): Int
```

Returns the row stride.

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

### unwrapAs

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
fun <T> unwrapAs(type: Class<T!>): T?
```

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

Callers should use this method to retrieve the wrapped platform object.

### Implementation Notes

- If the requested `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)` is not supported by this wrapper, this method must return `null`.

- Implementations designed for testing (e.g., fakes, mocks, or no-op wrappers) should return `null` to signal that no real underlying object is available.

| Parameters |
|---|---|
| `<T>` | The expected type of the underlying object. |
| `type: https://developer.android.com/reference/java/lang/Class.html<T!>` | The `https://developer.android.com/reference/java/lang/Class.html` representing the expected type of the underlying object. |

| Returns |
|---|---|
| `T?` | The underlying object cast to `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`, or `null` if the object cannot be unwrapped into the requested `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`. |