LOTLayer.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // LOTLayer.h
  3. // LottieAnimator
  4. //
  5. // Created by Brandon Withrow on 12/14/15.
  6. // Copyright © 2015 Brandon Withrow. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "LOTPlatformCompat.h"
  10. #import "LOTKeyframe.h"
  11. @class LOTShapeGroup;
  12. @class LOTMask;
  13. @class LOTAsset;
  14. @class LOTAssetGroup;
  15. typedef enum : NSInteger {
  16. LOTLayerTypePrecomp,
  17. LOTLayerTypeSolid,
  18. LOTLayerTypeImage,
  19. LOTLayerTypeNull,
  20. LOTLayerTypeShape,
  21. LOTLayerTypeUnknown
  22. } LOTLayerType;
  23. typedef enum : NSInteger {
  24. LOTMatteTypeNone,
  25. LOTMatteTypeAdd,
  26. LOTMatteTypeInvert,
  27. LOTMatteTypeUnknown
  28. } LOTMatteType;
  29. NS_ASSUME_NONNULL_BEGIN
  30. @interface LOTLayer : NSObject
  31. - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary
  32. withAssetGroup:(LOTAssetGroup * _Nullable)assetGroup
  33. withFramerate:(NSNumber *)framerate;
  34. @property (nonatomic, readonly) NSString *layerName;
  35. @property (nonatomic, readonly, nullable) NSString *referenceID;
  36. @property (nonatomic, readonly) NSNumber *layerID;
  37. @property (nonatomic, readonly) LOTLayerType layerType;
  38. @property (nonatomic, readonly, nullable) NSNumber *parentID;
  39. @property (nonatomic, readonly) NSNumber *startFrame;
  40. @property (nonatomic, readonly) NSNumber *inFrame;
  41. @property (nonatomic, readonly) NSNumber *outFrame;
  42. @property (nonatomic, readonly) NSNumber *timeStretch;
  43. @property (nonatomic, readonly) CGRect layerBounds;
  44. @property (nonatomic, readonly, nullable) NSArray<LOTShapeGroup *> *shapes;
  45. @property (nonatomic, readonly, nullable) NSArray<LOTMask *> *masks;
  46. @property (nonatomic, readonly, nullable) NSNumber *layerWidth;
  47. @property (nonatomic, readonly, nullable) NSNumber *layerHeight;
  48. @property (nonatomic, readonly, nullable) UIColor *solidColor;
  49. @property (nonatomic, readonly, nullable) LOTAsset *imageAsset;
  50. @property (nonatomic, readonly) LOTKeyframeGroup *opacity;
  51. @property (nonatomic, readonly, nullable) LOTKeyframeGroup *timeRemapping;
  52. @property (nonatomic, readonly) LOTKeyframeGroup *rotation;
  53. @property (nonatomic, readonly, nullable) LOTKeyframeGroup *position;
  54. @property (nonatomic, readonly, nullable) LOTKeyframeGroup *positionX;
  55. @property (nonatomic, readonly, nullable) LOTKeyframeGroup *positionY;
  56. @property (nonatomic, readonly) LOTKeyframeGroup *anchor;
  57. @property (nonatomic, readonly) LOTKeyframeGroup *scale;
  58. @property (nonatomic, readonly) LOTMatteType matteType;
  59. @end
  60. NS_ASSUME_NONNULL_END