FUBeautyDefine.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // FUBeautyDefine.h
  3. // FUBeautyUIComponent
  4. //
  5. // Created by 项林平 on 2022/6/9.
  6. //
  7. #import <AVFoundation/AVFoundation.h>
  8. #import <UIKit/UIKit.h>
  9. #ifndef FUBeautyDefine_h
  10. #define FUBeautyDefine_h
  11. #define FUBeautyStringWithKey(aKey) NSLocalizedString(aKey, nil)
  12. #pragma mark - Const
  13. extern const CGFloat FUBeautyCategoryViewHeight;
  14. extern const CGFloat FUBeautyFunctionViewOverallHeight;
  15. extern const CGFloat FUBeautyFunctionSliderHeight;
  16. extern NSString * const FUPersistentBeautySkinKey;
  17. extern NSString * const FUPersistentBeautyShapeKey;
  18. extern NSString * const FUPersistentBeautyFilterKey;
  19. extern NSString * const FUPersistentBeautySelectedFilterIndexKey;
  20. #pragma mark - Enum
  21. typedef NS_ENUM(NSInteger, FUBeautyCategory) {
  22. FUBeautyCategoryNone = -1,
  23. FUBeautyCategorySkin = 0, //美肤
  24. FUBeautyCategoryShape = 1, //美型
  25. FUBeautyCategoryFilter = 2 //滤镜
  26. };
  27. typedef NS_ENUM(NSUInteger, FUBeautySkin) {
  28. FUBeautySkinBlurLevel = 0,
  29. FUBeautySkinColorLevel,
  30. FUBeautySkinRedLevel,
  31. FUBeautySkinSharpen,
  32. FUBeautySkinFaceThreed,
  33. FUBeautySkinEyeBright,
  34. FUBeautySkinToothWhiten,
  35. FUBeautySkinRemovePouchStrength,
  36. FUBeautySkinRemoveNasolabialFoldsStrength
  37. };
  38. typedef NS_ENUM(NSUInteger, FUBeautyShape) {
  39. FUBeautyShapeCheekThinning = 0,
  40. FUBeautyShapeCheekV,
  41. FUBeautyShapeCheekNarrow,
  42. FUBeautyShapeCheekShort,
  43. FUBeautyShapeCheekSmall,
  44. FUBeautyShapeCheekbones,
  45. FUBeautyShapeLowerJaw,
  46. FUBeautyShapeEyeEnlarging,
  47. FUBeautyShapeEyeCircle,
  48. FUBeautyShapeChin,
  49. FUBeautyShapeForehead,
  50. FUBeautyShapeNose,
  51. FUBeautyShapeMouth,
  52. FUBeautyShapeLipThick,
  53. FUBeautyShapeEyeHeight,
  54. FUBeautyShapeCanthus,
  55. FUBeautyShapeEyeLid,
  56. FUBeautyShapeEyeSpace,
  57. FUBeautyShapeEyeRotate,
  58. FUBeautyShapeLongNose,
  59. FUBeautyShapePhiltrum,
  60. FUBeautyShapeSmile,
  61. FUBeautyShapeBrowHeight,
  62. FUBeautyShapeBrowSpace,
  63. FUBeautyShapeBrowThick
  64. };
  65. #pragma mark - Inline methods
  66. static inline CGFloat FUBeautyHeightIncludeBottomSafeArea(CGFloat height) {
  67. if (@available(iOS 11.0, *)) {
  68. height += [UIApplication sharedApplication].delegate.window.safeAreaInsets.bottom;
  69. }
  70. return height;
  71. }
  72. static inline UIImage * FUBeautyImageNamed(NSString *name) {
  73. NSString *path = [[NSBundle mainBundle] pathForResource:@"FUBeautyComponent" ofType:@"framework" inDirectory:@"Frameworks"];
  74. NSBundle *bundle = [NSBundle bundleWithPath:path];
  75. return [UIImage imageNamed:name inBundle:bundle compatibleWithTraitCollection:nil];;
  76. }
  77. #endif /* FUBeautyDefine_h */