# ScaleAndRotateTransformation.Builder

Artifact: [androidx.media3:media3-effect](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/effect/ScaleAndRotateTransformation.java+class:androidx.media3.effect.ScaleAndRotateTransformation.Builder)

*** ** * ** ***


```
class ScaleAndRotateTransformation.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation` instances.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation.Builder#Builder()()` Creates a builder with default values. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation.Builder#build()()` |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation.Builder#setRotationDegrees(float)(rotationDegrees: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the counterclockwise rotation degrees. |
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation.Builder#setScale(float,float)(scaleX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, scaleY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the x and y axis scaling factors to apply to each frame's width and height. |

## Public constructors

### Builder

```
Builder()
```

Creates a builder with default values.

## Public functions

### build

```
fun build(): ScaleAndRotateTransformation!
```

### setRotationDegrees

```
@CanIgnoreReturnValue
fun setRotationDegrees(rotationDegrees: Float): ScaleAndRotateTransformation.Builder!
```

Sets the counterclockwise rotation degrees.

The default value, 0, corresponds to not applying any rotation.

The output frame's width and height are adjusted to preserve all input pixels. The rotated input frame is fitted inside an enclosing black rectangle if its edges aren't parallel to the x and y axes, to form the output frame.

| Parameters |
|---|---|
| `rotationDegrees: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The counterclockwise rotation, in degrees. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation.Builder!` | This builder. |

### setScale

```
@CanIgnoreReturnValue
fun setScale(scaleX: Float, scaleY: Float): ScaleAndRotateTransformation.Builder!
```

Sets the x and y axis scaling factors to apply to each frame's width and height.

The values default to 1, which corresponds to not scaling along both axes.

| Parameters |
|---|---|
| `scaleX: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The multiplier by which the frame will scale horizontally, along the x-axis. |
| `scaleY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The multiplier by which the frame will scale vertically, along the y-axis. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/ScaleAndRotateTransformation.Builder!` | This builder. |