GaussianBlurWithFrameOverlaid
@UnstableApi
public final class GaussianBlurWithFrameOverlaid extends SeparableConvolution
| java.lang.Object | ||
| ↳ | androidx.media3.effect.SeparableConvolution | |
| ↳ | androidx.media3.effect.GaussianBlurWithFrameOverlaid |
A SeparableConvolution to apply a Gaussian blur on image data.
The width of the blur is specified in pixels and applied symmetrically.
Summary
Public constructors |
|---|
GaussianBlurWithFrameOverlaid(Creates an instance with |
GaussianBlurWithFrameOverlaid(Creates an instance. |
Public methods |
|
|---|---|
ConvolutionFunction1D |
getConvolution(long presentationTimeUs)Returns a |
GlShaderProgram |
toGlShaderProgram(Context context, boolean useHdr)Returns a |
Inherited methods |
||
|---|---|---|
|
||
Public constructors
GaussianBlurWithFrameOverlaid
public GaussianBlurWithFrameOverlaid(
float sigma,
float scaleSharpX,
float scaleSharpY
)
Creates an instance with numStandardDeviations set to 2.0f.
| Parameters | |
|---|---|
float sigma |
The half-width of 1 standard deviation, in pixels. |
float scaleSharpX |
The scaling factor used to determine the size of the sharp image in the output frame relative to the whole output frame in the horizontal direction. |
float scaleSharpY |
The scaling factor used to determine the size of the sharp image in the output frame relative to the whole output frame in the vertical direction. |
GaussianBlurWithFrameOverlaid
public GaussianBlurWithFrameOverlaid(
@FloatRange(from = 0.0, fromInclusive = false) float sigma,
@FloatRange(from = 0.0, fromInclusive = false) float numStandardDeviations,
float scaleSharpX,
float scaleSharpY
)
Creates an instance.
| Parameters | |
|---|---|
@FloatRange(from = 0.0, fromInclusive = false) float sigma |
The half-width of 1 standard deviation, in pixels. |
@FloatRange(from = 0.0, fromInclusive = false) float numStandardDeviations |
The size of function domain, measured in the number of standard deviations. |
float scaleSharpX |
The scaling factor used to determine the size of the sharp image in the output frame relative to the whole output frame in the horizontal direction. |
float scaleSharpY |
The scaling factor used to determine the size of the sharp image in the output frame relative to the whole output frame in the vertical direction. |
Public methods
getConvolution
public ConvolutionFunction1D getConvolution(long presentationTimeUs)
Returns a 1D convolution function.
| Parameters | |
|---|---|
long presentationTimeUs |
The presentation timestamp of the input frame, in microseconds. |
toGlShaderProgram
public GlShaderProgram 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 |