Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itenfay/dyfblureffect
快速实现模糊图像,并支持系统 UIVisualEffectView。(Quickly realize blurred image, and support UIVisualEffectView in iOS.)
https://github.com/itenfay/dyfblureffect
blur blur-image blurred-image blurred-images blurring blurring-libraries blurry cocoapods ios objective-c uivisualeffectview
Last synced: about 1 month ago
JSON representation
快速实现模糊图像,并支持系统 UIVisualEffectView。(Quickly realize blurred image, and support UIVisualEffectView in iOS.)
- Host: GitHub
- URL: https://github.com/itenfay/dyfblureffect
- Owner: itenfay
- License: other
- Created: 2019-07-31T15:36:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T14:30:18.000Z (6 months ago)
- Last Synced: 2024-11-19T21:03:04.485Z (about 1 month ago)
- Topics: blur, blur-image, blurred-image, blurred-images, blurring, blurring-libraries, blurry, cocoapods, ios, objective-c, uivisualeffectview
- Language: Objective-C
- Homepage: https://www.jianshu.com/p/2402dd3101cd
- Size: 4.47 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README-en.md
- License: LICENSE
Awesome Lists containing this project
README
[中文版](README.md) | **English Version**
If this can help you, please give it a [star](https://github.com/itenfay/DYFBlurEffect), Thanks!
## DYFBlurEffect
We can use `DYFBlurEffect` to quickly realize blurred image, and support `UIVisualEffectView` in iOS.
[![License MIT](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE)
[![CocoaPods](http://img.shields.io/cocoapods/v/DYFBlurEffect.svg?style=flat)](http://cocoapods.org/pods/DYFBlurEffect)
![CocoaPods](http://img.shields.io/cocoapods/p/DYFBlurEffect.svg?style=flat)## Group (ID:614799921)
## Installation
Using [CocoaPods](https://cocoapods.org):
```
pod 'DYFBlurEffect'
```Or
```
pod 'DYFBlurEffect', '~> 2.1.1'
```## Preview
## Usage
- Instantiation
```
// Lazy load
- (DYFBlurEffect *)blurEffect {
if (!_blurEffect) {
_blurEffect = [[DYFBlurEffect alloc] init];
}
return _blurEffect;
}
```- Using CoreGraphics and vImage
```
// Uses a `DYFBlurEffectStyle` style.
self.imgView.image = [self.blurEffect blurryImage:image style:DYFBlurEffectLight];// Tints with a color.
self.imgView.image = [self.blurEffect blurryImage:image tintColor:[UIColor colorWithRed:40/255.0 green:40/255.0 blue:40/255.0 alpha:1]];
``````
/**
Blur out an image with an original image, a blur radius, tint with a color, a saturation delta factor and a mask image.
*/
- (UIImage *)blurryImage:(UIImage *)image blurRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage;
```- Using UIVisualEffectView (Available iOS 8.0 or later)
```
UIVisualEffectView *blurView = [self.blurEffect blurViewWithStyle:UIBlurEffectStyleLight];
blurView.frame = self.imgView.bounds;
//blurView.tag = 10;
//blurView.userInteractionEnabled = YES;
[self.view addSubview:blurView];
```- Using CoreImage
```
self.imgView.image = [self.blurEffect coreImage:image blurRadius:10];
```## Sample
To learn more, plaease go [here](https://github.com/itenfay/DYFBlurEffect/blob/master/Basic%20Files/ViewController.m).