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

# MediaFormat.QpOffsetRect

*** ** * ** ***


`
public
static
final

class
MediaFormat.QpOffsetRect
`


`

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


`

`


`

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

<br />

*** ** * ** ***

QpOffsetRect constitutes the metadata required for encoding a region of interest in an
image or a video frame. The region of interest is represented by a rectangle. The four
integer coordinates of the rectangle are stored in fields left, top, right, bottom.
Note that the right and bottom coordinates are exclusive.
This is paired with a suggestive qp offset information that is to be used during encoding
of the blocks belonging to the to the box.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/media/MediaFormat.QpOffsetRect#QpOffsetRect(android.graphics.Rect,%20int)(https://developer.android.com/reference/android/graphics/Rect contour, int qpOffset) ` Create a new region of interest with the specified coordinates and qpOffset. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/media/MediaFormat.QpOffsetRect#flattenToString()() ` Returns a a string representation of this `QpOffsetRect`. |
| ` static https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/media/MediaFormat.QpOffsetRect#flattenToString(java.util.List<android.media.MediaFormat.QpOffsetRect>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/media/MediaFormat.QpOffsetRect> qpOffsetRects) ` Returns a a string representation of the provided `QpOffsetRect` instances. |
| ` void` | ` https://developer.android.com/reference/android/media/MediaFormat.QpOffsetRect#set(android.graphics.Rect,%20int)(https://developer.android.com/reference/android/graphics/Rect contour, int qpOffset) ` Update the region of interest information with the specified coordinates and qpOffset |

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

### QpOffsetRect

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

```
public QpOffsetRect (Rect contour, 
                int qpOffset)
```

Create a new region of interest with the specified coordinates and qpOffset. Note: no
range checking is performed, so the caller must ensure that left \>= 0, left \<= right,
top \>= 0 and top \<= bottom. Note that the right and bottom coordinates are exclusive.

<br />

| Parameters ||
|---|---|
| `contour` | `Rect`: Rectangle specifying the region of interest. This value cannot be `null`. <br /> |
| `qpOffset` | `int`: qpOffset to be used for the blocks in the specified rectangle <br /> |

## Public methods

### flattenToString

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

```
public String flattenToString ()
```

Returns a a string representation of this `QpOffsetRect`.

This is suitable for use as a value associated with the
`https://developer.android.com/` key.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### flattenToString

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

```
public static String flattenToString (List<MediaFormat.QpOffsetRect> qpOffsetRects)
```

Returns a a string representation of the provided `QpOffsetRect` instances.

This is suitable for use as a value associated with the
`https://developer.android.com/` key.

<br />

| Parameters ||
|---|---|
| `qpOffsetRects` | `List`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### set

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

```
public void set (Rect contour, 
                int qpOffset)
```

Update the region of interest information with the specified coordinates and qpOffset

<br />

| Parameters ||
|---|---|
| `contour` | `Rect`: Rectangle specifying the region of interest. This value cannot be `null`. <br /> |
| `qpOffset` | `int`: qpOffset to be used for the blocks in the specified rectangle <br /> |