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

# QpOffsetRect

*** ** * ** ***

```
class QpOffsetRect
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.media.MediaFormat.QpOffsetRect](https://developer.android.com/reference/kotlin/android/media/MediaFormat.QpOffsetRect#) |

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/kotlin/android/media/MediaFormat.QpOffsetRect#QpOffsetRect(android.graphics.Rect,%20kotlin.Int)(contour: https://developer.android.com/reference/kotlin/android/graphics/Rect.html#, qpOffset: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Create a new region of interest with the specified coordinates and qpOffset. |

| Public methods ||
|---|---|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaFormat.QpOffsetRect#flattenToString()()` Returns a a string representation of this `QpOffsetRect`. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaFormat.QpOffsetRect#flattenToString(kotlin.collections.MutableList)(qpOffsetRects: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://developer.android.com/reference/kotlin/android/media/MediaFormat.QpOffsetRect#!>)` Returns a a string representation of the provided `QpOffsetRect` instances. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaFormat.QpOffsetRect#set(android.graphics.Rect,%20kotlin.Int)(contour: https://developer.android.com/reference/kotlin/android/graphics/Rect.html#, qpOffset: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Update the region of interest information with the specified coordinates and qpOffset |

## Public constructors

### QpOffsetRect

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

```
QpOffsetRect(
    contour: Rect, 
    qpOffset: Int)
```

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.

| Parameters ||
|---|---|
| `contour` | [Rect](https://developer.android.com/reference/kotlin/android/graphics/Rect.html#): Rectangle specifying the region of interest. This value cannot be `null`. |
| `qpOffset` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): qpOffset to be used for the blocks in the specified rectangle |

## Public methods

### flattenToString

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

```
fun flattenToString(): String
```

Returns a a string representation of this `QpOffsetRect`.

This is suitable for use as a value associated with the android.media.MediaFormat#PARAMETER_KEY_QP_OFFSET_RECTS key.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | This value cannot be `null`. |

### flattenToString

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

```
static fun flattenToString(qpOffsetRects: MutableList<MediaFormat.QpOffsetRect!>): String
```

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

This is suitable for use as a value associated with the android.media.MediaFormat#PARAMETER_KEY_QP_OFFSET_RECTS key.

| Parameters ||
|---|---|
| `qpOffsetRects` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[MediaFormat.QpOffsetRect](https://developer.android.com/reference/kotlin/android/media/MediaFormat.QpOffsetRect#)!\>: This value cannot be `null`. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | This value cannot be `null`. |

### set

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

```
fun set(
    contour: Rect, 
    qpOffset: Int
): Unit
```

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

| Parameters ||
|---|---|
| `contour` | [Rect](https://developer.android.com/reference/kotlin/android/graphics/Rect.html#): Rectangle specifying the region of interest. This value cannot be `null`. |
| `qpOffset` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): qpOffset to be used for the blocks in the specified rectangle |