# ImagePlane

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.ImagePlane) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

*** ** * ** ***


```
public interface ImagePlane extends UnsafeWrapper
```

<br />

Known direct subclasses [FakeImagePlane](https://developer.android.com/reference/androidx/camera/common/testing/FakeImagePlane), [ImageProxy.PlaneProxy](https://developer.android.com/reference/androidx/camera/core/ImageProxy.PlaneProxy)

|---|---|
| `https://developer.android.com/reference/androidx/camera/common/testing/FakeImagePlane` | Fake implementation of `https://developer.android.com/reference/androidx/camera/common/ImagePlane` for testing classes that consume camera image planes. |
| `https://developer.android.com/reference/androidx/camera/core/ImageProxy.PlaneProxy` | A plane proxy which has an analogous interface as `https://developer.android.com/reference/android/media/Image.Plane.html`. |

*** ** * ** ***

A wrapper interface that mirrors `https://developer.android.com/reference/android/media/Image.Plane.html`.

Represents a single color plane of image data.

## Summary

| ### Public methods |
|---|---|
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/nio/ByteBuffer.html` | `https://developer.android.com/reference/androidx/camera/common/ImagePlane#getBuffer()()` A `https://developer.android.com/reference/java/nio/ByteBuffer.html` containing the image data for this plane. |
| `abstract int` | `https://developer.android.com/reference/androidx/camera/common/ImagePlane#getPixelStride()()` The pixel stride, in bytes. |
| `abstract int` | `https://developer.android.com/reference/androidx/camera/common/ImagePlane#getRowStride()()` The row stride, in bytes. |

### Inherited methods

From [androidx.camera.common.UnsafeWrapper](https://developer.android.com/reference/androidx/camera/common/UnsafeWrapper) `abstract T` `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull 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.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

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

A `https://developer.android.com/reference/java/nio/ByteBuffer.html` containing the image data for this plane.

The buffer's position will be set to the start of the plane data, and its limit will be set to the end of the plane data.

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

### getPixelStride

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

```
abstract int getPixelStride()
```

The pixel stride, in bytes.

This is the distance between two consecutive pixel values in a row of the image buffer.

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

### getRowStride

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

```
abstract int getRowStride()
```

The row stride, in bytes.

This is the distance between the start of two consecutive rows of pixels in the image buffer.

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