@shopify/react-native-skia 2.0.7 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/android/CMakeLists.txt +20 -1
  2. package/cpp/api/JsiSkApi.h +3 -0
  3. package/cpp/api/JsiSkImageFilterFactory.h +478 -39
  4. package/cpp/api/JsiSkSkottie.h +590 -0
  5. package/cpp/api/JsiSkottieFactory.h +65 -0
  6. package/cpp/api/recorder/Command.h +1 -0
  7. package/cpp/api/recorder/Convertor.h +32 -0
  8. package/cpp/api/recorder/Drawings.h +23 -0
  9. package/cpp/api/recorder/ImageFilters.h +20 -0
  10. package/cpp/api/recorder/JsiRecorder.h +6 -0
  11. package/cpp/api/recorder/RNRecorder.h +15 -0
  12. package/cpp/api/third_party/SkottieUtils.cpp +333 -0
  13. package/cpp/api/third_party/SkottieUtils.h +172 -0
  14. package/cpp/skia/modules/jsonreader/SkJSONReader.cpp +980 -0
  15. package/cpp/skia/modules/jsonreader/SkJSONReader.h +389 -0
  16. package/cpp/skia/modules/skottie/include/ExternalLayer.h +56 -0
  17. package/cpp/skia/modules/skottie/include/Skottie.h +313 -0
  18. package/cpp/skia/modules/skottie/include/SkottieProperty.h +190 -0
  19. package/cpp/skia/modules/skottie/include/SlotManager.h +113 -0
  20. package/cpp/skia/modules/skottie/include/TextShaper.h +200 -0
  21. package/cpp/skia/modules/skottie/src/SkottieValue.h +56 -0
  22. package/cpp/skia/modules/skottie/src/animator/Animator.h +89 -0
  23. package/cpp/skia/modules/skottie/src/text/Font.h +82 -0
  24. package/cpp/skia/modules/skottie/src/text/TextAdapter.h +155 -0
  25. package/cpp/skia/modules/skottie/src/text/TextAnimator.h +121 -0
  26. package/cpp/skia/modules/skottie/src/text/TextValue.h +28 -0
  27. package/cpp/skia/modules/sksg/include/SkSGClipEffect.h +61 -0
  28. package/cpp/skia/modules/sksg/include/SkSGColorFilter.h +135 -0
  29. package/cpp/skia/modules/sksg/include/SkSGDraw.h +57 -0
  30. package/cpp/skia/modules/sksg/include/SkSGEffectNode.h +50 -0
  31. package/cpp/skia/modules/sksg/include/SkSGGeometryEffect.h +181 -0
  32. package/cpp/skia/modules/sksg/include/SkSGGeometryNode.h +54 -0
  33. package/cpp/skia/modules/sksg/include/SkSGGradient.h +108 -0
  34. package/cpp/skia/modules/sksg/include/SkSGGroup.h +65 -0
  35. package/cpp/skia/modules/sksg/include/SkSGImage.h +59 -0
  36. package/cpp/skia/modules/sksg/include/SkSGInvalidationController.h +46 -0
  37. package/cpp/skia/modules/sksg/include/SkSGMaskEffect.h +65 -0
  38. package/cpp/skia/modules/sksg/include/SkSGMerge.h +74 -0
  39. package/cpp/skia/modules/sksg/include/SkSGNode.h +128 -0
  40. package/cpp/skia/modules/sksg/include/SkSGOpacityEffect.h +54 -0
  41. package/cpp/skia/modules/sksg/include/SkSGPaint.h +112 -0
  42. package/cpp/skia/modules/sksg/include/SkSGPath.h +68 -0
  43. package/cpp/skia/modules/sksg/include/SkSGPlane.h +47 -0
  44. package/cpp/skia/modules/sksg/include/SkSGRect.h +122 -0
  45. package/cpp/skia/modules/sksg/include/SkSGRenderEffect.h +283 -0
  46. package/cpp/skia/modules/sksg/include/SkSGRenderNode.h +157 -0
  47. package/cpp/skia/modules/sksg/include/SkSGScene.h +47 -0
  48. package/cpp/skia/modules/sksg/include/SkSGText.h +82 -0
  49. package/cpp/skia/modules/sksg/include/SkSGTransform.h +127 -0
  50. package/cpp/skia/src/base/SkArenaAlloc.h +371 -0
  51. package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +15 -15
  52. package/lib/commonjs/dom/types/Drawings.d.ts +8 -1
  53. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  54. package/lib/commonjs/dom/types/NodeType.d.ts +3 -1
  55. package/lib/commonjs/dom/types/NodeType.js +4 -0
  56. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  57. package/lib/commonjs/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  58. package/lib/commonjs/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  59. package/lib/commonjs/renderer/__tests__/e2e/ImageFilter.spec.d.ts +1 -0
  60. package/lib/commonjs/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  61. package/lib/commonjs/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  62. package/lib/commonjs/renderer/__tests__/setup.d.ts +5 -0
  63. package/lib/commonjs/renderer/components/ImageFilter.d.ts +4 -0
  64. package/lib/commonjs/renderer/components/ImageFilter.js +13 -0
  65. package/lib/commonjs/renderer/components/ImageFilter.js.map +1 -0
  66. package/lib/commonjs/renderer/components/Skottie.d.ts +4 -0
  67. package/lib/commonjs/renderer/components/Skottie.js +13 -0
  68. package/lib/commonjs/renderer/components/Skottie.js.map +1 -0
  69. package/lib/commonjs/renderer/components/index.d.ts +2 -0
  70. package/lib/commonjs/renderer/components/index.js +22 -0
  71. package/lib/commonjs/renderer/components/index.js.map +1 -1
  72. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  73. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  74. package/lib/commonjs/skia/types/Matrix4.d.ts +11 -2
  75. package/lib/commonjs/skia/types/Matrix4.js +42 -1
  76. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  77. package/lib/commonjs/skia/types/Recorder.d.ts +2 -1
  78. package/lib/commonjs/skia/types/Recorder.js.map +1 -1
  79. package/lib/commonjs/skia/types/Skia.d.ts +2 -0
  80. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  81. package/lib/commonjs/skia/types/Skottie.d.ts +223 -0
  82. package/lib/commonjs/skia/types/Skottie.js +73 -0
  83. package/lib/commonjs/skia/types/Skottie.js.map +1 -0
  84. package/lib/commonjs/skia/types/index.d.ts +1 -0
  85. package/lib/commonjs/skia/types/index.js +11 -0
  86. package/lib/commonjs/skia/types/index.js.map +1 -1
  87. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  88. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +88 -19
  89. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  90. package/lib/commonjs/skia/web/JsiSkia.js +2 -0
  91. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  92. package/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +59 -0
  93. package/lib/commonjs/skia/web/JsiSkottieAnimation.js +243 -0
  94. package/lib/commonjs/skia/web/JsiSkottieAnimation.js.map +1 -0
  95. package/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +9 -0
  96. package/lib/commonjs/skia/web/JsiSkottieFactory.js +26 -0
  97. package/lib/commonjs/skia/web/JsiSkottieFactory.js.map +1 -0
  98. package/lib/commonjs/sksg/Elements.d.ts +3 -1
  99. package/lib/commonjs/sksg/Elements.js.map +1 -1
  100. package/lib/commonjs/sksg/Node.d.ts +1 -1
  101. package/lib/commonjs/sksg/Node.js +1 -1
  102. package/lib/commonjs/sksg/Node.js.map +1 -1
  103. package/lib/commonjs/sksg/Recorder/Core.d.ts +4 -2
  104. package/lib/commonjs/sksg/Recorder/Core.js +1 -0
  105. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
  106. package/lib/commonjs/sksg/Recorder/Player.js +2 -0
  107. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
  108. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  109. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js +4 -0
  110. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  111. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +2 -1
  112. package/lib/commonjs/sksg/Recorder/Recorder.js +6 -0
  113. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
  114. package/lib/commonjs/sksg/Recorder/Visitor.js +3 -0
  115. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -1
  116. package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +2 -2
  117. package/lib/commonjs/sksg/Recorder/commands/Drawing.js +11 -4
  118. package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
  119. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +12 -2
  120. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  121. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +15 -15
  122. package/lib/module/dom/types/Drawings.d.ts +8 -1
  123. package/lib/module/dom/types/Drawings.js.map +1 -1
  124. package/lib/module/dom/types/NodeType.d.ts +3 -1
  125. package/lib/module/dom/types/NodeType.js +4 -0
  126. package/lib/module/dom/types/NodeType.js.map +1 -1
  127. package/lib/module/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  128. package/lib/module/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  129. package/lib/module/renderer/__tests__/e2e/ImageFilter.spec.d.ts +1 -0
  130. package/lib/module/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  131. package/lib/module/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  132. package/lib/module/renderer/__tests__/setup.d.ts +5 -0
  133. package/lib/module/renderer/components/ImageFilter.d.ts +4 -0
  134. package/lib/module/renderer/components/ImageFilter.js +5 -0
  135. package/lib/module/renderer/components/ImageFilter.js.map +1 -0
  136. package/lib/module/renderer/components/Skottie.d.ts +4 -0
  137. package/lib/module/renderer/components/Skottie.js +5 -0
  138. package/lib/module/renderer/components/Skottie.js.map +1 -0
  139. package/lib/module/renderer/components/index.d.ts +2 -0
  140. package/lib/module/renderer/components/index.js +2 -0
  141. package/lib/module/renderer/components/index.js.map +1 -1
  142. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  143. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  144. package/lib/module/skia/types/Matrix4.d.ts +11 -2
  145. package/lib/module/skia/types/Matrix4.js +40 -0
  146. package/lib/module/skia/types/Matrix4.js.map +1 -1
  147. package/lib/module/skia/types/Recorder.d.ts +2 -1
  148. package/lib/module/skia/types/Recorder.js.map +1 -1
  149. package/lib/module/skia/types/Skia.d.ts +2 -0
  150. package/lib/module/skia/types/Skia.js.map +1 -1
  151. package/lib/module/skia/types/Skottie.d.ts +223 -0
  152. package/lib/module/skia/types/Skottie.js +74 -0
  153. package/lib/module/skia/types/Skottie.js.map +1 -0
  154. package/lib/module/skia/types/index.d.ts +1 -0
  155. package/lib/module/skia/types/index.js +1 -0
  156. package/lib/module/skia/types/index.js.map +1 -1
  157. package/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  158. package/lib/module/skia/web/JsiSkImageFilterFactory.js +88 -19
  159. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  160. package/lib/module/skia/web/JsiSkia.js +2 -0
  161. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  162. package/lib/module/skia/web/JsiSkottieAnimation.d.ts +59 -0
  163. package/lib/module/skia/web/JsiSkottieAnimation.js +236 -0
  164. package/lib/module/skia/web/JsiSkottieAnimation.js.map +1 -0
  165. package/lib/module/skia/web/JsiSkottieFactory.d.ts +9 -0
  166. package/lib/module/skia/web/JsiSkottieFactory.js +19 -0
  167. package/lib/module/skia/web/JsiSkottieFactory.js.map +1 -0
  168. package/lib/module/sksg/Elements.d.ts +3 -1
  169. package/lib/module/sksg/Elements.js.map +1 -1
  170. package/lib/module/sksg/Node.d.ts +1 -1
  171. package/lib/module/sksg/Node.js +1 -1
  172. package/lib/module/sksg/Node.js.map +1 -1
  173. package/lib/module/sksg/Recorder/Core.d.ts +4 -2
  174. package/lib/module/sksg/Recorder/Core.js +1 -0
  175. package/lib/module/sksg/Recorder/Core.js.map +1 -1
  176. package/lib/module/sksg/Recorder/Player.js +3 -1
  177. package/lib/module/sksg/Recorder/Player.js.map +1 -1
  178. package/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  179. package/lib/module/sksg/Recorder/ReanimatedRecorder.js +4 -0
  180. package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  181. package/lib/module/sksg/Recorder/Recorder.d.ts +2 -1
  182. package/lib/module/sksg/Recorder/Recorder.js +6 -0
  183. package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
  184. package/lib/module/sksg/Recorder/Visitor.js +3 -0
  185. package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
  186. package/lib/module/sksg/Recorder/commands/Drawing.d.ts +2 -2
  187. package/lib/module/sksg/Recorder/commands/Drawing.js +9 -2
  188. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
  189. package/lib/module/sksg/Recorder/commands/ImageFilters.js +12 -2
  190. package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  191. package/lib/typescript/lib/commonjs/renderer/components/ImageFilter.d.ts +2 -0
  192. package/lib/typescript/lib/commonjs/renderer/components/Skottie.d.ts +2 -0
  193. package/lib/typescript/lib/commonjs/skia/types/Matrix4.d.ts +1 -0
  194. package/lib/typescript/lib/commonjs/skia/types/Skottie.d.ts +6 -0
  195. package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
  196. package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +2 -0
  197. package/lib/typescript/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +48 -0
  198. package/lib/typescript/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +6 -0
  199. package/lib/typescript/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
  200. package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -0
  201. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +1 -1
  202. package/lib/typescript/lib/module/mock/index.d.ts +8 -0
  203. package/lib/typescript/lib/module/renderer/components/ImageFilter.d.ts +2 -0
  204. package/lib/typescript/lib/module/renderer/components/Skottie.d.ts +2 -0
  205. package/lib/typescript/lib/module/renderer/components/index.d.ts +2 -0
  206. package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -0
  207. package/lib/typescript/lib/module/skia/types/Matrix4.d.ts +1 -0
  208. package/lib/typescript/lib/module/skia/types/Skottie.d.ts +5 -0
  209. package/lib/typescript/lib/module/skia/types/index.d.ts +1 -0
  210. package/lib/typescript/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
  211. package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +2 -0
  212. package/lib/typescript/lib/module/skia/web/JsiSkottieAnimation.d.ts +47 -0
  213. package/lib/typescript/lib/module/skia/web/JsiSkottieFactory.d.ts +5 -0
  214. package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
  215. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +1 -0
  216. package/lib/typescript/lib/module/sksg/Recorder/commands/Drawing.d.ts +1 -1
  217. package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +15 -15
  218. package/lib/typescript/src/dom/types/Drawings.d.ts +8 -1
  219. package/lib/typescript/src/dom/types/NodeType.d.ts +3 -1
  220. package/lib/typescript/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  221. package/lib/typescript/src/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  222. package/lib/typescript/src/renderer/__tests__/e2e/ImageFilter.spec.d.ts +1 -0
  223. package/lib/typescript/src/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  224. package/lib/typescript/src/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  225. package/lib/typescript/src/renderer/__tests__/setup.d.ts +5 -0
  226. package/lib/typescript/src/renderer/components/ImageFilter.d.ts +4 -0
  227. package/lib/typescript/src/renderer/components/Skottie.d.ts +4 -0
  228. package/lib/typescript/src/renderer/components/index.d.ts +2 -0
  229. package/lib/typescript/src/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  230. package/lib/typescript/src/skia/types/Matrix4.d.ts +11 -2
  231. package/lib/typescript/src/skia/types/Recorder.d.ts +2 -1
  232. package/lib/typescript/src/skia/types/Skia.d.ts +2 -0
  233. package/lib/typescript/src/skia/types/Skottie.d.ts +223 -0
  234. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  235. package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  236. package/lib/typescript/src/skia/web/JsiSkottieAnimation.d.ts +59 -0
  237. package/lib/typescript/src/skia/web/JsiSkottieFactory.d.ts +9 -0
  238. package/lib/typescript/src/sksg/Elements.d.ts +3 -1
  239. package/lib/typescript/src/sksg/Node.d.ts +1 -1
  240. package/lib/typescript/src/sksg/Recorder/Core.d.ts +4 -2
  241. package/lib/typescript/src/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  242. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +2 -1
  243. package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +2 -2
  244. package/libs/android/arm64-v8a/libjsonreader.a +0 -0
  245. package/libs/android/armeabi-v7a/libjsonreader.a +0 -0
  246. package/libs/android/x86/libjsonreader.a +0 -0
  247. package/libs/android/x86_64/libjsonreader.a +0 -0
  248. package/libs/apple/libpathops.xcframework/Info.plist +8 -8
  249. package/libs/apple/libskia.xcframework/Info.plist +14 -14
  250. package/libs/apple/libskottie.xcframework/Info.plist +14 -14
  251. package/libs/apple/libskparagraph.xcframework/Info.plist +16 -16
  252. package/libs/apple/libsksg.xcframework/Info.plist +5 -5
  253. package/libs/apple/libskshaper.xcframework/Info.plist +14 -14
  254. package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +14 -14
  255. package/libs/apple/libsvg.xcframework/Info.plist +14 -14
  256. package/package.json +1 -1
  257. package/react-native-skia.podspec +4 -2
  258. package/src/__tests__/snapshots/matrix4/camera-corner.png +0 -0
  259. package/src/__tests__/snapshots/matrix4/camera-offset.png +0 -0
  260. package/src/__tests__/snapshots/matrix4/camera-top-left-center.png +0 -0
  261. package/src/__tests__/snapshots/matrix4/camera-zoom-out.png +0 -0
  262. package/src/__tests__/snapshots/matrix4/full-rect.png +0 -0
  263. package/src/__tests__/snapshots/matrix4/rect.png +0 -0
  264. package/src/__tests__/snapshots/matrix4/scaled-rect.png +0 -0
  265. package/src/__tests__/snapshots/matrix4/test-perspective.png +0 -0
  266. package/src/__tests__/snapshots/matrix4/test-perspective2.png +0 -0
  267. package/src/dom/types/Drawings.ts +11 -0
  268. package/src/dom/types/NodeType.ts +4 -0
  269. package/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.tsx +492 -0
  270. package/src/renderer/__tests__/e2e/Camera.spec.tsx +475 -0
  271. package/src/renderer/__tests__/e2e/ImageFilter.spec.tsx +99 -0
  272. package/src/renderer/__tests__/e2e/LightingImageFilters.spec.tsx +1478 -0
  273. package/src/renderer/__tests__/e2e/Skottie.spec.tsx +440 -0
  274. package/src/renderer/__tests__/e2e/setup/skottie/basic_slots.json +1118 -0
  275. package/src/renderer/__tests__/e2e/setup/skottie/color-props.json +1 -0
  276. package/src/renderer/__tests__/e2e/setup/skottie/confetti.json +5899 -0
  277. package/src/renderer/__tests__/e2e/setup/skottie/drinks.json +43857 -0
  278. package/src/renderer/__tests__/e2e/setup/skottie/fingerprint.json +1 -0
  279. package/src/renderer/__tests__/e2e/setup/skottie/lego_loader.json +29540 -0
  280. package/src/renderer/__tests__/e2e/setup/skottie/new-drop.json +1 -0
  281. package/src/renderer/__tests__/e2e/setup/skottie/onboarding.json +1 -0
  282. package/src/renderer/__tests__/e2e/setup/skottie/text-layer.json +1 -0
  283. package/src/renderer/__tests__/setup.tsx +31 -0
  284. package/src/renderer/components/ImageFilter.tsx +8 -0
  285. package/src/renderer/components/Skottie.tsx +8 -0
  286. package/src/renderer/components/index.ts +2 -0
  287. package/src/skia/__tests__/assets/Avenir-Heavy.ttf +0 -0
  288. package/src/skia/types/ImageFilter/ImageFilterFactory.ts +391 -21
  289. package/src/skia/types/Matrix4.ts +108 -2
  290. package/src/skia/types/Recorder.ts +2 -0
  291. package/src/skia/types/Skia.ts +2 -0
  292. package/src/skia/types/Skottie.ts +266 -0
  293. package/src/skia/types/index.ts +1 -0
  294. package/src/skia/web/JsiSkImageFilterFactory.ts +266 -31
  295. package/src/skia/web/JsiSkia.ts +2 -0
  296. package/src/skia/web/JsiSkottieAnimation.ts +259 -0
  297. package/src/skia/web/JsiSkottieFactory.ts +25 -0
  298. package/src/sksg/Elements.tsx +4 -0
  299. package/src/sksg/Node.ts +1 -0
  300. package/src/sksg/Recorder/Core.ts +3 -0
  301. package/src/sksg/Recorder/Player.ts +3 -0
  302. package/src/sksg/Recorder/ReanimatedRecorder.ts +6 -0
  303. package/src/sksg/Recorder/Recorder.ts +5 -0
  304. package/src/sksg/Recorder/Visitor.ts +3 -0
  305. package/src/sksg/Recorder/commands/Drawing.ts +7 -3
  306. package/src/sksg/Recorder/commands/ImageFilters.ts +15 -2
@@ -0,0 +1 @@
1
+ {"v":"5.6.3","fr":24,"ip":0,"op":43,"w":1000,"h":1000,"nm":"add text","ddd":0,"assets":[],"fonts":{"list":[{"fName":"Avenir-Heavy","fFamily":"Avenir","fStyle":"Heavy","ascent":75.5996704101562}]},"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 12","parent":5,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[-27.82,5.172,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":6,"s":[216,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":21,"s":[216,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":30,"s":[6,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":38,"s":[6,100,100]},{"t":43,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[215.18,238.344],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0.976470588235,0.905882352941,0.050980392157,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-135.41,5.172],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":5,"nm":"hello! 2","tt":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[278.604,561.008,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"t":{"d":{"k":[{"s":{"s":164,"f":"Avenir-Heavy","t":"hello!","j":0,"tr":25,"lh":196.8,"ls":0,"fc":[1,1,1]},"t":0}]},"p":{},"m":{"g":1,"a":{"a":0,"k":[0,0],"ix":2}},"a":[]},"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Shape Layer 11","parent":5,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[-27.82,5.172,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":6,"s":[216,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":21,"s":[216,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":30,"s":[6,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":38,"s":[6,100,100]},{"t":43,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[215.18,238.344],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0.976470588235,0.905882352941,0.050980392157,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-135.41,5.172],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":5,"nm":"hello!","tt":2,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[278.604,561.008,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"t":{"d":{"k":[{"s":{"s":164,"f":"Avenir-Heavy","t":"hello!","j":0,"tr":25,"lh":196.8,"ls":0,"fc":[0,0,0]},"t":0}]},"p":{},"m":{"g":1,"a":{"a":0,"k":[0,0],"ix":2}},"a":[{"nm":"Animator 1","s":{"t":0,"xe":{"a":0,"k":0,"ix":7},"ne":{"a":0,"k":0,"ix":8},"a":{"a":0,"k":100,"ix":4},"b":1,"rn":0,"sh":1,"r":1},"a":{"fc":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":20,"s":[0,0,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":23,"s":[0.941176474094,0.337254911661,0.180392161012,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":38,"s":[0.941176474094,0.337254911661,0.180392161012,1]},{"t":40,"s":[0,0,0,1]}],"ix":12}}}]},"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":3,"nm":"NULL CONTROL ","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":0,"s":[472.18,505.172,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":6,"s":[721.18,505.172,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":21,"s":[721.18,505.172,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":30,"s":[270.18,505.172,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":38,"s":[270.18,505.172,0],"to":[0,0,0],"ti":[0,0,0]},{"t":43,"s":[472.18,505.172,0]}],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"Shape Layer 10","parent":5,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[-27.82,5.172,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":6,"s":[216,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":21,"s":[216,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":30,"s":[6,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":38,"s":[6,100,100]},{"t":43,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[215.18,238.344],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0.976470588235,0.905882352941,0.050980392157,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":4,"s":[0,0,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":6,"s":[0.533333361149,0.870588243008,0.949019610882,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":19,"s":[0.533333361149,0.870588243008,0.949019610882,1]},{"t":21,"s":[0,0,0,1]}],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-135.41,5.172],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"Shape Layer 9","parent":5,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[53.175,44.828,0],"ix":2},"a":{"a":0,"k":[125.375,0,0],"ix":1},"s":{"a":0,"k":[122,122,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[139.571,-103.164],[111.321,-103.164],[122.194,-98.098],[122.911,107.373],[112.344,113.066],[138.156,112.987],[127.456,107.787],[127.694,-98.098]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.976470588235,0.905882352941,0.050980392157,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":240,"st":0,"bm":0},{"ddd":0,"ind":8,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[500,500,0],"ix":2},"a":{"a":0,"k":[20.422,12.422,0],"ix":1},"s":{"a":0,"k":[91,91,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[792.844,792.844],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":20,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":2,"s":[0,0,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":6,"s":[0.976470589638,0.905882358551,0.050980392843,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":19,"s":[0.941176474094,0.337254911661,0.180392161012,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":35,"s":[0.976470589638,0.905882358551,0.050980392843,1]},{"t":39,"s":[0,0,0,1]}],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":2,"s":[3]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":19,"s":[60]},{"t":39,"s":[3]}],"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[20.422,12.422],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":240,"st":0,"bm":0}],"markers":[],"chars":[{"ch":"h","size":164,"style":"Heavy","w":57.4,"data":{"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[-0.4,1.467],[-0.9,1.134],[-1.367,0.667],[-2,0],[-1.2,-0.966],[-0.567,-1.433],[-0.134,-1.633],[0,-1.333],[0,0],[0,0],[0,0],[0.6,2.267],[1.4,1.734],[2.233,1.067],[3.2,0],[2.366,-1.633],[0.933,-2],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,-1.6],[0.4,-1.466],[0.9,-1.133],[1.366,-0.666],[2.066,0],[1.2,0.967],[0.566,1.434],[0.133,1.634],[0,0],[0,0],[0,0],[0,-2.466],[-0.6,-2.266],[-1.4,-1.733],[-2.234,-1.066],[-3.734,0],[-2.367,1.634],[0,0],[0,0]],"v":[[18.8,-75.6],[6.8,-75.6],[6.8,0],[18.8,0],[18.8,-26.2],[19.4,-30.8],[21.35,-34.7],[24.75,-37.4],[29.8,-38.4],[34.7,-36.95],[37.35,-33.35],[38.4,-28.75],[38.6,-24.3],[38.6,0],[50.6,0],[50.6,-30.3],[49.7,-37.4],[46.7,-43.4],[41.25,-47.6],[33.1,-49.2],[23.95,-46.75],[19,-41.3],[18.8,-41.3]],"c":true},"ix":2},"nm":"h","mn":"ADBE Vector Shape - Group","hd":false}],"nm":"h","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}]},"fFamily":"Avenir"},{"ch":"e","size":164,"style":"Heavy","w":57.4,"data":{"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[1.1,3.234],[1.966,2.2],[2.766,1.167],[3.333,0],[3.2,-1.2],[2.333,-2.2],[1.366,-3.1],[0,-3.8],[-1.367,-3.1],[-2.334,-2.2],[-3.2,-1.2],[-3.6,0],[-3.467,1.466],[-2.8,3.467],[0,0],[2.033,-1.233],[3,0],[2.4,2],[0.4,3.6]],"o":[[0,0],[0,-4.2],[-1.1,-3.233],[-1.967,-2.2],[-2.767,-1.166],[-3.6,0],[-3.2,1.2],[-2.334,2.2],[-1.367,3.1],[0,3.8],[1.366,3.1],[2.333,2.2],[3.2,1.2],[3.8,0],[3.466,-1.466],[0,0],[-1.534,1.867],[-2.034,1.234],[-3.4,0],[-2.4,-2],[0,0]],"v":[[53,-19.8],[53,-23.1],[51.35,-34.25],[46.75,-42.4],[39.65,-47.45],[30.5,-49.2],[20.3,-47.4],[12,-42.3],[6.45,-34.35],[4.4,-24],[6.45,-13.65],[12,-5.7],[20.3,-0.6],[30.5,1.2],[41.4,-1],[50.8,-8.4],[42.2,-14.9],[36.85,-10.25],[29.3,-8.4],[20.6,-11.4],[16.4,-19.8]],"c":true},"ix":2},"nm":"e","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,0],[-2.1,2.067],[-3.6,0],[-2.134,-2.033],[-0.067,-3.533]],"o":[[0.466,-3.466],[2.1,-2.066],[3.8,0],[2.133,2.034],[0,0]],"v":[[16.4,-28.8],[20.25,-37.1],[28.8,-40.2],[37.7,-37.15],[41,-28.8]],"c":true},"ix":2},"nm":"e","mn":"ADBE Vector Shape - Group","hd":false}],"nm":"e","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}]},"fFamily":"Avenir"},{"ch":"l","size":164,"style":"Heavy","w":26.1,"data":{"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[7,0],[19,0],[19,-75.6],[7,-75.6]],"c":true},"ix":2},"nm":"l","mn":"ADBE Vector Shape - Group","hd":false}],"nm":"l","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}]},"fFamily":"Avenir"},{"ch":"o","size":164,"style":"Heavy","w":61,"data":{"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-1.367,-3.1],[-2.334,-2.2],[-3.2,-1.2],[-3.6,0],[-3.2,1.2],[-2.334,2.2],[-1.367,3.1],[0,3.8],[1.366,3.1],[2.333,2.2],[3.2,1.2],[3.6,0],[3.2,-1.2],[2.333,-2.2],[1.366,-3.1],[0,-3.8]],"o":[[1.366,3.1],[2.333,2.2],[3.2,1.2],[3.6,0],[3.2,-1.2],[2.333,-2.2],[1.366,-3.1],[0,-3.8],[-1.367,-3.1],[-2.334,-2.2],[-3.2,-1.2],[-3.6,0],[-3.2,1.2],[-2.334,2.2],[-1.367,3.1],[0,3.8]],"v":[[6.45,-13.65],[12,-5.7],[20.3,-0.6],[30.5,1.2],[40.7,-0.6],[49,-5.7],[54.55,-13.65],[56.6,-24],[54.55,-34.35],[49,-42.3],[40.7,-47.4],[30.5,-49.2],[20.3,-47.4],[12,-42.3],[6.45,-34.35],[4.4,-24]],"c":true},"ix":2},"nm":"o","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-0.634,1.734],[-1.234,1.334],[-1.734,0.8],[-2.2,0],[-1.734,-0.8],[-1.234,-1.333],[-0.634,-1.733],[0,-1.866],[0.633,-1.733],[1.233,-1.333],[1.733,-0.8],[2.2,0],[1.733,0.8],[1.233,1.334],[0.633,1.734],[0,1.867]],"o":[[0.633,-1.733],[1.233,-1.333],[1.733,-0.8],[2.2,0],[1.733,0.8],[1.233,1.334],[0.633,1.734],[0,1.867],[-0.634,1.734],[-1.234,1.334],[-1.734,0.8],[-2.2,0],[-1.734,-0.8],[-1.234,-1.333],[-0.634,-1.733],[0,-1.866]],"v":[[17.35,-29.4],[20.15,-34],[24.6,-37.2],[30.5,-38.4],[36.4,-37.2],[40.85,-34],[43.65,-29.4],[44.6,-24],[43.65,-18.6],[40.85,-14],[36.4,-10.8],[30.5,-9.6],[24.6,-10.8],[20.15,-14],[17.35,-18.6],[16.4,-24]],"c":true},"ix":2},"nm":"o","mn":"ADBE Vector Shape - Group","hd":false}],"nm":"o","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}]},"fFamily":"Avenir"},{"ch":"!","size":164,"style":"Heavy","w":29.6,"data":{"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[20.8,-70.8],[8.8,-70.8],[8.8,-22.2],[20.8,-22.2]],"c":true},"ix":2},"nm":"!","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[-0.434,-0.933],[-0.734,-0.666],[-0.967,-0.4],[-1.067,0],[-1.567,1.534],[0,2.134],[1.6,1.467],[2.133,0],[1.566,-1.533],[0,-2.133]],"o":[[0.433,0.934],[0.733,0.667],[0.966,0.4],[2.2,0],[1.566,-1.533],[0,-2.133],[-1.6,-1.466],[-2.2,0],[-1.567,1.534],[0,1.067]],"v":[[7.45,-4],[9.2,-1.6],[11.75,0],[14.8,0.6],[20.45,-1.7],[22.8,-7.2],[20.4,-12.6],[14.8,-14.8],[9.15,-12.5],[6.8,-7]],"c":true},"ix":2},"nm":"!","mn":"ADBE Vector Shape - Group","hd":false}],"nm":"!","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}]},"fFamily":"Avenir"}]}
@@ -1,3 +1,4 @@
1
+ /* eslint-disable camelcase */
1
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
3
  import fs from "fs";
3
4
  import path from "path";
@@ -43,6 +44,12 @@ export let fonts: {
43
44
  DinMedium: SkFont;
44
45
  };
45
46
 
47
+ export let dataAssets: {
48
+ NotoSansSCRegular: Uint8Array;
49
+ img_0: Uint8Array;
50
+ AvenirHeavy: Uint8Array;
51
+ };
52
+
46
53
  beforeAll(async () => {
47
54
  await LoadSkiaWeb();
48
55
  const Skia = JsiSkApi(global.CanvasKit);
@@ -70,6 +77,13 @@ beforeAll(async () => {
70
77
  const skiaLogoPng = loadImage("skia/__tests__/assets/skia_logo.png");
71
78
  const skiaLogoJpeg = loadImage("skia/__tests__/assets/skia_logo_jpeg.jpg");
72
79
  const mask = loadImage("skia/__tests__/assets/mask.png");
80
+ dataAssets = {
81
+ AvenirHeavy: resolveFile("skia/__tests__/assets/Avenir-Heavy.ttf"),
82
+ NotoSansSCRegular: resolveFile(
83
+ "skia/__tests__/assets/NotoSansSC-Regular.otf"
84
+ ),
85
+ img_0: resolveFile("skia/__tests__/assets/oslo.jpg"),
86
+ };
73
87
  images = { oslo, skiaLogoPng, skiaLogoJpeg, mask };
74
88
  fonts = {
75
89
  RobotoMedium,
@@ -299,6 +313,23 @@ const serializeSkOjects = (obj: any): any => {
299
313
  tx: obj.tx,
300
314
  ty: obj.ty,
301
315
  };
316
+ } else if (obj.__typename__ === "SkottieAnimation") {
317
+ if (!obj.source) {
318
+ throw new Error("SkottieAnimation must have a source");
319
+ }
320
+ return {
321
+ __typename__: "SkottieAnimation",
322
+ source: obj.source,
323
+ assets: obj.assets,
324
+ };
325
+ } else if (obj.__typename__ === "ImageFilter") {
326
+ if (!obj.source) {
327
+ throw new Error("ImageFilter must have a source");
328
+ }
329
+ return {
330
+ __typename__: "Function",
331
+ source: obj.source,
332
+ };
302
333
  }
303
334
  } else if (obj && typeof obj === "object") {
304
335
  const result = Object.keys(obj).reduce((acc, key) => {
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+
3
+ import type { ImageFilterProps } from "../../dom/types";
4
+ import type { SkiaProps } from "../processors";
5
+
6
+ export const ImageFilter = (props: SkiaProps<ImageFilterProps>) => {
7
+ return <skImageFilter {...props} />;
8
+ };
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+
3
+ import type { SkottieProps } from "../../dom/types";
4
+ import type { SkiaProps } from "../processors";
5
+
6
+ export const Skottie = (props: SkiaProps<SkottieProps>) => {
7
+ return <skSkottie {...props} />;
8
+ };
@@ -14,5 +14,7 @@ export * from "./Group";
14
14
  export * from "./Mask";
15
15
  export * from "./Paint";
16
16
  export * from "./Blend";
17
+ export * from "./Skottie";
18
+ export * from "./ImageFilter";
17
19
 
18
20
  export * from "./paragraph";
@@ -1,6 +1,9 @@
1
1
  import type { SkColor } from "../Color";
2
2
  import type { SkColorFilter } from "../ColorFilter/ColorFilter";
3
+ import type { FilterMode, MipmapMode, SkImage } from "../Image/Image";
4
+ import type { SkMatrix } from "../Matrix";
3
5
  import type { BlendMode } from "../Paint";
6
+ import type { SkPicture } from "../Picture";
4
7
  import type { SkRect } from "../Rect";
5
8
  import type { SkRuntimeShaderBuilder } from "../RuntimeEffect";
6
9
  import type { SkShader } from "../Shader";
@@ -21,11 +24,13 @@ export interface ImageFilterFactory {
21
24
  * @param dx - Offset along the X axis
22
25
  * @param dy - Offset along the X axis
23
26
  * @param input - if null, it will use the dynamic source image
27
+ * @param cropRect - Optional rectangle that crops the input and output
24
28
  */
25
29
  MakeOffset(
26
30
  dx: number,
27
31
  dy: number,
28
- input: SkImageFilter | null
32
+ input?: SkImageFilter | null,
33
+ cropRect?: SkRect | null
29
34
  ): SkImageFilter;
30
35
  /**
31
36
  * Spatially displace pixel values of the filtered image
@@ -35,45 +40,57 @@ export interface ImageFilterFactory {
35
40
  * @param scale - Scale factor to be used in the displacement
36
41
  * @param in1 - Source image filter to use for the displacement
37
42
  * @param input - if null, it will use the dynamic source image
43
+ * @param cropRect - Optional rectangle that crops the input and output
38
44
  */
39
45
  MakeDisplacementMap(
40
46
  channelX: ColorChannel,
41
47
  channelY: ColorChannel,
42
48
  scale: number,
43
49
  in1: SkImageFilter,
44
- input: SkImageFilter | null
50
+ input?: SkImageFilter | null,
51
+ cropRect?: SkRect | null
45
52
  ): SkImageFilter;
46
53
  /**
47
54
  * Transforms a shader into an impage filter
48
55
  *
49
56
  * @param shader - The Shader to be transformed
50
- * @param input - if null, it will use the dynamic source image
57
+ * @param dither - Whether to apply dithering to the shader
58
+ * @param cropRect - Optional rectangle that crops the input and output
51
59
  */
52
- MakeShader(shader: SkShader, input: SkImageFilter | null): SkImageFilter;
60
+ MakeShader(
61
+ shader: SkShader,
62
+ dither?: boolean,
63
+ cropRect?: SkRect | null
64
+ ): SkImageFilter;
53
65
  /**
54
66
  * Create a filter that blurs its input by the separate X and Y sigmas. The provided tile mode
55
67
  * is used when the blur kernel goes outside the input image.
56
68
  *
57
69
  * @param sigmaX - The Gaussian sigma value for blurring along the X axis.
58
70
  * @param sigmaY - The Gaussian sigma value for blurring along the Y axis.
59
- * @param mode
71
+ * @param mode - The tile mode to use when blur kernel goes outside the image
60
72
  * @param input - if null, it will use the dynamic source image (e.g. a saved layer)
73
+ * @param cropRect - Optional rectangle that crops the input and output
61
74
  */
62
75
  MakeBlur(
63
76
  sigmaX: number,
64
77
  sigmaY: number,
65
78
  mode: TileMode,
66
- input: SkImageFilter | null
79
+ input?: SkImageFilter | null,
80
+ cropRect?: SkRect | null
67
81
  ): SkImageFilter;
68
82
 
69
83
  /**
70
84
  * Create a filter that applies the color filter to the input filter results.
71
- * @param cf
85
+ *
86
+ * @param colorFilter - The color filter to apply
72
87
  * @param input - if null, it will use the dynamic source image (e.g. a saved layer)
88
+ * @param cropRect - Optional rectangle that crops the input and output
73
89
  */
74
90
  MakeColorFilter(
75
- cf: SkColorFilter,
76
- input: SkImageFilter | null
91
+ colorFilter: SkColorFilter,
92
+ input?: SkImageFilter | null,
93
+ cropRect?: SkRect | null
77
94
  ): SkImageFilter;
78
95
 
79
96
  /**
@@ -105,8 +122,8 @@ export interface ImageFilterFactory {
105
122
  sigmaX: number,
106
123
  sigmaY: number,
107
124
  color: SkColor,
108
- input: SkImageFilter | null,
109
- cropRect?: SkRect
125
+ input?: SkImageFilter | null,
126
+ cropRect?: SkRect | null
110
127
  ) => SkImageFilter;
111
128
  /**
112
129
  * Create a filter that renders a drop shadow, in exactly the same manner as ::DropShadow, except
@@ -126,8 +143,8 @@ export interface ImageFilterFactory {
126
143
  sigmaX: number,
127
144
  sigmaY: number,
128
145
  color: SkColor,
129
- input: SkImageFilter | null,
130
- cropRect?: SkRect
146
+ input?: SkImageFilter | null,
147
+ cropRect?: SkRect | null
131
148
  ) => SkImageFilter;
132
149
  /**
133
150
  * Create a filter that erodes each input pixel's channel values to the minimum channel value
@@ -140,8 +157,8 @@ export interface ImageFilterFactory {
140
157
  MakeErode: (
141
158
  rx: number,
142
159
  ry: number,
143
- input: SkImageFilter | null,
144
- cropRect?: SkRect
160
+ input?: SkImageFilter | null,
161
+ cropRect?: SkRect | null
145
162
  ) => SkImageFilter;
146
163
  /**
147
164
  * Create a filter that dilates each input pixel's channel values to the max value within the
@@ -154,21 +171,21 @@ export interface ImageFilterFactory {
154
171
  MakeDilate: (
155
172
  rx: number,
156
173
  ry: number,
157
- input: SkImageFilter | null,
158
- cropRect?: SkRect
174
+ input?: SkImageFilter | null,
175
+ cropRect?: SkRect | null
159
176
  ) => SkImageFilter;
160
177
  /**
161
178
  * This filter takes an SkBlendMode and uses it to composite the two filters together.
162
179
  * @param mode The blend mode that defines the compositing operation
163
180
  * @param background The Dst pixels used in blending, if null the source bitmap is used.
164
181
  * @param foreground The Src pixels used in blending, if null the source bitmap is used.
165
- * @cropRect Optional rectangle to crop input and output.
182
+ * @param cropRect Optional rectangle to crop input and output.
166
183
  */
167
184
  MakeBlend: (
168
185
  mode: BlendMode,
169
186
  background: SkImageFilter,
170
- foreground: SkImageFilter | null,
171
- cropRect?: SkRect
187
+ foreground?: SkImageFilter | null,
188
+ cropRect?: SkRect | null
172
189
  ) => SkImageFilter;
173
190
  /**
174
191
  * Create a filter that fills the output with the per-pixel evaluation of the SkShader produced
@@ -187,6 +204,359 @@ export interface ImageFilterFactory {
187
204
  MakeRuntimeShader: (
188
205
  builder: SkRuntimeShaderBuilder,
189
206
  childShaderName: string | null,
190
- input: SkImageFilter | null
207
+ input?: SkImageFilter | null
208
+ ) => SkImageFilter;
209
+
210
+ /**
211
+ * Create a filter that implements a custom blend mode. Each output pixel is the result of
212
+ * combining the corresponding background and foreground pixels using the 4 coefficients:
213
+ * k1 * foreground * background + k2 * foreground + k3 * background + k4
214
+ *
215
+ * @param k1, k2, k3, k4 The four coefficients used to combine the foreground and background.
216
+ * @param enforcePMColor If true, the RGB channels will be clamped to the calculated alpha.
217
+ * @param background The background content, using the source bitmap when this is null.
218
+ * @param foreground The foreground content, using the source bitmap when this is null.
219
+ * @param cropRect Optional rectangle that crops the inputs and output.
220
+ */
221
+ MakeArithmetic(
222
+ k1: number,
223
+ k2: number,
224
+ k3: number,
225
+ k4: number,
226
+ enforcePMColor: boolean,
227
+ background?: SkImageFilter | null,
228
+ foreground?: SkImageFilter | null,
229
+ cropRect?: SkRect | null
230
+ ): SkImageFilter;
231
+
232
+ /**
233
+ * Create a filter that applies a crop to the result of the 'input' filter. Pixels within the
234
+ * crop rectangle are unmodified from what 'input' produced. Pixels outside of crop match the
235
+ * provided SkTileMode (defaulting to kDecal).
236
+ *
237
+ * NOTE: The optional CropRect argument for many of the factories is equivalent to creating the
238
+ * filter without a CropRect and then wrapping it in ::Crop(rect, kDecal). Explicitly adding
239
+ * Crop filters lets you control their tiling and use different geometry for the input and the
240
+ * output of another filter.
241
+ *
242
+ * @param rect The cropping rect
243
+ * @param tileMode The TileMode applied to pixels *outside* of 'crop' @default TileMode.Decal
244
+ * @param input The input filter that is cropped, uses source image if this is null
245
+ */
246
+ MakeCrop(
247
+ rect: SkRect,
248
+ tileMode?: TileMode | null,
249
+ input?: SkImageFilter | null
250
+ ): SkImageFilter;
251
+
252
+ /**
253
+ * Create a filter that always produces transparent black.
254
+ */
255
+ MakeEmpty(): SkImageFilter;
256
+
257
+ /**
258
+ * Create a filter that draws the 'srcRect' portion of image into 'dstRect' using the given
259
+ * filter quality. Similar to SkCanvas::drawImageRect. The returned image filter evaluates
260
+ * to transparent black if 'image' is null.
261
+ *
262
+ * @param image The image that is output by the filter, subset by 'srcRect'.
263
+ * @param srcRect The source pixels sampled into 'dstRect', if null the image bounds are used.
264
+ * @param dstRect The local rectangle to draw the image into, if null the srcRect is used.
265
+ * @param filterMode The filter mode to use when sampling the image @default FilterMode.Nearest
266
+ * @param mipmap The mipmap mode to use when sampling the image @default MipmapMode.None
267
+ */
268
+ MakeImage(
269
+ image: SkImage,
270
+ srcRect?: SkRect | null,
271
+ dstRect?: SkRect | null,
272
+ filterMode?: FilterMode,
273
+ mipmap?: MipmapMode
274
+ ): SkImageFilter;
275
+
276
+ /**
277
+ * Create a filter that fills 'lensBounds' with a magnification of the input.
278
+ *
279
+ * @param lensBounds The outer bounds of the magnifier effect
280
+ * @param zoomAmount The amount of magnification applied to the input image
281
+ * @param inset The size or width of the fish-eye distortion around the magnified content
282
+ * @param filterMode The filter mode to use when sampling the image @default FilterMode.Nearest
283
+ * @param mipmap The mipmap mode to use when sampling the image @default MipmapMode.None
284
+ * @param input The input filter that is magnified; if null the source bitmap is used
285
+ * @param cropRect Optional rectangle that crops the input and output.
286
+ */
287
+ MakeMagnifier(
288
+ lensBounds: SkRect,
289
+ zoomAmount: number,
290
+ inset: number,
291
+ filterMode?: FilterMode,
292
+ mipmap?: MipmapMode,
293
+ input?: SkImageFilter | null,
294
+ cropRect?: SkRect | null
295
+ ): SkImageFilter;
296
+
297
+ /**
298
+ * Create a filter that applies an NxM image processing kernel to the input image. This can be
299
+ * used to produce effects such as sharpening, blurring, edge detection, etc.
300
+ * @param kernelSizeX The width of the kernel. Must be greater than zero.
301
+ * @param kernelSizeY The height of the kernel. Must be greater than zero.
302
+ * @param kernel The image processing kernel. Must contain kernelSizeX * kernelSizeY elements, in row order.
303
+ * @param gain A scale factor applied to each pixel after convolution. This can be
304
+ * used to normalize the kernel, if it does not already sum to 1.
305
+ * @param bias A bias factor added to each pixel after convolution.
306
+ * @param kernelOffsetX An offset applied to each pixel coordinate before convolution.
307
+ * This can be used to center the kernel over the image
308
+ * (e.g., a 3x3 kernel should have an offset of {1, 1}).
309
+ * @param kernelOffsetY An offset applied to each pixel coordinate before convolution.
310
+ * This can be used to center the kernel over the image
311
+ * (e.g., a 3x3 kernel should have an offset of {1, 1}).
312
+ * @param tileMode How accesses outside the image are treated. TileMode.Mirror is not supported.
313
+ * @param convolveAlpha If true, all channels are convolved. If false, only the RGB channels
314
+ * are convolved, and alpha is copied from the source image.
315
+ * @param input The input image filter, if null the source bitmap is used instead.
316
+ * @param cropRect Optional rectangle to which the output processing will be limited.
317
+ */
318
+ MakeMatrixConvolution(
319
+ kernelSizeX: number,
320
+ kernelSizeY: number,
321
+ kernel: number[],
322
+ gain: number,
323
+ bias: number,
324
+ kernelOffsetX: number,
325
+ kernelOffsetY: number,
326
+ tileMode: TileMode,
327
+ convolveAlpha: boolean,
328
+ input?: SkImageFilter | null,
329
+ cropRect?: SkRect | null
330
+ ): SkImageFilter;
331
+
332
+ /**
333
+ * Create a filter that transforms the input image by 'matrix'. This matrix transforms the
334
+ * local space, which means it effectively happens prior to any transformation coming from the
335
+ * SkCanvas initiating the filtering.
336
+ * @param matrix The matrix to apply to the original content.
337
+ * @param filterMode The filter mode to use when sampling the image @default FilterMode.Nearest
338
+ * @param mipmap The mipmap mode to use when sampling the image @default MipmapMode.None
339
+ * @param input The image filter to transform, or null to use the source image.
340
+ */
341
+ MakeMatrixTransform(
342
+ matrix: SkMatrix,
343
+ filterMode?: FilterMode,
344
+ mipmap?: MipmapMode,
345
+ input?: SkImageFilter | null
346
+ ): SkImageFilter;
347
+
348
+ /**
349
+ * Create a filter that merges filters together by drawing their results in order
350
+ * with src-over blending.
351
+ * @param filters The input filter array to merge. Any null
352
+ * filter pointers will use the source bitmap instead.
353
+ * @param cropRect Optional rectangle that crops all input filters and the output.
354
+ */
355
+ MakeMerge(
356
+ filters: Array<SkImageFilter | null>,
357
+ cropRect?: SkRect | null
358
+ ): SkImageFilter;
359
+
360
+ /**
361
+ * Create a filter that produces the SkPicture as its output, clipped to both 'targetRect' and
362
+ * the picture's internal cull rect.
363
+ *
364
+ * If 'pic' is null, the returned image filter produces transparent black.
365
+ *
366
+ * @param picture The picture that is drawn for the filter output.
367
+ * @param targetRect The drawing region for the picture. If null, the picture's bounds are used.
368
+ */
369
+ MakePicture(picture: SkPicture, targetRect?: SkRect | null): SkImageFilter;
370
+
371
+ /**
372
+ * Create a filter that fills the output with the per-pixel evaluation of the SkShader produced
373
+ * by the SkRuntimeEffectBuilder. The shader is defined in the image filter's local coordinate
374
+ * system, so it will automatically be affected by SkCanvas' transform.
375
+ *
376
+ * This requires a GPU backend or SkSL to be compiled in.
377
+ *
378
+ * @param builder The builder used to produce the runtime shader, that will in turn
379
+ * fill the result image
380
+ * @param sampleRadius defines the sampling radius of 'childShaderName' relative to
381
+ * the runtime shader produced by 'builder'.
382
+ * If greater than 0, the coordinate passed to childShader.eval() will
383
+ * be up to 'sampleRadius' away (maximum absolute offset in 'x' or 'y')
384
+ * from the coordinate passed into the runtime shader.
385
+ * @param childShaderNames The names of the child shaders defined in the builder that will be
386
+ * bound to the input params (or the source image if the input param
387
+ * is null). If any name is null, or appears more than once, factory
388
+ * fails and returns nullptr.
389
+ * @param inputs The image filters that will be provided as input to the runtime
390
+ * shader. If any are null, the implicit source image is used instead.
391
+ */
392
+ MakeRuntimeShaderWithChildren: (
393
+ builder: SkRuntimeShaderBuilder,
394
+ sampleRadius: number,
395
+ childShaderNames: string[],
396
+ inputs: Array<SkImageFilter | null>
191
397
  ) => SkImageFilter;
398
+
399
+ /**
400
+ * Create a tile image filter.
401
+ * @param src Defines the pixels to tile
402
+ * @param dst Defines the pixel region that the tiles will be drawn to
403
+ * @param input The input that will be tiled, if null the source bitmap is used instead.
404
+ */
405
+ MakeTile(
406
+ src: SkRect,
407
+ dst: SkRect,
408
+ input?: SkImageFilter | null
409
+ ): SkImageFilter;
410
+
411
+ /**
412
+ * Create a filter that calculates the diffuse illumination from a distant light source,
413
+ * interpreting the alpha channel of the input as the height profile of the surface (to
414
+ * approximate normal vectors).
415
+ * @param direction The direction to the distance light.
416
+ * @param lightColor The color of the diffuse light source.
417
+ * @param surfaceScale Scale factor to transform from alpha values to physical height.
418
+ * @param kd Diffuse reflectance coefficient.
419
+ * @param input The input filter that defines surface normals (as alpha), or uses the
420
+ * source bitmap when null.
421
+ * @param cropRect Optional rectangle that crops the input and output.
422
+ */
423
+ MakeDistantLitDiffuse(
424
+ direction: SkPoint3,
425
+ lightColor: SkColor,
426
+ surfaceScale: number,
427
+ kd: number,
428
+ input?: SkImageFilter | null,
429
+ cropRect?: SkRect | null
430
+ ): SkImageFilter;
431
+
432
+ /**
433
+ * Create a filter that calculates the diffuse illumination from a point light source, using
434
+ * alpha channel of the input as the height profile of the surface (to approximate normal
435
+ * vectors).
436
+ * @param location The location of the point light.
437
+ * @param lightColor The color of the diffuse light source.
438
+ * @param surfaceScale Scale factor to transform from alpha values to physical height.
439
+ * @param kd Diffuse reflectance coefficient.
440
+ * @param input The input filter that defines surface normals (as alpha), or uses the
441
+ * source bitmap when null.
442
+ * @param cropRect Optional rectangle that crops the input and output.
443
+ */
444
+ MakePointLitDiffuse(
445
+ location: SkPoint3,
446
+ lightColor: SkColor,
447
+ surfaceScale: number,
448
+ kd: number,
449
+ input?: SkImageFilter | null,
450
+ cropRect?: SkRect | null
451
+ ): SkImageFilter;
452
+
453
+ /**
454
+ * Create a filter that calculates the diffuse illumination from a spot light source, using
455
+ * alpha channel of the input as the height profile of the surface (to approximate normal
456
+ * vectors). The spot light is restricted to be within 'cutoffAngle' of the vector between
457
+ * the location and target.
458
+ * @param location The location of the spot light.
459
+ * @param target The location that the spot light is point towards
460
+ * @param falloffExponent Exponential falloff parameter for illumination outside of cutoffAngle
461
+ * @param cutoffAngle Maximum angle from lighting direction that receives full light
462
+ * @param lightColor The color of the diffuse light source.
463
+ * @param surfaceScale Scale factor to transform from alpha values to physical height.
464
+ * @param kd Diffuse reflectance coefficient.
465
+ * @param input The input filter that defines surface normals (as alpha), or uses the
466
+ * source bitmap when null.
467
+ * @param cropRect Optional rectangle that crops the input and output.
468
+ */
469
+ MakeSpotLitDiffuse(
470
+ location: SkPoint3,
471
+ target: SkPoint3,
472
+ falloffExponent: number,
473
+ cutoffAngle: number,
474
+ lightColor: SkColor,
475
+ surfaceScale: number,
476
+ kd: number,
477
+ input?: SkImageFilter | null,
478
+ cropRect?: SkRect | null
479
+ ): SkImageFilter;
480
+
481
+ /**
482
+ * Create a filter that calculates the specular illumination from a distant light source,
483
+ * interpreting the alpha channel of the input as the height profile of the surface (to
484
+ * approximate normal vectors).
485
+ * @param direction The direction to the distance light.
486
+ * @param lightColor The color of the specular light source.
487
+ * @param surfaceScale Scale factor to transform from alpha values to physical height.
488
+ * @param ks Specular reflectance coefficient.
489
+ * @param shininess The specular exponent determining how shiny the surface is.
490
+ * @param input The input filter that defines surface normals (as alpha), or uses the
491
+ * source bitmap when null.
492
+ * @param cropRect Optional rectangle that crops the input and output.
493
+ */
494
+ MakeDistantLitSpecular(
495
+ direction: SkPoint3,
496
+ lightColor: SkColor,
497
+ surfaceScale: number,
498
+ ks: number,
499
+ shininess: number,
500
+ input?: SkImageFilter | null,
501
+ cropRect?: SkRect | null
502
+ ): SkImageFilter;
503
+
504
+ /**
505
+ * Create a filter that calculates the specular illumination from a point light source, using
506
+ * alpha channel of the input as the height profile of the surface (to approximate normal
507
+ * vectors).
508
+ * @param location The location of the point light.
509
+ * @param lightColor The color of the specular light source.
510
+ * @param surfaceScale Scale factor to transform from alpha values to physical height.
511
+ * @param ks Specular reflectance coefficient.
512
+ * @param shininess The specular exponent determining how shiny the surface is.
513
+ * @param input The input filter that defines surface normals (as alpha), or uses the
514
+ * source bitmap when null.
515
+ * @param cropRect Optional rectangle that crops the input and output.
516
+ */
517
+ MakePointLitSpecular(
518
+ location: SkPoint3,
519
+ lightColor: SkColor,
520
+ surfaceScale: number,
521
+ ks: number,
522
+ shininess: number,
523
+ input?: SkImageFilter | null,
524
+ cropRect?: SkRect | null
525
+ ): SkImageFilter;
526
+
527
+ /**
528
+ * Create a filter that calculates the specular illumination from a spot light source, using
529
+ * alpha channel of the input as the height profile of the surface (to approximate normal
530
+ * vectors). The spot light is restricted to be within 'cutoffAngle' of the vector between
531
+ * the location and target.
532
+ * @param location The location of the spot light.
533
+ * @param target The location that the spot light is point towards
534
+ * @param falloffExponent Exponential falloff parameter for illumination outside of cutoffAngle
535
+ * @param cutoffAngle Maximum angle from lighting direction that receives full light
536
+ * @param lightColor The color of the specular light source.
537
+ * @param surfaceScale Scale factor to transform from alpha values to physical height.
538
+ * @param ks Specular reflectance coefficient.
539
+ * @param shininess The specular exponent determining how shiny the surface is.
540
+ * @param input The input filter that defines surface normals (as alpha), or uses the
541
+ * source bitmap when null.
542
+ * @param cropRect Optional rectangle that crops the input and output.
543
+ */
544
+ MakeSpotLitSpecular(
545
+ location: SkPoint3,
546
+ target: SkPoint3,
547
+ falloffExponent: number,
548
+ cutoffAngle: number,
549
+ lightColor: SkColor,
550
+ surfaceScale: number,
551
+ ks: number,
552
+ shininess: number,
553
+ input?: SkImageFilter | null,
554
+ cropRect?: SkRect | null
555
+ ): SkImageFilter;
192
556
  }
557
+
558
+ export type SkPoint3 = {
559
+ x: number;
560
+ y: number;
561
+ z: number;
562
+ };