Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/media/Image.Plane#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/media/Image.Plane#inhmethods)

# Image.Plane

*** ** * ** ***


`
public
static

abstract
class
Image.Plane
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.Image.Plane |

<br />

*** ** * ** ***

<br />

A single color plane of image data.

The number and meaning of the planes in an Image are determined by the
format of the Image.

Once the Image has been closed, any access to the plane's
ByteBuffer will fail.

<br />

**See also:**

- `https://developer.android.com/reference/android/media/Image#getFormat()`

## Summary

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/java/nio/ByteBuffer` | ` https://developer.android.com/reference/android/media/Image.Plane#getBuffer()() ` <br /> Get a direct `https://developer.android.com/reference/java/nio/ByteBuffer` containing the frame data. |
| ` abstract int` | ` https://developer.android.com/reference/android/media/Image.Plane#getPixelStride()() ` <br /> The distance between adjacent pixel samples, in bytes. |
| ` abstract int` | ` https://developer.android.com/reference/android/media/Image.Plane#getRowStride()() ` <br /> The row stride for this color plane, in bytes. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public methods

### getBuffer

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

```
public abstract ByteBuffer getBuffer ()
```

<br />

Get a direct `https://developer.android.com/reference/java/nio/ByteBuffer`
containing the frame data.

In particular, the buffer returned will always have
`https://developer.android.com/reference/java/nio/ByteBuffer#isDirect()` return `true`, so
the underlying data could be mapped as a pointer in JNI without doing
any copies with `GetDirectBufferAddress`.

For raw formats, each plane is only guaranteed to contain data
up to the last pixel in the last row. In other words, the stride
after the last row may not be mapped into the buffer. This is a
necessary requirement for any interleaved format.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/ByteBuffer` | the byte buffer containing the image data for this plane. <br /> |

### getPixelStride

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

```
public abstract int getPixelStride ()
```

<br />

The distance between adjacent pixel samples, in bytes.

This is the distance between two consecutive pixel values in a row
of pixels. It may be larger than the size of a single pixel to
account for interleaved image data or padded formats.
Note that pixel stride is undefined for some formats such as
`https://developer.android.com/reference/android/graphics/ImageFormat#RAW_PRIVATE`,
and calling getPixelStride on images of these formats will
cause an UnsupportedOperationException being thrown.
For formats where pixel stride is well defined, the pixel stride
is always greater than 0.

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getRowStride

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

```
public abstract int getRowStride ()
```

<br />

The row stride for this color plane, in bytes.

This is the distance between the start of two consecutive rows of
pixels in the image. Note that row stride is undefined for some formats
such as
`https://developer.android.com/reference/android/graphics/ImageFormat#RAW_PRIVATE`,
and calling getRowStride on images of these formats will
cause an UnsupportedOperationException being thrown.
For formats where row stride is well defined, the row stride
is always greater than 0.

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |