public final class

ScaleAndRotateTransformation.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.effect.ScaleAndRotateTransformation.Builder

Overview

A builder for ScaleAndRotateTransformation instances.

Summary

Constructors
publicBuilder()

Creates a builder with default values.

Methods
public ScaleAndRotateTransformationbuild()

public ScaleAndRotateTransformation.BuildersetRotationDegrees(float rotationDegrees)

Sets the counterclockwise rotation degrees.

public ScaleAndRotateTransformation.BuildersetScale(float scaleX, float scaleY)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a builder with default values.

Methods

public ScaleAndRotateTransformation.Builder setScale(float scaleX, float scaleY)

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: The multiplier by which the frame will scale horizontally, along the x-axis.
scaleY: The multiplier by which the frame will scale vertically, along the y-axis.

Returns:

This builder.

public ScaleAndRotateTransformation.Builder setRotationDegrees(float rotationDegrees)

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: The counterclockwise rotation, in degrees.

Returns:

This builder.