POPLayerExtras.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. /**
  2. Copyright (c) 2014-present, Facebook, Inc.
  3. All rights reserved.
  4. This source code is licensed under the BSD-style license found in the
  5. LICENSE file in the root directory of this source tree. An additional grant
  6. of patent rights can be found in the PATENTS file in the same directory.
  7. */
  8. #import <QuartzCore/QuartzCore.h>
  9. #import <pop/POPDefines.h>
  10. POP_EXTERN_C_BEGIN
  11. #pragma mark - Scale
  12. /**
  13. @abstract Returns layer scale factor for the x axis.
  14. */
  15. extern CGFloat POPLayerGetScaleX(CALayer *l);
  16. /**
  17. @abstract Set layer scale factor for the x axis.
  18. */
  19. extern void POPLayerSetScaleX(CALayer *l, CGFloat f);
  20. /**
  21. @abstract Returns layer scale factor for the y axis.
  22. */
  23. extern CGFloat POPLayerGetScaleY(CALayer *l);
  24. /**
  25. @abstract Set layer scale factor for the y axis.
  26. */
  27. extern void POPLayerSetScaleY(CALayer *l, CGFloat f);
  28. /**
  29. @abstract Returns layer scale factor for the z axis.
  30. */
  31. extern CGFloat POPLayerGetScaleZ(CALayer *l);
  32. /**
  33. @abstract Set layer scale factor for the z axis.
  34. */
  35. extern void POPLayerSetScaleZ(CALayer *l, CGFloat f);
  36. /**
  37. @abstract Returns layer scale factors for x and y access as point.
  38. */
  39. extern CGPoint POPLayerGetScaleXY(CALayer *l);
  40. /**
  41. @abstract Sets layer x and y scale factors given point.
  42. */
  43. extern void POPLayerSetScaleXY(CALayer *l, CGPoint p);
  44. #pragma mark - Translation
  45. /**
  46. @abstract Returns layer translation factor for the x axis.
  47. */
  48. extern CGFloat POPLayerGetTranslationX(CALayer *l);
  49. /**
  50. @abstract Set layer translation factor for the x axis.
  51. */
  52. extern void POPLayerSetTranslationX(CALayer *l, CGFloat f);
  53. /**
  54. @abstract Returns layer translation factor for the y axis.
  55. */
  56. extern CGFloat POPLayerGetTranslationY(CALayer *l);
  57. /**
  58. @abstract Set layer translation factor for the y axis.
  59. */
  60. extern void POPLayerSetTranslationY(CALayer *l, CGFloat f);
  61. /**
  62. @abstract Returns layer translation factor for the z axis.
  63. */
  64. extern CGFloat POPLayerGetTranslationZ(CALayer *l);
  65. /**
  66. @abstract Set layer translation factor for the z axis.
  67. */
  68. extern void POPLayerSetTranslationZ(CALayer *l, CGFloat f);
  69. /**
  70. @abstract Returns layer translation factors for x and y access as point.
  71. */
  72. extern CGPoint POPLayerGetTranslationXY(CALayer *l);
  73. /**
  74. @abstract Sets layer x and y translation factors given point.
  75. */
  76. extern void POPLayerSetTranslationXY(CALayer *l, CGPoint p);
  77. #pragma mark - Rotation
  78. /**
  79. @abstract Returns layer rotation, in radians, in the X axis.
  80. */
  81. extern CGFloat POPLayerGetRotationX(CALayer *l);
  82. /**
  83. @abstract Sets layer rotation, in radians, in the X axis.
  84. */
  85. extern void POPLayerSetRotationX(CALayer *l, CGFloat f);
  86. /**
  87. @abstract Returns layer rotation, in radians, in the Y axis.
  88. */
  89. extern CGFloat POPLayerGetRotationY(CALayer *l);
  90. /**
  91. @abstract Sets layer rotation, in radians, in the Y axis.
  92. */
  93. extern void POPLayerSetRotationY(CALayer *l, CGFloat f);
  94. /**
  95. @abstract Returns layer rotation, in radians, in the Z axis.
  96. */
  97. extern CGFloat POPLayerGetRotationZ(CALayer *l);
  98. /**
  99. @abstract Sets layer rotation, in radians, in the Z axis.
  100. */
  101. extern void POPLayerSetRotationZ(CALayer *l, CGFloat f);
  102. /**
  103. @abstract Returns layer rotation, in radians, in the Z axis.
  104. */
  105. extern CGFloat POPLayerGetRotation(CALayer *l);
  106. /**
  107. @abstract Sets layer rotation, in radians, in the Z axis.
  108. */
  109. extern void POPLayerSetRotation(CALayer *l, CGFloat f);
  110. #pragma mark - Sublayer Scale
  111. /**
  112. @abstract Returns sublayer scale factors for x and y access as point.
  113. */
  114. extern CGPoint POPLayerGetSubScaleXY(CALayer *l);
  115. /**
  116. @abstract Sets sublayer x and y scale factors given point.
  117. */
  118. extern void POPLayerSetSubScaleXY(CALayer *l, CGPoint p);
  119. #pragma mark - Sublayer Translation
  120. /**
  121. @abstract Returns sublayer translation factor for the x axis.
  122. */
  123. extern CGFloat POPLayerGetSubTranslationX(CALayer *l);
  124. /**
  125. @abstract Set sublayer translation factor for the x axis.
  126. */
  127. extern void POPLayerSetSubTranslationX(CALayer *l, CGFloat f);
  128. /**
  129. @abstract Returns sublayer translation factor for the y axis.
  130. */
  131. extern CGFloat POPLayerGetSubTranslationY(CALayer *l);
  132. /**
  133. @abstract Set sublayer translation factor for the y axis.
  134. */
  135. extern void POPLayerSetSubTranslationY(CALayer *l, CGFloat f);
  136. /**
  137. @abstract Returns sublayer translation factor for the z axis.
  138. */
  139. extern CGFloat POPLayerGetSubTranslationZ(CALayer *l);
  140. /**
  141. @abstract Set sublayer translation factor for the z axis.
  142. */
  143. extern void POPLayerSetSubTranslationZ(CALayer *l, CGFloat f);
  144. /**
  145. @abstract Returns sublayer translation factors for x and y access as point.
  146. */
  147. extern CGPoint POPLayerGetSubTranslationXY(CALayer *l);
  148. /**
  149. @abstract Sets sublayer x and y translation factors given point.
  150. */
  151. extern void POPLayerSetSubTranslationXY(CALayer *l, CGPoint p);
  152. POP_EXTERN_C_END