ImageUtil.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // ImageUtil.h
  3. // kneet2
  4. //
  5. // Created by Jason Lee on 10/15/15.
  6. // Copyright © 2015 ntels. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @protocol ImageUtilDelegate <NSObject>
  10. @optional
  11. - (void)didFinishPickingImage:(UIImage *)image;
  12. @end
  13. @interface ImageUtil : NSObject
  14. #pragma mark - properties
  15. @property (weak, nonatomic) id <ImageUtilDelegate> delegate;
  16. #pragma mark - instance methos
  17. - (void)prepareImagePicker:(UIViewController *)vc;
  18. #pragma mark - class methods
  19. /**
  20. 해당 컬러의 이미지 객체를 생성
  21. @param color
  22. @return UIImage 이미지 객체
  23. */
  24. + (UIImage *)imageWithColor:(UIColor *)color height:(CGFloat)height;
  25. + (CGFloat)getImageAspectRatio:(UIImage *)image;
  26. + (UIImage *)resizeImage:(UIImage *)image width:(float)resizeWidth height:(float)resizeHeight;
  27. + (UIImage *)resizeImage:(UIImage *)image width:(float)resizeWidth;
  28. + (UIImage *)resizeImage:(UIImage *)image height:(float)resizeHeight;
  29. + (CGRect)convertCropRect:(CGRect)cropRect image:(UIImage *)image;
  30. + (UIImage *)croppedImage:(CGRect)cropRect image:(UIImage *)image;
  31. + (UIImage *)resizeImage:(UIImage *)image size:(CGSize)size imageOrientation:(UIImageOrientation)imageOrientation;
  32. + (UIImage *)getMaskedImageWithSourchImage:(UIImage *)srcImage andMaskImage:(UIImage *)maskImage;
  33. + (UIImage *)imageToGrayScale:(UIImage *)image;
  34. + (UIImage *)stretchedImage:(UIImage *)srcImage expectSize:(CGSize)size;
  35. + (UIImage*)resizableImageWithCapInsets:(UIEdgeInsets)make resizingMode:(UIImageResizingMode)resizingMode img:(UIImage *)img;
  36. @end