Native-Blur
The Native-Blur is a C++/Kotlin libraray for blur bitmaps and activity, mobile-ready, android compatible, powered by Java Native Interface(JNI) library for Android.
Demo application .apk file
Features
- Blur bitmap and resourses
- Blure activty
- Compress
Usage
For blur the Activty:
val overlayBlurView = OverlayBlurView(activity)
overlayBlurView.show()
overlayBlurView.hide()
With Xml support view:
<me.abolfazl.nativeblur.BlurView
android:layout_width="match_parent"
android:layout_height="march_parent"
android:scaleType="centerCrop"
android:src="@drawable/spacex"
app:compress="true"
app:radius="20" />
Directly Bitmap:
val source = BitmapFactory.decodeResource(resources, R.drawable.spacex2)
val bitmap = NativeBlur.blurBitmap(source, 10, false)
imageview.setImageDrawable(BitmapDrawable(resources, bitmap))
Installation
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
implementation 'com.github.aabolfazl:Native-Blur:1.0.0'
}
Images
benchmark
Memory allocation and Heap limit size for an application(in Java program throws an exception but in C++ done successfully)
Developed by
- Abolfazl Abbasi @0x40x4
Reference
- Stack Blur Algorithm by Mario Klingemann
- Telegram open source project
SpaceX Image from @Daniel Sanchez Photography
License
MIT
Free Software developed for Teknasyon Üçbüyücü Turnuvası!