AlphaScale
@UnstableApi
public final class AlphaScale implements GlEffect
Scales the alpha value (i.e. the translucency) of a frame.
Summary
Public constructors |
|---|
AlphaScale(@FloatRange(from = 0) float alphaScale)Creates a new instance to scale the entire frame's alpha values by |
Public methods |
|
|---|---|
boolean |
isNoOp(int inputWidth, int inputHeight)Returns whether a |
AlphaScaleShaderProgram |
toGlShaderProgram(Context context, boolean useHdr)Returns a |
Inherited methods |
||
|---|---|---|
|
Public constructors
AlphaScale
public AlphaScale(@FloatRange(from = 0) float alphaScale)
Creates a new instance to scale the entire frame's alpha values by alphaScale, to modify translucency.
An alphaScale value of 1 means no change is applied. A value below 1 increases translucency, and a value above 1 reduces translucency.
Public methods
isNoOp
public boolean isNoOp(int inputWidth, int inputHeight)
Returns whether a GlEffect applies no change at every timestamp.
This can be used as a hint to skip this instance.
| Parameters | |
|---|---|
int inputWidth |
The input frame width, in pixels. |
int inputHeight |
The input frame height, in pixels. |
toGlShaderProgram
public AlphaScaleShaderProgram toGlShaderProgram(Context context, boolean useHdr)
Returns a GlShaderProgram that applies the effect.
| Parameters | |
|---|---|
Context context |
A |
boolean useHdr |
Whether input textures come from an HDR source. If |
| Throws | |
|---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while creating the |