//
// ImageUtils.h
// MyProject
//
// Created by haibara on 6/19/15.
//
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#define RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI))
#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)

@interface ImageUtils : NSObject
+ (UIImage *)drawImage:(UIImage *)image atRect:(CGRect)rect;
+ (UIImage *)imageWithColor:(UIColor *)fillColor;
+ (UIImage *)imageNamed:(NSString *)name tintColor:(UIColor *)tintColor;
+ (UIImage *)adjustImage:(UIImage *)image tintColor:(UIColor *)tintColor;
+ (UIImage *)cropImage:(UIImage *)image toSize:(CGSize)size;
+ (UIImage *)cropImage:(UIImage *)image inRect:(CGRect)rect;
+ (UIImage *)scaleImage:(UIImage *)image toSize:(CGSize)size;
+ (UIImage *)scaleImage:(UIImage *)image toWidth:(CGFloat)width;
+ (UIImage *)scaleImage:(UIImage *)image toHeight:(CGFloat)height;
+ (UIImage *)scaleImage:(UIImage *)image byFactor:(CGFloat)factor;
+ (UIImage *)scaleCIIImage:(CIImage *)image toSize:(CGSize)size;
+ (UIImage *)scaleSVGImageNamed:(NSString *)name toSize:(CGSize)size;
+ (UIImage *)scaleSVGImageNamed:(NSString *)name byFactor:(CGFloat)factor;
+ (UIImage *)rotateImage:(UIImage *)image byRadians:(CGFloat)radians;
+ (UIImage *)rotateImage:(UIImage *)image byDegrees:(CGFloat)degrees;
+ (UIImage *)xMontageWithImages:(NSArray *)images border:(CGFloat)border;
+ (UIImage *)montageWithImages:(NSArray *)images tile:(CGPoint)tile border:(CGFloat)border;
+ (UIImage *)xMontageWithImages:(NSArray *)images countOfSingleRow:(CGFloat)count border:(CGFloat)border;
+ (UIImage *)snapshotImageWithView:(UIView *)view;
@end
