Guest User

Untitled

a guest
Jun 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. #ifndef CALayer_CAMeshTransform_CALight_h
  2. #define CALayer_CAMeshTransform_CALight_h
  3.  
  4.  
  5. typedef struct CAMeshFace {
  6. unsigned int indices[4];
  7. float w[4];
  8. } CAMeshFace;
  9.  
  10. typedef struct CAPoint3D {
  11. CGFloat x;
  12. CGFloat y;
  13. CGFloat z;
  14. } CAPoint3D;
  15.  
  16. typedef struct CAMeshVertex {
  17. CGPoint from;
  18. CAPoint3D to;
  19. } CAMeshVertex;
  20.  
  21.  
  22.  
  23. extern NSString * const kCADepthNormalizationNone;
  24. extern NSString * const kCADepthNormalizationWidth;
  25. extern NSString * const kCADepthNormalizationHeight;
  26. extern NSString * const kCADepthNormalizationMin;
  27. extern NSString * const kCADepthNormalizationMax;
  28. extern NSString * const kCADepthNormalizationAverage;
  29.  
  30. @interface CAMeshTransform : NSObject <NSCoding, NSCopying, NSMutableCopying>
  31.  
  32. @property (readonly) NSInteger subdivisionSteps; // defaults to -1
  33. @property (readonly, copy) NSString *depthNormalization; // defaults to kCADepthNormalizationNone
  34.  
  35. @property (readonly) NSUInteger faceCount;
  36. @property (readonly) NSUInteger vertexCount;
  37.  
  38. + (instancetype)meshTransformWithVertexCount:(NSUInteger)vertexCount
  39. vertices:(CAMeshVertex *)vertices
  40. faceCount:(NSUInteger)faceCount
  41. faces:(CAMeshFace *)faces
  42. depthNormalization:(NSString *)depthNormalization;
  43.  
  44. - (instancetype)initWithVertexCount:(NSUInteger)vertexCount
  45. vertices:(CAMeshVertex *)vertices
  46. faceCount:(NSUInteger)faceCount
  47. faces:(CAMeshFace *)faces
  48. depthNormalization:(NSString *)depthNormalization;
  49.  
  50.  
  51. - (CAMeshFace)faceAtIndex:(NSUInteger)faceIndex;
  52. - (CAMeshVertex)vertexAtIndex:(NSUInteger)vertexIndex;
  53.  
  54. @end
  55.  
  56.  
  57. @interface CAMutableMeshTransform : CAMeshTransform
  58.  
  59. @property NSInteger subdivisionSteps;
  60. @property (copy) NSString *depthNormalization;
  61.  
  62. + (instancetype)meshTransform;
  63.  
  64. - (void)addFace:(CAMeshFace)face;
  65. - (void)removeFaceAtIndex:(NSUInteger)faceIndex;
  66. - (void)replaceFaceAtIndex:(NSUInteger)faceIndex withFace:(CAMeshFace)face;
  67.  
  68. - (void)addVertex:(CAMeshVertex)vertex;
  69. - (void)removeVertexAtIndex:(NSUInteger)vertexIndex;
  70. - (void)replaceVertexAtIndex:(NSUInteger)vertexIndex withVertex:(CAMeshVertex)vertex;
  71.  
  72. @end
  73.  
  74.  
  75.  
  76. extern NSString * const kCALightTypeAmbient;
  77. extern NSString * const kCALightTypeDirectional;
  78. extern NSString * const kCALightTypePoint;
  79. extern NSString * const kCALightTypeSpot;
  80.  
  81. @interface CALight : NSObject <NSCopying, NSCoding>
  82.  
  83. @property (copy) NSString *name;
  84. @property (copy) NSString *type;
  85. @property (copy) NSString *imageBlendMode;
  86.  
  87. @property (getter=isEnabled) BOOL enabled;
  88.  
  89. @property float imageNormalAngle;
  90. @property float imageRotation;
  91. @property (retain) id image;
  92.  
  93. @property float coneEdgeSoftness;
  94. @property float coneAngle;
  95. @property float falloff;
  96. @property float falloffDistance;
  97.  
  98. @property CAPoint3D position;
  99. @property CAPoint3D direction; // defaults to {0.0, 0.0, 1.0}
  100.  
  101. @property CGColorRef color;
  102.  
  103. @property float specularIntensity;
  104. @property float diffuseIntensity;
  105. @property float ambientIntensity;
  106. @property float intensity;
  107.  
  108. + (id)lightWithType:(NSString *)lightType;
  109.  
  110. - (id)initWithType:(NSString *)lightType;
  111.  
  112. @end
  113.  
  114.  
  115.  
  116. @interface CALayer (PrivateMeshAndLights)
  117.  
  118. @property (copy) CAMeshTransform *meshTransform;
  119.  
  120. @property BOOL acceptsLights; // defaults to YES
  121. @property (copy) NSArray *lights;
  122.  
  123. @property float metallicity;
  124. @property float shininess;
  125. @property float specularReflectance;
  126. @property float diffuseReflectance;
  127. @property float ambientReflectance;
  128.  
  129. @end
  130.  
  131.  
  132. #endif
Add Comment
Please, Sign In to add comment