|
| 1 | +// |
| 2 | +// FXBlurView.h |
| 3 | +// |
| 4 | +// Version 1.6.4 |
| 5 | +// |
| 6 | +// Created by Nick Lockwood on 25/08/2013. |
| 7 | +// Copyright (c) 2013 Charcoal Design |
| 8 | +// |
| 9 | +// Distributed under the permissive zlib License |
| 10 | +// Get the latest version from here: |
| 11 | +// |
| 12 | +// https://github.com/nicklockwood/FXBlurView |
| 13 | +// |
| 14 | +// This software is provided 'as-is', without any express or implied |
| 15 | +// warranty. In no event will the authors be held liable for any damages |
| 16 | +// arising from the use of this software. |
| 17 | +// |
| 18 | +// Permission is granted to anyone to use this software for any purpose, |
| 19 | +// including commercial applications, and to alter it and redistribute it |
| 20 | +// freely, subject to the following restrictions: |
| 21 | +// |
| 22 | +// 1. The origin of this software must not be misrepresented; you must not |
| 23 | +// claim that you wrote the original software. If you use this software |
| 24 | +// in a product, an acknowledgment in the product documentation would be |
| 25 | +// appreciated but is not required. |
| 26 | +// |
| 27 | +// 2. Altered source versions must be plainly marked as such, and must not be |
| 28 | +// misrepresented as being the original software. |
| 29 | +// |
| 30 | +// 3. This notice may not be removed or altered from any source distribution. |
| 31 | +// |
| 32 | + |
| 33 | + |
| 34 | +#import <UIKit/UIKit.h> |
| 35 | +#import <QuartzCore/QuartzCore.h> |
| 36 | +#import <Accelerate/Accelerate.h> |
| 37 | + |
| 38 | + |
| 39 | +#pragma GCC diagnostic push |
| 40 | +#pragma GCC diagnostic ignored "-Wobjc-missing-property-synthesis" |
| 41 | + |
| 42 | + |
| 43 | +#import <Availability.h> |
| 44 | +#undef weak_ref |
| 45 | +#if __has_feature(objc_arc) && __has_feature(objc_arc_weak) |
| 46 | +#define weak_ref weak |
| 47 | +#else |
| 48 | +#define weak_ref unsafe_unretained |
| 49 | +#endif |
| 50 | + |
| 51 | + |
| 52 | +@interface UIImage (FXBlurView) |
| 53 | + |
| 54 | +- (UIImage *)blurredImageWithRadius:(CGFloat)radius iterations:(NSUInteger)iterations tintColor:(UIColor *)tintColor; |
| 55 | + |
| 56 | +@end |
| 57 | + |
| 58 | + |
| 59 | +@interface FXBlurView : UIView |
| 60 | + |
| 61 | ++ (void)setBlurEnabled:(BOOL)blurEnabled; |
| 62 | ++ (void)setUpdatesEnabled; |
| 63 | ++ (void)setUpdatesDisabled; |
| 64 | + |
| 65 | +@property (nonatomic, getter = isBlurEnabled) BOOL blurEnabled; |
| 66 | +@property (nonatomic, getter = isDynamic) BOOL dynamic; |
| 67 | +@property (nonatomic, assign) NSUInteger iterations; |
| 68 | +@property (nonatomic, assign) NSTimeInterval updateInterval; |
| 69 | +@property (nonatomic, assign) CGFloat blurRadius; |
| 70 | +@property (nonatomic, strong) UIColor *tintColor; |
| 71 | +@property (nonatomic, weak_ref) IBOutlet UIView *underlyingView; |
| 72 | + |
| 73 | +- (void)updateAsynchronously:(BOOL)async completion:(void (^)())completion; |
| 74 | + |
| 75 | +- (void)clearImage; |
| 76 | + |
| 77 | +@end |
| 78 | + |
| 79 | + |
| 80 | +#pragma GCC diagnostic pop |
| 81 | + |
0 commit comments