UIImage+STCommon.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // UIImage+STCommon.h
  3. // BuguLive
  4. //
  5. // Created by 岳克奎 on 17/3/13.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface UIImage (STCommon)
  10. #pragma mark -获取视频首帧
  11. +(UIImage *)st_thumbnailImageForVideo:(NSURL *)videoURL atTime:(NSTimeInterval)time ;
  12. #pragma mark - 1.0 高斯模糊
  13. #pragma mark - 1.0 高斯模糊
  14. /**
  15. * 高斯模糊 CoreImage Api
  16. * @param image 图片
  17. * @param blur 模糊数值(默认是10)
  18. * @other: Core Image设置模糊之后会在周围产生白边
  19. */
  20. +(UIImage *)coreBlurImage:(UIImage *)image withBlurNumber:(CGFloat)blur;
  21. /**
  22. * 高斯模糊 vImage
  23. * @param image 原始图片
  24. * @param blur 模糊数值(0-1)
  25. * @other: 常用 需要导入:#import <Accelerate/Accelerate.h>
  26. */
  27. +(UIImage *)boxblurImage:(UIImage *)image withBlurNumber:(CGFloat)blur;
  28. #pragma mark -图片加文字
  29. /**
  30. * @brief: 单张图片+一行文字
  31. *
  32. * @parameter: bgImg 背景img
  33. * @parameter: contentStr
  34. * @parameter: strColor
  35. * @parameter: fontSize
  36. * @parameter: contentStrFrame
  37. *
  38. */
  39. #pragma mark -图片加文字
  40. /**
  41. * @brief: 单张图片+一行文字
  42. *
  43. * @parameter: bgImg 背景img
  44. * @parameter: contentStr
  45. * @parameter: strColor
  46. * @parameter: fontSize
  47. * @parameter: contentStrFrame
  48. *
  49. */
  50. +(UIImage *)showBgImge:(UIImage *)bgImg
  51. contentStr:(NSString *)contentStr
  52. strColor:(UIColor *)strColor
  53. contentStrFontSize:(CGFloat)fontSize
  54. strFrame:(CGRect)contentStrFrame;
  55. #pragma mark -图片加文字 2行
  56. /**
  57. * @brief: 单张图片+2行文字
  58. *
  59. *
  60. */
  61. +(UIImage *)showBgImge:(UIImage *)bgImg
  62. contentStr:(NSString *)contentStr
  63. otherStr:(NSString *)otherStr
  64. strColor:(UIColor *)strColor
  65. contentStrFontSize:(CGFloat)fontSize
  66. strFrame:(CGRect)contentStrFrame
  67. otherStrFrame:(CGRect)otherStrFrame;
  68. @end