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

*** ** * ** ***


```
public final 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/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#ViewfinderSurfaceRequest(kotlin.Int,kotlin.Int,androidx.camera.viewfinder.core.ImplementationMode,kotlin.String)( int width, int height, https://developer.android.com/reference/androidx/camera/viewfinder/core/ImplementationMode implementationMode, https://developer.android.com/reference/java/lang/String.html requestId )` Creates a new surface request with given resolution, and optional implementation mode request ID. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final int` | `https://developer.android.com/reference/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#getHeight()()` The requested surface height. |
| `final https://developer.android.com/reference/androidx/camera/viewfinder/core/ImplementationMode` | `https://developer.android.com/reference/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#getImplementationMode()()` The `https://developer.android.com/reference/androidx/camera/viewfinder/core/ImplementationMode` to apply to the viewfinder. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#getRequestId()()` An optional request ID to allow requests to be differentiated via `https://developer.android.com/reference/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#equals(kotlin.Any)`. |
| `final int` | `https://developer.android.com/reference/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#getWidth()()` The requested surface width. |
| `int` | `https://developer.android.com/reference/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest#toString()()` |

## Public constructors

### ViewfinderSurfaceRequest

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

```
public ViewfinderSurfaceRequest(
    int width,
    int height,
    ImplementationMode implementationMode,
    String requestId
)
```

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

## Public methods

### equals

```
public boolean equals(Object other)
```

### getHeight

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

```
public final int getHeight()
```

The requested surface height.

### getImplementationMode

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

```
public final ImplementationMode getImplementationMode()
```

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

### getRequestId

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

```
public final String getRequestId()
```

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

### getWidth

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

```
public final int getWidth()
```

The requested surface width.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```