# 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)

*** ** * ** ***


```
public interface ImageProxy.PlaneProxy extends ImagePlane
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/nio/ByteBuffer.html` | `https://developer.android.com/reference/androidx/camera/core/ImageProxy.PlaneProxy#getBuffer()()` Returns the pixels buffer. |
| `abstract int` | `https://developer.android.com/reference/androidx/camera/core/ImageProxy.PlaneProxy#getPixelStride()()` Returns the pixel stride. |
| `abstract int` | `https://developer.android.com/reference/androidx/camera/core/ImageProxy.PlaneProxy#getRowStride()()` Returns the row stride. |
| `default @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html T` | `<T> https://developer.android.com/reference/androidx/camera/core/ImageProxy.PlaneProxy#unwrapAs(java.lang.Class<T>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Class.html<T> type)` Attempts to unwrap this object into the specified underlying `https://developer.android.com/reference/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`. |

## Public methods

### getBuffer

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

```
abstract @NonNull ByteBuffer getBuffer()
```

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)

```
abstract int getPixelStride()
```

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)

```
abstract int getRowStride()
```

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)

```
default @Nullable T <T> unwrapAs(@NonNull Class<T> type)
```

Attempts to unwrap this object into the specified underlying `https://developer.android.com/reference/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/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. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Class.html<T> type` | The `https://developer.android.com/reference/java/lang/Class.html` representing the expected type of the underlying object. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html T` | The underlying object cast to `https://developer.android.com/reference/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`, or `null` if the object cannot be unwrapped into the requested `https://developer.android.com/reference/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`. |