LanczosResample


@UnstableApi
class LanczosResample : GlEffect


A GlEffect that applies a Lanczos-windowed sinc function when resampling an image. See Filters for Common Resampling Tasks, Ken Turkowski.

The filter rescales images in both dimensions with the same scaling factor.

Summary

Public functions

java-static LanczosResample!
scaleToFit(width: @IntRange(from = 1) Int, height: @IntRange(from = 1) Int)

Creates an instance.

GlShaderProgram!
toGlShaderProgram(context: Context!, useHdr: Boolean)

Returns a GlShaderProgram that applies the effect.

Inherited functions

From androidx.media3.common.Effect
Long

Returns the expected duration of the output stream when the effect is applied given a input durationUs.

From androidx.media3.effect.GlEffect
Boolean
isNoOp(inputWidth: Int, inputHeight: Int)

Returns whether a GlEffect applies no change at every timestamp.

Public functions

scaleToFit

java-static fun scaleToFit(width: @IntRange(from = 1) Int, height: @IntRange(from = 1) Int): LanczosResample!

Creates an instance.

Parameters
width: @IntRange(from = 1) Int

The width inside which the output contents will fit.

height: @IntRange(from = 1) Int

The height inside which the output contents will fit.

toGlShaderProgram

fun toGlShaderProgram(context: Context!, useHdr: Boolean): GlShaderProgram!

Returns a GlShaderProgram that applies the effect.

Parameters
context: Context!

A Context.

useHdr: Boolean

Whether input textures come from an HDR source. If true, colors will be in linear RGB BT.2020. If false, colors will be in linear RGB BT.709.

Throws
androidx.media3.common.VideoFrameProcessingException

If an error occurs while creating the .