# ViewfinderSurfaceRequest

Artifact: [androidx.camera.viewfinder:viewfinder-core](https://developer.android.com/jetpack/androidx/releases/camera-viewfinder) [View Source](https://cs.android.com/search?q=file:androidx/camera/viewfinder/core/ViewfinderSurfaceRequest.kt+class:androidx.camera.viewfinder.core.ViewfinderSurfaceRequest) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/camera-viewfinder#1.5.0)

*** ** * ** ***


```
class ViewfinderSurfaceRequest
```

<br />

*** ** * ** ***

The request to get an `https://developer.android.com/reference/android/view/Surface.html` to display viewfinder input.

This request contains requirements for the surface resolution and viewfinder input and output information.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#ViewfinderSurfaceRequest(kotlin.Int,kotlin.Int,androidx.camera.viewfinder.core.ImplementationMode,kotlin.String)( width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, implementationMode: https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ImplementationMode?, requestId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` Creates a new surface request with given resolution, and optional implementation mode request ID. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#copy(kotlin.Int,kotlin.Int,androidx.camera.viewfinder.core.ImplementationMode,kotlin.String)( width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, implementationMode: https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ImplementationMode?, requestId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` Creates a copy of this viewfinder surface request, allowing named properties to be altered while keeping the rest unchanged. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#height()` The requested surface height. |
| `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ImplementationMode?` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#implementationMode()` The `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ImplementationMode` to apply to the viewfinder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#requestId()` An optional request ID to allow requests to be differentiated via `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#equals(kotlin.Any)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#width()` The requested surface width. |

## Public constructors

### ViewfinderSurfaceRequest

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

```
ViewfinderSurfaceRequest(
    width: Int,
    height: Int,
    implementationMode: ImplementationMode? = null,
    requestId: String? = null
)
```

Creates a new surface request with given resolution, and optional implementation mode request ID.

## Public functions

### copy

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

```
fun copy(
    width: Int = this.width,
    height: Int = this.height,
    implementationMode: ImplementationMode? = this.implementationMode,
    requestId: String? = this.requestId
): ViewfinderSurfaceRequest
```

Creates a copy of this viewfinder surface request, allowing named properties to be altered while keeping the rest unchanged.

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### height

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

```
val height: Int
```

The requested surface height.

### implementationMode

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

```
val implementationMode: ImplementationMode?
```

The `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ImplementationMode` to apply to the viewfinder. Defaults to `null`, which will use the viewfinder's default implementation mode.

### requestId

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

```
val requestId: String?
```

An optional request ID to allow requests to be differentiated via `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#equals(kotlin.Any)`. Defaults to `null`.

### width

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

```
val width: Int
```

The requested surface width.