# CameraAvStreamManagementTrait.ViewportStruct

# CameraAvStreamManagementTrait.ViewportStruct


```
class CameraAvStreamManagementTrait.ViewportStruct : ClusterStruct
```

<br />

*** ** * ** ***

Used as the type for the `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/CameraAvStreamManagementTrait.Attributes#viewport()` attribute, allowing control over which part of the camera's image is being streamed or processed. The viewport is defined as these coordinates:  

(x1,y1) (x2,y1)  
(x1,y2) (x2,y2)

## Summary

| ### Nested types |
|---|
| `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi enum https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/CameraAvStreamManagementTrait.ViewportStruct.StructFields : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/Field` Descriptor enum for this struct's fields. |

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/CameraAvStreamManagementTrait.ViewportStruct#ViewportStruct(kotlin.UShort,kotlin.UShort,kotlin.UShort,kotlin.UShort)(x1: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html, y1: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html, x2: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html, y2: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html)` Creates the ViewportStruct class. |

| ### Public functions |
|---|---|
| `open https://developers.home.google.com/reference/kotlin/com/google/home/StructDescriptor` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/CameraAvStreamManagementTrait.ViewportStruct#getDescriptor()()` Returns the descriptor for the struct. |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/CameraAvStreamManagementTrait.ViewportStruct#getFieldValueById(kotlin.UInt)(tagId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html)` Returns the value of the field for the given tag ID. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/CameraAvStreamManagementTrait.ViewportStruct#x1()` Represents the x-coordinate of the left corners of the viewport. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/CameraAvStreamManagementTrait.ViewportStruct#x2()` Represents the x-coordinate of the right corners of the viewport. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/CameraAvStreamManagementTrait.ViewportStruct#y1()` Represents the y-coordinate of the top corners of the viewport. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-short/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/CameraAvStreamManagementTrait.ViewportStruct#y2()` Represents the y-coordinate of the bottom corners of the viewport. |

## Public constructors

### ViewportStruct

```
ViewportStruct(x1: UShort, y1: UShort, x2: UShort, y2: UShort)
```

Creates the ViewportStruct class.

## Public functions

### getDescriptor

```
@HomeExperimentalGenericApi
open fun getDescriptor(): StructDescriptor
```

Returns the descriptor for the struct.

### getFieldValueById

```
@HomeExperimentalGenericApi
open fun getFieldValueById(tagId: UInt): Any?
```

Returns the value of the field for the given tag ID.

## Public properties

### x1

```
val x1: UShort
```

Represents the x-coordinate of the left corners of the viewport.

### x2

```
val x2: UShort
```

Represents the x-coordinate of the right corners of the viewport.

### y1

```
val y1: UShort
```

Represents the y-coordinate of the top corners of the viewport.

### y2

```
val y2: UShort
```

Represents the y-coordinate of the bottom corners of the viewport.