-
Notifications
You must be signed in to change notification settings - Fork 0
/
DesignLibaryModel.m
34 lines (28 loc) · 1.24 KB
/
DesignLibaryModel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// DesignLibaryModel.m
// Blue Canary
//
// Created by Crae Sosa on 10/29/13.
#import "DesignLibaryModel.h"
@implementation DesignLibaryModel
- (UIImage*) blur:(UIImage*)image{
// create our blurred image
CIContext *context = [CIContext contextWithOptions:nil];
CIImage *inputImage = [CIImage imageWithCGImage:image.CGImage];
// setting up Gaussian Blur (we could use one of many filters offered by Core Image)
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];
[filter setValue:inputImage forKey:kCIInputImageKey];
[filter setValue:[NSNumber numberWithFloat:15.0f] forKey:@"inputRadius"];
CIImage *result = [filter valueForKey:kCIOutputImageKey];
// this ensures it matches up exactly to the bounds of our original image
CGImageRef cgImage = [context createCGImage:result fromRect:[inputImage extent]];
return [UIImage imageWithCGImage:cgImage];
}
-(void) transitionView:(UIView *)view isHidden:(BOOL)isHidden{
[UIView transitionWithView:view duration:0.5 options:UIViewAnimationOptionTransitionFlipFromRight animations:NULL completion:NULL];
view.hidden = isHidden;
}
-(void) setFonts:(UILabel *)label{
[label setFont:[UIFont fontWithName:@"Roboto-Light" size:label.font.pointSize]];
}
@end