-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathGcImagePickerUtils.h
32 lines (29 loc) · 1.73 KB
/
GcImagePickerUtils.h
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
// By: @MrGcGamer
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIKit.h>
typedef NS_CLOSED_ENUM(NSUInteger, ImageSizingMode) {
kSizingModeMin,
kSizingModeMax
};
typedef struct {
ImageSizingMode sizingMode;
CGFloat size;
CGFloat scale;
} ImageSizingConfig;
@interface GcImagePickerUtils : NSObject
+ (UIImage *)imageFromDefaults:(NSString *)defaults withKey:(NSString *)key ;
+ (UIImage *)imageFromDefaults:(NSString *)defaults withKey:(NSString *)key error:(NSError **)error ;
+ (UIImage *)thumbnailFromDefaults:(NSString *)defaults withKey:(NSString *)key forSizingMode:(ImageSizingMode)sizingMode ;
+ (UIImage *)thumbnailFromDefaults:(NSString *)defaults withKey:(NSString *)key forConfig:(ImageSizingConfig)sizingConfig ;
+ (UIImage *)thumbnailFromDefaults:(NSString *)defaults withKey:(NSString *)key maxSize:(CGFloat)maxSize scale:(CGFloat)scale ;
+ (UIImage *)thumbnailFromDefaults:(NSString *)defaults withKey:(NSString *)key minSize:(CGFloat)minSize scale:(CGFloat)scale ;
+ (UIImage *)thumbnailForURL:(NSURL *)url withConfig:(ImageSizingConfig)config ;
+ (UIImage *)thumbnailForURL:(NSURL *)url maxSize:(CGFloat)maxSize scale:(CGFloat)scale ;
+ (UIImage *)thumbnailForURL:(NSURL *)url minSize:(CGFloat)minSize scale:(CGFloat)scale ;
+ (NSData *)dataFromDefaults:(NSString *)defaults withKey:(NSString *)key ;
+ (NSData *)dataFromDefaults:(NSString *)defaults withKey:(NSString *)key error:(NSError **)error ;
+ (NSURL *)videoURLFromDefaults:(NSString *)defaults withKey:(NSString *)key ;
+ (BOOL)isVideoInDefaults:(NSString *)defaults withKey:(NSString *)key ;
+ (BOOL)isImageInDefaults:(NSString *)defaults withKey:(NSString *)key ;
+ (BOOL)setImage:(UIImage *)image forDefaults:(NSString *)defaults withKey:(NSString *)key png:(BOOL)png ;
@end