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 |
|
|---|---|
Boolean |
Returns whether a applies no change at every timestamp. |
java-static LanczosResample! |
scaleToFit(width: @IntRange(from = 1) Int, height: @IntRange(from = 1) Int)Creates an instance. |
java-static LanczosResample! |
scaleToFitWithFlexibleOrientation(Creates an instance. |
GlShaderProgram! |
toGlShaderProgram(context: Context!, useHdr: Boolean)Returns a |
Inherited functions |
||
|---|---|---|
|
Public functions
isNoOp
fun isNoOp(inputWidth: Int, inputHeight: Int): Boolean
Returns whether a applies no change at every timestamp.
This can be used as a hint to skip this instance.
For scaling factors near 1, this effect applies no change because the Lanczos algorithm won't bring a big improvement over bilinear or nearest sampling using the GPU texture units.
scaleToFit
java-static fun scaleToFit(width: @IntRange(from = 1) Int, height: @IntRange(from = 1) Int): LanczosResample!
Creates an instance.
scaleToFitWithFlexibleOrientation
java-static fun scaleToFitWithFlexibleOrientation(
firstDimension: @IntRange(from = 1) Int,
secondDimension: @IntRange(from = 1) Int
): LanczosResample!
Creates an instance.
The output resolution will be either firstDimension x secondDimension or secondDimension x firstDimension. The longer of firstDimension or secondDimension will have the same orientation as the longer side of the Size passed in to configure.
toGlShaderProgram
fun toGlShaderProgram(context: Context!, useHdr: Boolean): GlShaderProgram!
Returns a GlShaderProgram that applies the effect.
| Parameters | |
|---|---|
context: Context! |
A |
useHdr: Boolean |
Whether input textures come from an HDR source. If |
| Throws | |
|---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while creating the |