Yet another dynamic blur library.
// root build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
// app/build.gradle
repositories {
implementation("com.github.Miha-x64:Lubricant:852f8498f1")
}
Most libraries use RenderScript which shows poor performance to me. Also, most of them use onPreDraw
as invalidation listener catching all invalidations across the window.
In order to apply a post-effect, you need to lubricate Android SDK heavily. Also, in Russian, “blurry” and “lubricated” is the same word, as well as “unclear” or “smooth”.
StackBlur
class provides blurRgb
and blurArgb
methods for applying blur effect to an ARGB_8888
bitmap. For blurArgb
it must be premultiplied which is almost always true.
The Stack Blur Algorithm by Mario Klingemann ported by Yahel Bouaziz found on StackOverflow is used and improved for better speed and less memory consumption.
This class is used to hold a bitmap, and manage downscaling, drawing, and blurring.
A ready-to-use drawable taking image from PostEffectView.
Just drop a PostEffectRecyclerView
into layout and set rv.blurDrawable(…)
as a background for some overlaid view. See MainLayout for examples.
Under construction.
Check out VidEffects library which allows you to apply a shader on a video. This is not enough for quality backdrop effect, so this challenge remains to me.