Giter Club home page Giter Club logo

blurryandroid's Introduction

Blurr 🌁 Easy Blur and Tools Library

Simple and quick solution for blurred bitmaps.

Kotlin Version License version

Async or Sync, you can quickly blur your images. The library supports Bitmap, Drawable and CustomViews. You have the opportunity to use the necessary libraries separately. If you encounter an error or problem, please open a issue. It will be fixed as soon as possible. ⚡

Features

  • Kotlin
  • Rx3
  • CustomView to Bitmap (usefull for markers - osm and gmap)
  • Blurred Bitmaps
  • Drawable to Bitmap
  • Application Variants

General Usage

/**
* @param bitmapScale should be 0-1f -> small values for more blur
* @param blurRadius should be 0-25f -> bigger values for more blur
*
* @exception RSIllegalArgumentException Radius out of range (0 < r <= 25)
* @exception NullPointerException void android.graphics.Bitmap.setHasAlpha(boolean)
**/   

 fun applyRules(bitmapScale: Float, blurRadius: Float): Blurr {
   bS = bitmapScale
   bR = blurRadius
   return this
}

Convert Drawable to Blurred Bitmap (async)

Blurr.get(this)
     .applyRules(bS, bR)
     .into(resources.getDrawable(R.drawable.test_image), imageViewTrial) //async

Convert Drawable to Blurred Bitmap (sync)

val bitmap2 = Blurr
        .get(this)
        .applyRules(bS, bR)
        .solution(resources.getDrawable(R.drawable.test_image))

Convert View Blurred Bitmap (async)

Blurr.get(this)
     .applyRules(bS, bR)
     .into(view, imageViewTrial) //async

Convert View Blurred Bitmap (sync)

val bitmap1 = Blurr
        .get(this)
        .applyRules(bS, bR)
        .solution(view)

Convert Bitmap to Blurred Bitmap (async)

Blurr.get(this)
     .applyRules(bS, bR)
     .into(bitmap!!, imageViewTrial) //async

Convert Bitmap to Blurred Bitmap (sync)

val bitmap3 = Blurr
       .get(this)
       .applyRules(bS, bR)
       .solution(bitmap!!)

Tools: Bitmap From Custom Views

 val bitmap4 = Blurr
        .getTools()
        .bitmapFromCustomView(view)

Tools: Bitmap From Drawable

val bitmap5 = Blurr
        .getTools()
        .bitmapFromDrawable(resources.getDrawable(R.drawable.test_image))

Implementation Gradle

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.AsynctaskCoffee:BlurryAndroid:beta-0.1'
}

Implementation Maven

Add the JitPack repository to your build file
<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>
Add the dependency
<dependency>
	<groupId>com.github.AsynctaskCoffee</groupId>
	<artifactId>BlurryAndroid</artifactId>
	<version>beta-0.1</version>
</dependency>

License

Copyright 2020 Egemen ÖZOGUL

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

blurryandroid's People

Contributors

asynctaskcoffee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.