Package com.google.android.exoplayer2.effect

## Class ScaleToFitTransformation

- java.lang.Object
- - com.google.android.exoplayer2.effect.ScaleToFitTransformation

- All Implemented Interfaces:
    `GlEffect`, `GlMatrixTransformation`, `MatrixTransformation`, `Effect`

      public final class ScaleToFitTransformation
      extends Object
      implements MatrixTransformation

  Specifies a simple rotation and/or scale to apply in the vertex shader.

  All input frames' pixels will be preserved and copied into an output frame, potentially changing the width and height of the frame by scaling dimensions to fit.

  The background color of the output frame will be black, with alpha = 0 if applicable.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `ScaleToFitTransformation.Builder` | A builder for `ScaleToFitTransformation` instances.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Pair<Integer,​Integer>` | `configure​(int inputWidth, int inputHeight)` | Configures the input and output dimensions.
    `Matrix` | `getMatrix​(long presentationTimeUs)` | Returns the 3x3 transformation `Matrix` to apply to the frame with the given timestamp.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.google.android.exoplayer2.effect.GlMatrixTransformation

      `toGlTextureProcessor`

    - ### Methods inherited from interface com.google.android.exoplayer2.effect.MatrixTransformation

      `getGlMatrixArray`

- - ### Method Detail

    - #### configure

          public Pair<Integer,​Integer> configure​(int inputWidth,
                                                       int inputHeight)

      Description copied from interface: `GlMatrixTransformation`
      Configures the input and output dimensions.

      Must be called before `GlMatrixTransformation.getGlMatrixArray(long)`.

      Specified by:
        `configure` in interface `GlMatrixTransformation`
      Parameters:
        `inputWidth` - The input frame width, in pixels.
        `inputHeight` - The input frame height, in pixels.
      Returns:
        The output frame width and height, in pixels.

    - #### getMatrix

          public Matrix getMatrix​(long presentationTimeUs)

      Description copied from interface: `MatrixTransformation`
      Returns the 3x3 transformation `Matrix` to apply to the frame with the given timestamp.
      Specified by:
        `getMatrix` in interface `MatrixTransformation`