//
//  ImageUtil.h
//  kneet2
//
//  Created by Jason Lee on 10/15/15.
//  Copyright © 2015 ntels. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol ImageUtilDelegate <NSObject>

@optional
- (void)didFinishPickingImage:(UIImage *)image;

@end

@interface ImageUtil : NSObject

#pragma mark - properties
@property (weak, nonatomic) id <ImageUtilDelegate> delegate;

#pragma mark - instance methos
- (void)prepareImagePicker;

#pragma mark - class methods
/**
 해당 컬러의 이미지 객체를 생성
 @param color
 @return UIImage 이미지 객체
 */
+ (UIImage *)imageWithColor:(UIColor *)color height:(CGFloat)height;
+ (CGFloat)getImageAspectRatio:(UIImage *)image;
+ (UIImage *)resizeImage:(UIImage *)image width:(float)resizeWidth height:(float)resizeHeight;
+ (UIImage *)resizeImage:(UIImage *)image width:(float)resizeWidth;
+ (UIImage *)resizeImage:(UIImage *)image height:(float)resizeHeight;
+ (CGRect)convertCropRect:(CGRect)cropRect image:(UIImage *)image;
+ (UIImage *)croppedImage:(CGRect)cropRect image:(UIImage *)image;
+ (UIImage *)resizeImage:(UIImage *)image size:(CGSize)size imageOrientation:(UIImageOrientation)imageOrientation;
+ (UIImage *)getMaskedImageWithSourchImage:(UIImage *)srcImage andMaskImage:(UIImage *)maskImage;
+ (UIImage *)imageToGrayScale:(UIImage *)image;
+ (UIImage *)stretchedImage:(UIImage *)srcImage expectSize:(CGSize)size;
+ (UIImage*)resizableImageWithCapInsets:(UIEdgeInsets)make resizingMode:(UIImageResizingMode)resizingMode img:(UIImage *)img;

@end
