mirror of
https://github.com/danog/Telegram.git
synced 2024-12-03 09:57:46 +01:00
51 lines
834 B
Objective-C
51 lines
834 B
Objective-C
#import "TGImageBasedPasscodeBackground.h"
|
|
|
|
#import "TGImageBlur.h"
|
|
|
|
@interface TGImageBasedPasscodeBackground ()
|
|
{
|
|
CGSize _size;
|
|
UIImage *_backgroundImage;
|
|
UIImage *_foregroundImage;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation TGImageBasedPasscodeBackground
|
|
|
|
- (instancetype)initWithSize:(CGSize)size
|
|
{
|
|
return [self initWithImage:nil size:size];
|
|
}
|
|
|
|
- (instancetype)initWithImage:(UIImage *)image size:(CGSize)size
|
|
{
|
|
self = [super init];
|
|
if (self != nil)
|
|
{
|
|
_size = size;
|
|
|
|
NSArray *images = TGBlurredBackgroundImages(image, size);
|
|
_backgroundImage = images[0];
|
|
_foregroundImage = images[1];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (CGSize)size
|
|
{
|
|
return _size;
|
|
}
|
|
|
|
- (UIImage *)backgroundImage
|
|
{
|
|
return _backgroundImage;
|
|
}
|
|
|
|
- (UIImage *)foregroundImage
|
|
{
|
|
return _foregroundImage;
|
|
}
|
|
|
|
@end
|