HXPhotoEditConfiguration.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // HXPhotoEditConfiguration.h
  3. // photoEditDemo
  4. //
  5. // Created by Silence on 2020/7/6.
  6. // Copyright © 2020 Silence. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "HXPhotoEditChartletModel.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. typedef NS_ENUM(NSUInteger, HXPhotoEditAspectRatio) {
  12. HXPhotoEditAspectRatioType_None, // 不设置比例
  13. HXPhotoEditAspectRatioType_Original, // 原图比例
  14. HXPhotoEditAspectRatioType_1x1,
  15. HXPhotoEditAspectRatioType_3x2,
  16. HXPhotoEditAspectRatioType_4x3,
  17. HXPhotoEditAspectRatioType_5x3,
  18. HXPhotoEditAspectRatioType_15x9,
  19. HXPhotoEditAspectRatioType_16x9,
  20. HXPhotoEditAspectRatioType_16x10,
  21. HXPhotoEditAspectRatioType_Custom // 自定义比例
  22. };
  23. @interface HXPhotoEditConfiguration : NSObject
  24. /// 主题色
  25. @property (strong, nonatomic) UIColor *themeColor;
  26. /// 只要裁剪功能
  27. @property (assign, nonatomic) BOOL onlyCliping;
  28. /// 是否支持旋转
  29. /// 旋转之后会重置编辑的内容
  30. @property (assign, nonatomic) BOOL supportRotation;
  31. /// 不可旋转时支持的方向
  32. @property (assign, nonatomic) UIInterfaceOrientationMask supportedInterfaceOrientations;
  33. #pragma mark - < 画笔相关 >
  34. /// 画笔颜色数组
  35. @property (copy, nonatomic) NSArray<UIColor *> *drawColors;
  36. /// 默认选择的画笔颜色下标
  37. /// 与 drawColors 对应,默认 2
  38. @property (assign, nonatomic) NSInteger defaultDarwColorIndex;
  39. /// 画笔默认宽度为最大宽度的50%
  40. /// 画笔最大宽度
  41. /// 默认 12.f
  42. @property (assign, nonatomic) CGFloat brushLineMaxWidth;
  43. /// 画笔最小宽度
  44. /// 默认 2.f
  45. @property (assign, nonatomic) CGFloat brushLineMinWidth;
  46. #pragma mark - < 贴图相关 >
  47. /// 贴图模型数组
  48. @property (copy, nonatomic) NSArray<HXPhotoEditChartletTitleModel *> *chartletModels;
  49. /// 请求获取贴图模型
  50. /// block会在贴图列表弹出之后调用
  51. /// 优先级高于 chartletModels
  52. @property (copy, nonatomic) void (^ requestChartletModels)(void(^ chartletModels)(NSArray<HXPhotoEditChartletTitleModel *> *chartletModels));
  53. #pragma mark - < 文字贴图相关 >
  54. /// 文字颜色数组
  55. @property (copy, nonatomic) NSArray<UIColor *> *textColors;
  56. /// 文字字体
  57. @property (strong, nonatomic) UIFont *textFont;
  58. /// 最大文本长度限制
  59. @property (assign, nonatomic) NSInteger maximumLimitTextLength;
  60. #pragma mark - < 裁剪相关 >
  61. /// 固定裁剪比例
  62. @property (assign, nonatomic) HXPhotoEditAspectRatio aspectRatio;
  63. /// 自定义固定比例
  64. /// 设置自定义比例必须设置 aspectRatio = HXPhotoEditAspectRatioType_Custom,否则无效
  65. @property (assign, nonatomic) CGSize customAspectRatio;
  66. /// 圆形裁剪框,只要裁剪功能 并且 固定裁剪比例为 HXPhotoEditAspectRatioType_1x1 时有效
  67. @property (assign, nonatomic) BOOL isRoundCliping;
  68. @property (assign, nonatomic) CGSize clippingMinSize;
  69. @end
  70. NS_ASSUME_NONNULL_END