@shopify/react-native-skia 0.1.234 → 0.1.237

Sign up to get free protection for your applications and to get access to all the features.
Files changed (425) hide show
  1. package/cpp/api/JsiSkApi.h +2 -0
  2. package/cpp/api/JsiSkCanvas.h +36 -0
  3. package/cpp/api/JsiSkRSXform.h +35 -7
  4. package/cpp/api/JsiSkTypefaceFactory.h +2 -1
  5. package/cpp/rnskia/dom/JsiDomApi.h +2 -0
  6. package/cpp/rnskia/dom/nodes/JsiAtlasNode.h +60 -0
  7. package/cpp/rnskia/dom/props/RSXformProp.h +52 -0
  8. package/cpp/rnskia/dom/props/RectProp.h +31 -0
  9. package/cpp/skia/include/android/AHardwareBufferUtils.h +23 -0
  10. package/cpp/skia/include/android/GrAHardwareBufferUtils.h +2 -0
  11. package/cpp/skia/include/android/graphite/SurfaceAndroid.h +59 -0
  12. package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
  13. package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
  14. package/cpp/skia/include/codec/SkCodec.h +21 -3
  15. package/cpp/skia/include/codec/SkGifDecoder.h +1 -1
  16. package/cpp/skia/include/codec/SkIcoDecoder.h +1 -1
  17. package/cpp/skia/include/codec/SkJpegDecoder.h +1 -1
  18. package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -1
  19. package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
  20. package/cpp/skia/include/codec/SkRawDecoder.h +1 -1
  21. package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -1
  22. package/cpp/skia/include/codec/SkWebpDecoder.h +1 -1
  23. package/cpp/skia/include/config/SkUserConfig.h +3 -1
  24. package/cpp/skia/include/core/SkCanvas.h +66 -37
  25. package/cpp/skia/include/core/SkColorFilter.h +5 -2
  26. package/cpp/skia/include/core/SkContourMeasure.h +1 -0
  27. package/cpp/skia/include/core/SkDocument.h +1 -0
  28. package/cpp/skia/include/core/SkFont.h +14 -24
  29. package/cpp/skia/include/core/SkFontArguments.h +1 -1
  30. package/cpp/skia/include/core/SkFontMetrics.h +1 -1
  31. package/cpp/skia/include/core/SkFontMgr.h +0 -7
  32. package/cpp/skia/include/core/SkGraphics.h +13 -0
  33. package/cpp/skia/include/core/SkMesh.h +9 -13
  34. package/cpp/skia/include/core/SkMilestone.h +1 -1
  35. package/cpp/skia/include/core/SkPathMeasure.h +2 -0
  36. package/cpp/skia/include/core/SkSerialProcs.h +29 -11
  37. package/cpp/skia/include/core/SkSize.h +3 -3
  38. package/cpp/skia/include/core/SkStream.h +3 -13
  39. package/cpp/skia/include/core/SkSurface.h +6 -3
  40. package/cpp/skia/include/core/SkSurfaceProps.h +2 -4
  41. package/cpp/skia/include/core/SkTraceMemoryDump.h +15 -0
  42. package/cpp/skia/include/core/SkTypeface.h +8 -56
  43. package/cpp/skia/include/core/SkTypes.h +8 -0
  44. package/cpp/skia/include/core/SkVertices.h +1 -1
  45. package/cpp/skia/include/docs/SkMultiPictureDocument.h +53 -0
  46. package/cpp/skia/include/docs/SkPDFDocument.h +11 -0
  47. package/cpp/skia/include/effects/SkGradientShader.h +9 -0
  48. package/cpp/skia/include/effects/SkRuntimeEffect.h +3 -7
  49. package/cpp/skia/include/gpu/GrBackendSemaphore.h +33 -47
  50. package/cpp/skia/include/gpu/GrBackendSurface.h +2 -3
  51. package/cpp/skia/include/gpu/GrContextOptions.h +0 -6
  52. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +44 -28
  53. package/cpp/skia/include/gpu/GrDirectContext.h +12 -31
  54. package/cpp/skia/include/gpu/GrTypes.h +1 -16
  55. package/cpp/skia/include/gpu/MutableTextureState.h +35 -80
  56. package/cpp/skia/include/gpu/ShaderErrorHandler.h +11 -1
  57. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +2 -2
  58. package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
  59. package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +3 -2
  60. package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
  61. package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +30 -0
  62. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  63. package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -0
  64. package/cpp/skia/include/gpu/gl/glx/GrGLMakeGLXInterface.h +6 -0
  65. package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +3 -3
  66. package/cpp/skia/include/gpu/graphite/BackendTexture.h +39 -27
  67. package/cpp/skia/include/gpu/graphite/Context.h +39 -13
  68. package/cpp/skia/include/gpu/graphite/ContextOptions.h +2 -0
  69. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +2 -1
  70. package/cpp/skia/include/gpu/graphite/Image.h +106 -87
  71. package/cpp/skia/include/gpu/graphite/Recorder.h +24 -3
  72. package/cpp/skia/include/gpu/graphite/Surface.h +7 -2
  73. package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +41 -2
  74. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +11 -6
  75. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -2
  76. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +6 -6
  77. package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -0
  78. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  79. package/cpp/skia/include/gpu/vk/GrVkTypes.h +1 -44
  80. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +1 -1
  81. package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +25 -0
  82. package/cpp/skia/include/gpu/vk/VulkanTypes.h +44 -0
  83. package/cpp/skia/include/ports/SkFontConfigInterface.h +3 -6
  84. package/cpp/skia/include/private/SkEncodedInfo.h +5 -0
  85. package/cpp/skia/include/private/SkExif.h +102 -0
  86. package/cpp/skia/include/private/SkGainmapInfo.h +11 -1
  87. package/cpp/skia/include/private/base/SkAssert.h +16 -0
  88. package/cpp/skia/include/private/base/SkDeque.h +2 -7
  89. package/cpp/skia/include/private/base/SkLoadUserConfig.h +1 -1
  90. package/cpp/skia/include/private/base/SkTArray.h +69 -28
  91. package/cpp/skia/include/private/base/SkThreadAnnotations.h +18 -5
  92. package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +26 -30
  93. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +4 -3
  94. package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
  95. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +8 -6
  96. package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +29 -0
  97. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +12 -9
  98. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +16 -11
  99. package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +2 -2
  100. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
  101. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
  102. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
  103. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
  104. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
  105. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +9 -2
  106. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +31 -3
  107. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +10624 -5716
  108. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +2 -1
  109. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +2 -1
  110. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +28 -1
  111. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +2 -1
  112. package/cpp/skia/include/utils/mac/SkCGUtils.h +23 -11
  113. package/cpp/skia/modules/skcms/skcms.h +2 -410
  114. package/cpp/skia/modules/skcms/src/Transform_inl.h +831 -704
  115. package/cpp/skia/modules/skcms/src/skcms_Transform.h +161 -0
  116. package/cpp/skia/modules/skcms/src/skcms_internals.h +136 -0
  117. package/cpp/skia/modules/skcms/src/skcms_public.h +404 -0
  118. package/cpp/skia/modules/skparagraph/include/FontArguments.h +1 -1
  119. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -0
  120. package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -2
  121. package/cpp/skia/modules/skparagraph/include/TextStyle.h +4 -3
  122. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -3
  123. package/cpp/skia/modules/skresources/include/SkResources.h +28 -17
  124. package/cpp/skia/modules/skunicode/include/SkUnicode.h +12 -0
  125. package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -1
  126. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +4 -1
  127. package/cpp/skia/src/base/SkUTF.h +7 -0
  128. package/cpp/skia/src/core/SkTHash.h +20 -8
  129. package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +5 -3
  130. package/lib/commonjs/dom/nodes/JsiSkDOM.js +60 -57
  131. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  132. package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  133. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +47 -0
  134. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +1 -0
  135. package/lib/commonjs/dom/nodes/drawings/index.d.ts +1 -0
  136. package/lib/commonjs/dom/nodes/drawings/index.js +13 -0
  137. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
  138. package/lib/commonjs/dom/types/Drawings.d.ts +7 -1
  139. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  140. package/lib/commonjs/dom/types/NodeType.d.ts +1 -0
  141. package/lib/commonjs/dom/types/NodeType.js +1 -0
  142. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  143. package/lib/commonjs/dom/types/SkDOM.d.ts +2 -1
  144. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  145. package/lib/commonjs/external/reanimated/buffers.d.ts +5 -0
  146. package/lib/commonjs/external/reanimated/buffers.js +48 -0
  147. package/lib/commonjs/external/reanimated/buffers.js.map +1 -0
  148. package/lib/commonjs/external/reanimated/index.d.ts +2 -0
  149. package/lib/commonjs/external/reanimated/index.js +26 -0
  150. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  151. package/lib/commonjs/external/reanimated/interpolators.js +13 -1
  152. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  153. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +1 -0
  154. package/lib/commonjs/external/reanimated/moduleWrapper.js +5 -3
  155. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  156. package/lib/commonjs/external/reanimated/textures.d.ts +5 -0
  157. package/lib/commonjs/external/reanimated/textures.js +38 -0
  158. package/lib/commonjs/external/reanimated/textures.js.map +1 -0
  159. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +8 -1
  160. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
  161. package/lib/commonjs/headless/index.js +1 -1
  162. package/lib/commonjs/headless/index.js.map +1 -1
  163. package/lib/commonjs/mock/index.js +8 -0
  164. package/lib/commonjs/mock/index.js.map +1 -1
  165. package/lib/commonjs/renderer/Canvas.js +1 -1
  166. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  167. package/lib/commonjs/renderer/Container.d.ts +1 -1
  168. package/lib/commonjs/renderer/Container.js +2 -1
  169. package/lib/commonjs/renderer/Container.js.map +1 -1
  170. package/lib/commonjs/renderer/HostComponents.d.ts +3 -1
  171. package/lib/commonjs/renderer/HostComponents.js +3 -0
  172. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  173. package/lib/commonjs/renderer/Offscreen.d.ts +4 -1
  174. package/lib/commonjs/renderer/Offscreen.js +28 -10
  175. package/lib/commonjs/renderer/Offscreen.js.map +1 -1
  176. package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
  177. package/lib/commonjs/renderer/Reconciler.js +7 -4
  178. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  179. package/lib/commonjs/renderer/components/shapes/Atlas.d.ts +4 -0
  180. package/lib/commonjs/renderer/components/shapes/Atlas.js +17 -0
  181. package/lib/commonjs/renderer/components/shapes/Atlas.js.map +1 -0
  182. package/lib/commonjs/renderer/components/shapes/index.d.ts +1 -0
  183. package/lib/commonjs/renderer/components/shapes/index.js +13 -0
  184. package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
  185. package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
  186. package/lib/commonjs/skia/core/AnimatedImage.js +4 -1
  187. package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
  188. package/lib/commonjs/skia/core/Data.d.ts +1 -1
  189. package/lib/commonjs/skia/core/Data.js +11 -4
  190. package/lib/commonjs/skia/core/Data.js.map +1 -1
  191. package/lib/commonjs/skia/core/Rect.d.ts +2 -2
  192. package/lib/commonjs/skia/types/Canvas.d.ts +16 -1
  193. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  194. package/lib/commonjs/skia/types/Image/Image.d.ts +8 -0
  195. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  196. package/lib/commonjs/skia/types/Matrix4.d.ts +2 -2
  197. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  198. package/lib/commonjs/skia/types/RSXform.d.ts +7 -1
  199. package/lib/commonjs/skia/types/RSXform.js.map +1 -1
  200. package/lib/commonjs/skia/types/Rect.d.ts +4 -0
  201. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  202. package/lib/commonjs/skia/types/Shader/Shader.d.ts +1 -1
  203. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  204. package/lib/commonjs/skia/types/Skia.d.ts +3 -2
  205. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  206. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +2 -1
  207. package/lib/commonjs/skia/web/JsiSkCanvas.js +19 -0
  208. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  209. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +8 -2
  210. package/lib/commonjs/skia/web/JsiSkRSXform.js +33 -2
  211. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  212. package/lib/commonjs/skia/web/JsiSkRect.d.ts +3 -2
  213. package/lib/commonjs/skia/web/JsiSkRect.js +7 -0
  214. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  215. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +2 -1
  216. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  217. package/lib/commonjs/skia/web/JsiSkia.js +5 -0
  218. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  219. package/lib/module/dom/nodes/JsiSkDOM.d.ts +5 -3
  220. package/lib/module/dom/nodes/JsiSkDOM.js +61 -57
  221. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  222. package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  223. package/lib/module/dom/nodes/drawings/AtlasNode.js +34 -0
  224. package/lib/module/dom/nodes/drawings/AtlasNode.js.map +1 -0
  225. package/lib/module/dom/nodes/drawings/index.d.ts +1 -0
  226. package/lib/module/dom/nodes/drawings/index.js +1 -0
  227. package/lib/module/dom/nodes/drawings/index.js.map +1 -1
  228. package/lib/module/dom/types/Drawings.d.ts +7 -1
  229. package/lib/module/dom/types/Drawings.js.map +1 -1
  230. package/lib/module/dom/types/NodeType.d.ts +1 -0
  231. package/lib/module/dom/types/NodeType.js +1 -0
  232. package/lib/module/dom/types/NodeType.js.map +1 -1
  233. package/lib/module/dom/types/SkDOM.d.ts +2 -1
  234. package/lib/module/dom/types/SkDOM.js.map +1 -1
  235. package/lib/module/external/reanimated/buffers.d.ts +5 -0
  236. package/lib/module/external/reanimated/buffers.js +27 -0
  237. package/lib/module/external/reanimated/buffers.js.map +1 -0
  238. package/lib/module/external/reanimated/index.d.ts +2 -0
  239. package/lib/module/external/reanimated/index.js +2 -0
  240. package/lib/module/external/reanimated/index.js.map +1 -1
  241. package/lib/module/external/reanimated/interpolators.js +13 -1
  242. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  243. package/lib/module/external/reanimated/moduleWrapper.d.ts +1 -0
  244. package/lib/module/external/reanimated/moduleWrapper.js +3 -2
  245. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  246. package/lib/module/external/reanimated/textures.d.ts +5 -0
  247. package/lib/module/external/reanimated/textures.js +24 -0
  248. package/lib/module/external/reanimated/textures.js.map +1 -0
  249. package/lib/module/external/reanimated/useAnimatedImageValue.js +7 -1
  250. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  251. package/lib/module/headless/index.js +1 -1
  252. package/lib/module/headless/index.js.map +1 -1
  253. package/lib/module/mock/index.js +8 -0
  254. package/lib/module/mock/index.js.map +1 -1
  255. package/lib/module/renderer/Canvas.js +1 -1
  256. package/lib/module/renderer/Canvas.js.map +1 -1
  257. package/lib/module/renderer/Container.d.ts +1 -1
  258. package/lib/module/renderer/Container.js +2 -1
  259. package/lib/module/renderer/Container.js.map +1 -1
  260. package/lib/module/renderer/HostComponents.d.ts +3 -1
  261. package/lib/module/renderer/HostComponents.js +3 -0
  262. package/lib/module/renderer/HostComponents.js.map +1 -1
  263. package/lib/module/renderer/Offscreen.d.ts +4 -1
  264. package/lib/module/renderer/Offscreen.js +19 -9
  265. package/lib/module/renderer/Offscreen.js.map +1 -1
  266. package/lib/module/renderer/Reconciler.d.ts +1 -1
  267. package/lib/module/renderer/Reconciler.js +7 -4
  268. package/lib/module/renderer/Reconciler.js.map +1 -1
  269. package/lib/module/renderer/components/shapes/Atlas.d.ts +4 -0
  270. package/lib/module/renderer/components/shapes/Atlas.js +5 -0
  271. package/lib/module/renderer/components/shapes/Atlas.js.map +1 -0
  272. package/lib/module/renderer/components/shapes/index.d.ts +1 -0
  273. package/lib/module/renderer/components/shapes/index.js +1 -0
  274. package/lib/module/renderer/components/shapes/index.js.map +1 -1
  275. package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
  276. package/lib/module/skia/core/AnimatedImage.js +4 -1
  277. package/lib/module/skia/core/AnimatedImage.js.map +1 -1
  278. package/lib/module/skia/core/Data.d.ts +1 -1
  279. package/lib/module/skia/core/Data.js +11 -4
  280. package/lib/module/skia/core/Data.js.map +1 -1
  281. package/lib/module/skia/core/Rect.d.ts +2 -2
  282. package/lib/module/skia/types/Canvas.d.ts +16 -1
  283. package/lib/module/skia/types/Canvas.js.map +1 -1
  284. package/lib/module/skia/types/Image/Image.d.ts +8 -0
  285. package/lib/module/skia/types/Image/Image.js.map +1 -1
  286. package/lib/module/skia/types/Matrix4.d.ts +2 -2
  287. package/lib/module/skia/types/Matrix4.js.map +1 -1
  288. package/lib/module/skia/types/RSXform.d.ts +7 -1
  289. package/lib/module/skia/types/RSXform.js.map +1 -1
  290. package/lib/module/skia/types/Rect.d.ts +4 -0
  291. package/lib/module/skia/types/Rect.js.map +1 -1
  292. package/lib/module/skia/types/Shader/Shader.d.ts +1 -1
  293. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  294. package/lib/module/skia/types/Skia.d.ts +3 -2
  295. package/lib/module/skia/types/Skia.js.map +1 -1
  296. package/lib/module/skia/web/JsiSkCanvas.d.ts +2 -1
  297. package/lib/module/skia/web/JsiSkCanvas.js +18 -0
  298. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  299. package/lib/module/skia/web/JsiSkRSXform.d.ts +8 -2
  300. package/lib/module/skia/web/JsiSkRSXform.js +34 -3
  301. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  302. package/lib/module/skia/web/JsiSkRect.d.ts +3 -2
  303. package/lib/module/skia/web/JsiSkRect.js +7 -0
  304. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  305. package/lib/module/skia/web/JsiSkTextBlobFactory.js +2 -1
  306. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  307. package/lib/module/skia/web/JsiSkia.js +5 -0
  308. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  309. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +5 -3
  310. package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  311. package/lib/typescript/src/dom/nodes/drawings/index.d.ts +1 -0
  312. package/lib/typescript/src/dom/types/Drawings.d.ts +7 -1
  313. package/lib/typescript/src/dom/types/NodeType.d.ts +1 -0
  314. package/lib/typescript/src/dom/types/SkDOM.d.ts +2 -1
  315. package/lib/typescript/src/external/reanimated/buffers.d.ts +5 -0
  316. package/lib/typescript/src/external/reanimated/index.d.ts +2 -0
  317. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +1 -0
  318. package/lib/typescript/src/external/reanimated/textures.d.ts +5 -0
  319. package/lib/typescript/src/renderer/Container.d.ts +1 -1
  320. package/lib/typescript/src/renderer/HostComponents.d.ts +3 -1
  321. package/lib/typescript/src/renderer/Offscreen.d.ts +4 -1
  322. package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
  323. package/lib/typescript/src/renderer/components/shapes/Atlas.d.ts +4 -0
  324. package/lib/typescript/src/renderer/components/shapes/index.d.ts +1 -0
  325. package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
  326. package/lib/typescript/src/skia/core/Data.d.ts +1 -1
  327. package/lib/typescript/src/skia/core/Rect.d.ts +2 -2
  328. package/lib/typescript/src/skia/types/Canvas.d.ts +16 -1
  329. package/lib/typescript/src/skia/types/Image/Image.d.ts +8 -0
  330. package/lib/typescript/src/skia/types/Matrix4.d.ts +2 -2
  331. package/lib/typescript/src/skia/types/RSXform.d.ts +7 -1
  332. package/lib/typescript/src/skia/types/Rect.d.ts +4 -0
  333. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  334. package/lib/typescript/src/skia/types/Skia.d.ts +3 -2
  335. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +2 -1
  336. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -2
  337. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -2
  338. package/libs/android/arm64-v8a/libskia.a +0 -0
  339. package/libs/android/arm64-v8a/libskottie.a +0 -0
  340. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  341. package/libs/android/arm64-v8a/libsksg.a +0 -0
  342. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  343. package/libs/android/arm64-v8a/libskunicode.a +0 -0
  344. package/libs/android/arm64-v8a/libsvg.a +0 -0
  345. package/libs/android/armeabi-v7a/libskia.a +0 -0
  346. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  347. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  348. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  349. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  350. package/libs/android/armeabi-v7a/libskunicode.a +0 -0
  351. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  352. package/libs/android/x86/libskia.a +0 -0
  353. package/libs/android/x86/libskottie.a +0 -0
  354. package/libs/android/x86/libskparagraph.a +0 -0
  355. package/libs/android/x86/libsksg.a +0 -0
  356. package/libs/android/x86/libskshaper.a +0 -0
  357. package/libs/android/x86/libskunicode.a +0 -0
  358. package/libs/android/x86/libsvg.a +0 -0
  359. package/libs/android/x86_64/libskia.a +0 -0
  360. package/libs/android/x86_64/libskottie.a +0 -0
  361. package/libs/android/x86_64/libskparagraph.a +0 -0
  362. package/libs/android/x86_64/libsksg.a +0 -0
  363. package/libs/android/x86_64/libskshaper.a +0 -0
  364. package/libs/android/x86_64/libskunicode.a +0 -0
  365. package/libs/android/x86_64/libsvg.a +0 -0
  366. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  367. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  368. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  369. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  370. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  371. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  372. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  373. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  374. package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
  375. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  376. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  377. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  378. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  379. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  380. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  381. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  382. package/package.json +1 -1
  383. package/src/dom/nodes/JsiSkDOM.ts +63 -56
  384. package/src/dom/nodes/drawings/AtlasNode.ts +24 -0
  385. package/src/dom/nodes/drawings/index.ts +1 -0
  386. package/src/dom/types/Drawings.ts +9 -0
  387. package/src/dom/types/NodeType.ts +1 -0
  388. package/src/dom/types/SkDOM.ts +2 -0
  389. package/src/external/reanimated/buffers.ts +53 -0
  390. package/src/external/reanimated/index.ts +2 -0
  391. package/src/external/reanimated/interpolators.ts +15 -2
  392. package/src/external/reanimated/moduleWrapper.ts +1 -0
  393. package/src/external/reanimated/textures.tsx +38 -0
  394. package/src/external/reanimated/useAnimatedImageValue.ts +15 -4
  395. package/src/headless/index.ts +1 -1
  396. package/src/mock/index.ts +8 -0
  397. package/src/renderer/Canvas.tsx +1 -1
  398. package/src/renderer/Container.tsx +3 -2
  399. package/src/renderer/HostComponents.ts +6 -1
  400. package/src/renderer/Offscreen.tsx +24 -11
  401. package/src/renderer/Reconciler.tsx +5 -2
  402. package/src/renderer/components/shapes/Atlas.tsx +8 -0
  403. package/src/renderer/components/shapes/index.ts +1 -0
  404. package/src/skia/core/AnimatedImage.ts +3 -2
  405. package/src/skia/core/Data.ts +8 -4
  406. package/src/skia/types/Canvas.ts +32 -1
  407. package/src/skia/types/Image/Image.ts +10 -0
  408. package/src/skia/types/Matrix4.ts +2 -2
  409. package/src/skia/types/RSXform.ts +7 -1
  410. package/src/skia/types/Rect.ts +6 -0
  411. package/src/skia/types/Shader/Shader.ts +6 -1
  412. package/src/skia/types/Skia.ts +10 -2
  413. package/src/skia/web/JsiSkCanvas.ts +60 -23
  414. package/src/skia/web/JsiSkRSXform.ts +28 -4
  415. package/src/skia/web/JsiSkRect.ts +12 -2
  416. package/src/skia/web/JsiSkTextBlobFactory.ts +5 -5
  417. package/src/skia/web/JsiSkia.ts +15 -0
  418. package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -142
  419. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +0 -107
  420. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +0 -32
  421. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +0 -83
  422. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +0 -47
  423. package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +0 -57
  424. package/cpp/skia/include/utils/SkBase64.h +0 -53
  425. package/cpp/skia/modules/skcms/skcms_internal.h +0 -56
@@ -2,7 +2,7 @@
2
2
  #define VULKAN_IOS_H_ 1
3
3
 
4
4
  /*
5
- ** Copyright 2015-2021 The Khronos Group Inc.
5
+ ** Copyright 2015-2023 The Khronos Group Inc.
6
6
  **
7
7
  ** SPDX-License-Identifier: Apache-2.0
8
8
  */
@@ -19,6 +19,7 @@ extern "C" {
19
19
 
20
20
 
21
21
 
22
+ // VK_MVK_ios_surface is a preprocessor guard. Do not pass it to API calls.
22
23
  #define VK_MVK_ios_surface 1
23
24
  #define VK_MVK_IOS_SURFACE_SPEC_VERSION 3
24
25
  #define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface"
@@ -2,7 +2,7 @@
2
2
  #define VULKAN_MACOS_H_ 1
3
3
 
4
4
  /*
5
- ** Copyright 2015-2021 The Khronos Group Inc.
5
+ ** Copyright 2015-2023 The Khronos Group Inc.
6
6
  **
7
7
  ** SPDX-License-Identifier: Apache-2.0
8
8
  */
@@ -19,6 +19,7 @@ extern "C" {
19
19
 
20
20
 
21
21
 
22
+ // VK_MVK_macos_surface is a preprocessor guard. Do not pass it to API calls.
22
23
  #define VK_MVK_macos_surface 1
23
24
  #define VK_MVK_MACOS_SURFACE_SPEC_VERSION 3
24
25
  #define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"
@@ -2,7 +2,7 @@
2
2
  #define VULKAN_WIN32_H_ 1
3
3
 
4
4
  /*
5
- ** Copyright 2015-2021 The Khronos Group Inc.
5
+ ** Copyright 2015-2023 The Khronos Group Inc.
6
6
  **
7
7
  ** SPDX-License-Identifier: Apache-2.0
8
8
  */
@@ -19,6 +19,7 @@ extern "C" {
19
19
 
20
20
 
21
21
 
22
+ // VK_KHR_win32_surface is a preprocessor guard. Do not pass it to API calls.
22
23
  #define VK_KHR_win32_surface 1
23
24
  #define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6
24
25
  #define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface"
@@ -47,6 +48,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
47
48
  #endif
48
49
 
49
50
 
51
+ // VK_KHR_external_memory_win32 is a preprocessor guard. Do not pass it to API calls.
50
52
  #define VK_KHR_external_memory_win32 1
51
53
  #define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
52
54
  #define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32"
@@ -96,6 +98,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
96
98
  #endif
97
99
 
98
100
 
101
+ // VK_KHR_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls.
99
102
  #define VK_KHR_win32_keyed_mutex 1
100
103
  #define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1
101
104
  #define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex"
@@ -113,6 +116,7 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
113
116
 
114
117
 
115
118
 
119
+ // VK_KHR_external_semaphore_win32 is a preprocessor guard. Do not pass it to API calls.
116
120
  #define VK_KHR_external_semaphore_win32 1
117
121
  #define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1
118
122
  #define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32"
@@ -165,6 +169,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
165
169
  #endif
166
170
 
167
171
 
172
+ // VK_KHR_external_fence_win32 is a preprocessor guard. Do not pass it to API calls.
168
173
  #define VK_KHR_external_fence_win32 1
169
174
  #define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1
170
175
  #define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32"
@@ -208,6 +213,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
208
213
  #endif
209
214
 
210
215
 
216
+ // VK_NV_external_memory_win32 is a preprocessor guard. Do not pass it to API calls.
211
217
  #define VK_NV_external_memory_win32 1
212
218
  #define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
213
219
  #define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
@@ -236,6 +242,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
236
242
  #endif
237
243
 
238
244
 
245
+ // VK_NV_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls.
239
246
  #define VK_NV_win32_keyed_mutex 1
240
247
  #define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 2
241
248
  #define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
@@ -253,6 +260,7 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
253
260
 
254
261
 
255
262
 
263
+ // VK_EXT_full_screen_exclusive is a preprocessor guard. Do not pass it to API calls.
256
264
  #define VK_EXT_full_screen_exclusive 1
257
265
  #define VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION 4
258
266
  #define VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME "VK_EXT_full_screen_exclusive"
@@ -308,6 +316,25 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT(
308
316
  VkDeviceGroupPresentModeFlagsKHR* pModes);
309
317
  #endif
310
318
 
319
+
320
+ // VK_NV_acquire_winrt_display is a preprocessor guard. Do not pass it to API calls.
321
+ #define VK_NV_acquire_winrt_display 1
322
+ #define VK_NV_ACQUIRE_WINRT_DISPLAY_SPEC_VERSION 1
323
+ #define VK_NV_ACQUIRE_WINRT_DISPLAY_EXTENSION_NAME "VK_NV_acquire_winrt_display"
324
+ typedef VkResult (VKAPI_PTR *PFN_vkAcquireWinrtDisplayNV)(VkPhysicalDevice physicalDevice, VkDisplayKHR display);
325
+ typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay);
326
+
327
+ #ifndef VK_NO_PROTOTYPES
328
+ VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV(
329
+ VkPhysicalDevice physicalDevice,
330
+ VkDisplayKHR display);
331
+
332
+ VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV(
333
+ VkPhysicalDevice physicalDevice,
334
+ uint32_t deviceRelativeId,
335
+ VkDisplayKHR* pDisplay);
336
+ #endif
337
+
311
338
  #ifdef __cplusplus
312
339
  }
313
340
  #endif
@@ -2,7 +2,7 @@
2
2
  #define VULKAN_XCB_H_ 1
3
3
 
4
4
  /*
5
- ** Copyright 2015-2021 The Khronos Group Inc.
5
+ ** Copyright 2015-2023 The Khronos Group Inc.
6
6
  **
7
7
  ** SPDX-License-Identifier: Apache-2.0
8
8
  */
@@ -19,6 +19,7 @@ extern "C" {
19
19
 
20
20
 
21
21
 
22
+ // VK_KHR_xcb_surface is a preprocessor guard. Do not pass it to API calls.
22
23
  #define VK_KHR_xcb_surface 1
23
24
  #define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
24
25
  #define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"
@@ -24,6 +24,7 @@
24
24
  #endif
25
25
 
26
26
  class SkBitmap;
27
+ class SkColorSpace;
27
28
  class SkData;
28
29
  class SkPixmap;
29
30
  class SkStreamRewindable;
@@ -41,6 +42,12 @@ SK_API bool SkCreateBitmapFromCGImage(SkBitmap* dst, CGImageRef src);
41
42
 
42
43
  SK_API sk_sp<SkImage> SkMakeImageFromCGImage(CGImageRef);
43
44
 
45
+ /**
46
+ * Given a CGColorSpace, return the closest matching SkColorSpace. If no conversion is possible
47
+ * or if the input CGColorSpace is nullptr then return nullptr.
48
+ */
49
+ SK_API sk_sp<SkColorSpace> SkMakeColorSpaceFromCGColorSpace(CGColorSpaceRef);
50
+
44
51
  /**
45
52
  * Copy the pixels from src into the memory specified by info/rowBytes/dstPixels. On failure,
46
53
  * return false (e.g. ImageInfo incompatible with src).
@@ -52,25 +59,30 @@ static inline bool SkCopyPixelsFromCGImage(const SkPixmap& dst, CGImageRef src)
52
59
  }
53
60
 
54
61
  /**
55
- * Create an imageref from the specified bitmap using the specified colorspace.
56
- * If space is NULL, then CGColorSpaceCreateDeviceRGB() is used.
62
+ * Create an imageref from the specified bitmap. The color space parameter is ignored.
57
63
  */
58
64
  SK_API CGImageRef SkCreateCGImageRefWithColorspace(const SkBitmap& bm,
59
65
  CGColorSpaceRef space);
60
66
 
61
67
  /**
62
- * Create an imageref from the specified bitmap using the colorspace returned
63
- * by CGColorSpaceCreateDeviceRGB()
68
+ * Create an imageref from the specified bitmap.
64
69
  */
65
- static inline CGImageRef SkCreateCGImageRef(const SkBitmap& bm) {
66
- return SkCreateCGImageRefWithColorspace(bm, nil);
67
- }
70
+ SK_API CGImageRef SkCreateCGImageRef(const SkBitmap& bm);
71
+
72
+ /**
73
+ * Given an SkColorSpace, create a CGColorSpace. This will return sRGB if the specified
74
+ * SkColorSpace is nullptr or on failure. This will not retain the specified SkColorSpace.
75
+ */
76
+ SK_API CGColorSpaceRef SkCreateCGColorSpace(const SkColorSpace*);
77
+
78
+ /**
79
+ * Given an SkData, create a CGDataProviderRef that refers to the and retains the specified data.
80
+ */
81
+ SK_API CGDataProviderRef SkCreateCGDataProvider(sk_sp<SkData>);
68
82
 
69
83
  /**
70
- * Draw the bitmap into the specified CG context. The bitmap will be converted
71
- * to a CGImage using the generic RGB colorspace. (x,y) specifies the position
72
- * of the top-left corner of the bitmap. The bitmap is converted using the
73
- * colorspace returned by CGColorSpaceCreateDeviceRGB()
84
+ * Draw the bitmap into the specified CG context. (x,y) specifies the position of the top-left
85
+ * corner of the bitmap.
74
86
  */
75
87
  void SkCGDrawBitmap(CGContextRef, const SkBitmap&, float x, float y);
76
88
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2018 Google Inc.
2
+ * Copyright 2023 Google Inc.
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -7,412 +7,4 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- // skcms.h contains the entire public API for skcms.
11
-
12
- #ifndef SKCMS_API
13
- #define SKCMS_API
14
- #endif
15
-
16
- #include <stdbool.h>
17
- #include <stddef.h>
18
- #include <stdint.h>
19
- #include <string.h>
20
-
21
- #ifdef __cplusplus
22
- extern "C" {
23
- #endif
24
-
25
- // A row-major 3x3 matrix (ie vals[row][col])
26
- typedef struct skcms_Matrix3x3 {
27
- float vals[3][3];
28
- } skcms_Matrix3x3;
29
-
30
- // It is _not_ safe to alias the pointers to invert in-place.
31
- SKCMS_API bool skcms_Matrix3x3_invert(const skcms_Matrix3x3*, skcms_Matrix3x3*);
32
- SKCMS_API skcms_Matrix3x3 skcms_Matrix3x3_concat(const skcms_Matrix3x3*, const skcms_Matrix3x3*);
33
-
34
- // A row-major 3x4 matrix (ie vals[row][col])
35
- typedef struct skcms_Matrix3x4 {
36
- float vals[3][4];
37
- } skcms_Matrix3x4;
38
-
39
- // A transfer function mapping encoded values to linear values,
40
- // represented by this 7-parameter piecewise function:
41
- //
42
- // linear = sign(encoded) * (c*|encoded| + f) , 0 <= |encoded| < d
43
- // = sign(encoded) * ((a*|encoded| + b)^g + e), d <= |encoded|
44
- //
45
- // (A simple gamma transfer function sets g to gamma and a to 1.)
46
- typedef struct skcms_TransferFunction {
47
- float g, a,b,c,d,e,f;
48
- } skcms_TransferFunction;
49
-
50
- SKCMS_API float skcms_TransferFunction_eval (const skcms_TransferFunction*, float);
51
- SKCMS_API bool skcms_TransferFunction_invert(const skcms_TransferFunction*,
52
- skcms_TransferFunction*);
53
-
54
- typedef enum skcms_TFType {
55
- skcms_TFType_Invalid,
56
- skcms_TFType_sRGBish,
57
- skcms_TFType_PQish,
58
- skcms_TFType_HLGish,
59
- skcms_TFType_HLGinvish,
60
- } skcms_TFType;
61
-
62
- // Identify which kind of transfer function is encoded in an skcms_TransferFunction
63
- SKCMS_API skcms_TFType skcms_TransferFunction_getType(const skcms_TransferFunction*);
64
-
65
- // We can jam a couple alternate transfer function forms into skcms_TransferFunction,
66
- // including those matching the general forms of the SMPTE ST 2084 PQ function or HLG.
67
- //
68
- // PQish:
69
- // max(A + B|encoded|^C, 0)
70
- // linear = sign(encoded) * (------------------------) ^ F
71
- // D + E|encoded|^C
72
- SKCMS_API bool skcms_TransferFunction_makePQish(skcms_TransferFunction*,
73
- float A, float B, float C,
74
- float D, float E, float F);
75
- // HLGish:
76
- // { K * sign(encoded) * ( (R|encoded|)^G ) when 0 <= |encoded| <= 1/R
77
- // linear = { K * sign(encoded) * ( e^(a(|encoded|-c)) + b ) when 1/R < |encoded|
78
- SKCMS_API bool skcms_TransferFunction_makeScaledHLGish(skcms_TransferFunction*,
79
- float K, float R, float G,
80
- float a, float b, float c);
81
-
82
- // Compatibility shim with K=1 for old callers.
83
- static inline bool skcms_TransferFunction_makeHLGish(skcms_TransferFunction* fn,
84
- float R, float G,
85
- float a, float b, float c) {
86
- return skcms_TransferFunction_makeScaledHLGish(fn, 1.0f, R,G, a,b,c);
87
- }
88
-
89
- // PQ mapping encoded [0,1] to linear [0,1].
90
- static inline bool skcms_TransferFunction_makePQ(skcms_TransferFunction* tf) {
91
- return skcms_TransferFunction_makePQish(tf, -107/128.0f, 1.0f, 32/2523.0f
92
- , 2413/128.0f, -2392/128.0f, 8192/1305.0f);
93
- }
94
- // HLG mapping encoded [0,1] to linear [0,12].
95
- static inline bool skcms_TransferFunction_makeHLG(skcms_TransferFunction* tf) {
96
- return skcms_TransferFunction_makeHLGish(tf, 2.0f, 2.0f
97
- , 1/0.17883277f, 0.28466892f, 0.55991073f);
98
- }
99
-
100
- // Is this an ordinary sRGB-ish transfer function, or one of the HDR forms we support?
101
- SKCMS_API bool skcms_TransferFunction_isSRGBish(const skcms_TransferFunction*);
102
- SKCMS_API bool skcms_TransferFunction_isPQish (const skcms_TransferFunction*);
103
- SKCMS_API bool skcms_TransferFunction_isHLGish (const skcms_TransferFunction*);
104
-
105
- // Unified representation of 'curv' or 'para' tag data, or a 1D table from 'mft1' or 'mft2'
106
- typedef union skcms_Curve {
107
- struct {
108
- uint32_t alias_of_table_entries;
109
- skcms_TransferFunction parametric;
110
- };
111
- struct {
112
- uint32_t table_entries;
113
- const uint8_t* table_8;
114
- const uint8_t* table_16;
115
- };
116
- } skcms_Curve;
117
-
118
- // Complex transforms between device space (A) and profile connection space (B):
119
- // A2B: device -> [ "A" curves -> CLUT ] -> [ "M" curves -> matrix ] -> "B" curves -> PCS
120
- // B2A: device <- [ "A" curves <- CLUT ] <- [ "M" curves <- matrix ] <- "B" curves <- PCS
121
-
122
- typedef struct skcms_A2B {
123
- // Optional: N 1D "A" curves, followed by an N-dimensional CLUT.
124
- // If input_channels == 0, these curves and CLUT are skipped,
125
- // Otherwise, input_channels must be in [1, 4].
126
- uint32_t input_channels;
127
- skcms_Curve input_curves[4];
128
- uint8_t grid_points[4];
129
- const uint8_t* grid_8;
130
- const uint8_t* grid_16;
131
-
132
- // Optional: 3 1D "M" curves, followed by a color matrix.
133
- // If matrix_channels == 0, these curves and matrix are skipped,
134
- // Otherwise, matrix_channels must be 3.
135
- uint32_t matrix_channels;
136
- skcms_Curve matrix_curves[3];
137
- skcms_Matrix3x4 matrix;
138
-
139
- // Required: 3 1D "B" curves. Always present, and output_channels must be 3.
140
- uint32_t output_channels;
141
- skcms_Curve output_curves[3];
142
- } skcms_A2B;
143
-
144
- typedef struct skcms_B2A {
145
- // Required: 3 1D "B" curves. Always present, and input_channels must be 3.
146
- uint32_t input_channels;
147
- skcms_Curve input_curves[3];
148
-
149
- // Optional: a color matrix, followed by 3 1D "M" curves.
150
- // If matrix_channels == 0, this matrix and these curves are skipped,
151
- // Otherwise, matrix_channels must be 3.
152
- uint32_t matrix_channels;
153
- skcms_Matrix3x4 matrix;
154
- skcms_Curve matrix_curves[3];
155
-
156
- // Optional: an N-dimensional CLUT, followed by N 1D "A" curves.
157
- // If output_channels == 0, this CLUT and these curves are skipped,
158
- // Otherwise, output_channels must be in [1, 4].
159
- uint32_t output_channels;
160
- uint8_t grid_points[4];
161
- const uint8_t* grid_8;
162
- const uint8_t* grid_16;
163
- skcms_Curve output_curves[4];
164
- } skcms_B2A;
165
-
166
- typedef struct skcms_CICP {
167
- uint8_t color_primaries;
168
- uint8_t transfer_characteristics;
169
- uint8_t matrix_coefficients;
170
- uint8_t video_full_range_flag;
171
- } skcms_CICP;
172
-
173
- typedef struct skcms_ICCProfile {
174
- const uint8_t* buffer;
175
-
176
- uint32_t size;
177
- uint32_t data_color_space;
178
- uint32_t pcs;
179
- uint32_t tag_count;
180
-
181
- // skcms_Parse() will set commonly-used fields for you when possible:
182
-
183
- // If we can parse red, green and blue transfer curves from the profile,
184
- // trc will be set to those three curves, and has_trc will be true.
185
- bool has_trc;
186
- skcms_Curve trc[3];
187
-
188
- // If this profile's gamut can be represented by a 3x3 transform to XYZD50,
189
- // skcms_Parse() sets toXYZD50 to that transform and has_toXYZD50 to true.
190
- bool has_toXYZD50;
191
- skcms_Matrix3x3 toXYZD50;
192
-
193
- // If the profile has a valid A2B0 or A2B1 tag, skcms_Parse() sets A2B to
194
- // that data, and has_A2B to true. skcms_ParseWithA2BPriority() does the
195
- // same following any user-provided prioritization of A2B0, A2B1, or A2B2.
196
- bool has_A2B;
197
- skcms_A2B A2B;
198
-
199
- // If the profile has a valid B2A0 or B2A1 tag, skcms_Parse() sets B2A to
200
- // that data, and has_B2A to true. skcms_ParseWithA2BPriority() does the
201
- // same following any user-provided prioritization of B2A0, B2A1, or B2A2.
202
- bool has_B2A;
203
- skcms_B2A B2A;
204
-
205
- // If the profile has a valid CICP tag, skcms_Parse() sets CICP to that data,
206
- // and has_CICP to true.
207
- bool has_CICP;
208
- skcms_CICP CICP;
209
- } skcms_ICCProfile;
210
-
211
- // The sRGB color profile is so commonly used that we offer a canonical skcms_ICCProfile for it.
212
- SKCMS_API const skcms_ICCProfile* skcms_sRGB_profile(void);
213
- // Ditto for XYZD50, the most common profile connection space.
214
- SKCMS_API const skcms_ICCProfile* skcms_XYZD50_profile(void);
215
-
216
- SKCMS_API const skcms_TransferFunction* skcms_sRGB_TransferFunction(void);
217
- SKCMS_API const skcms_TransferFunction* skcms_sRGB_Inverse_TransferFunction(void);
218
- SKCMS_API const skcms_TransferFunction* skcms_Identity_TransferFunction(void);
219
-
220
- // Practical equality test for two skcms_ICCProfiles.
221
- // The implementation is subject to change, but it will always try to answer
222
- // "can I substitute A for B?" and "can I skip transforming from A to B?".
223
- SKCMS_API bool skcms_ApproximatelyEqualProfiles(const skcms_ICCProfile* A,
224
- const skcms_ICCProfile* B);
225
-
226
- // Practical test that answers: Is curve roughly the inverse of inv_tf? Typically used by passing
227
- // the inverse of a known parametric transfer function (like sRGB), to determine if a particular
228
- // curve is very close to sRGB.
229
- SKCMS_API bool skcms_AreApproximateInverses(const skcms_Curve* curve,
230
- const skcms_TransferFunction* inv_tf);
231
-
232
- // Similar to above, answering the question for all three TRC curves of the given profile. Again,
233
- // passing skcms_sRGB_InverseTransferFunction as inv_tf will answer the question:
234
- // "Does this profile have a transfer function that is very close to sRGB?"
235
- SKCMS_API bool skcms_TRCs_AreApproximateInverse(const skcms_ICCProfile* profile,
236
- const skcms_TransferFunction* inv_tf);
237
-
238
- // Parse an ICC profile and return true if possible, otherwise return false.
239
- // Selects an A2B profile (if present) according to priority list (each entry 0-2).
240
- // The buffer is not copied; it must remain valid as long as the skcms_ICCProfile will be used.
241
- SKCMS_API bool skcms_ParseWithA2BPriority(const void*, size_t,
242
- const int priority[], int priorities,
243
- skcms_ICCProfile*);
244
-
245
- static inline bool skcms_Parse(const void* buf, size_t len, skcms_ICCProfile* profile) {
246
- // For continuity of existing user expectations,
247
- // prefer A2B0 (perceptual) over A2B1 (relative colormetric), and ignore A2B2 (saturation).
248
- const int priority[] = {0,1};
249
- return skcms_ParseWithA2BPriority(buf, len,
250
- priority, sizeof(priority)/sizeof(*priority),
251
- profile);
252
- }
253
-
254
- SKCMS_API bool skcms_ApproximateCurve(const skcms_Curve* curve,
255
- skcms_TransferFunction* approx,
256
- float* max_error);
257
-
258
- SKCMS_API bool skcms_GetCHAD(const skcms_ICCProfile*, skcms_Matrix3x3*);
259
- SKCMS_API bool skcms_GetWTPT(const skcms_ICCProfile*, float xyz[3]);
260
-
261
- // These are common ICC signature values
262
- enum {
263
- // data_color_space
264
- skcms_Signature_CMYK = 0x434D594B,
265
- skcms_Signature_Gray = 0x47524159,
266
- skcms_Signature_RGB = 0x52474220,
267
-
268
- // pcs
269
- skcms_Signature_Lab = 0x4C616220,
270
- skcms_Signature_XYZ = 0x58595A20,
271
- };
272
-
273
- typedef enum skcms_PixelFormat {
274
- skcms_PixelFormat_A_8,
275
- skcms_PixelFormat_A_8_,
276
- skcms_PixelFormat_G_8,
277
- skcms_PixelFormat_G_8_,
278
- skcms_PixelFormat_RGBA_8888_Palette8,
279
- skcms_PixelFormat_BGRA_8888_Palette8,
280
-
281
- skcms_PixelFormat_RGB_565,
282
- skcms_PixelFormat_BGR_565,
283
-
284
- skcms_PixelFormat_ABGR_4444,
285
- skcms_PixelFormat_ARGB_4444,
286
-
287
- skcms_PixelFormat_RGB_888,
288
- skcms_PixelFormat_BGR_888,
289
- skcms_PixelFormat_RGBA_8888,
290
- skcms_PixelFormat_BGRA_8888,
291
- skcms_PixelFormat_RGBA_8888_sRGB, // Automatic sRGB encoding / decoding.
292
- skcms_PixelFormat_BGRA_8888_sRGB, // (Generally used with linear transfer functions.)
293
-
294
- skcms_PixelFormat_RGBA_1010102,
295
- skcms_PixelFormat_BGRA_1010102,
296
-
297
- skcms_PixelFormat_RGB_161616LE, // Little-endian. Pointers must be 16-bit aligned.
298
- skcms_PixelFormat_BGR_161616LE,
299
- skcms_PixelFormat_RGBA_16161616LE,
300
- skcms_PixelFormat_BGRA_16161616LE,
301
-
302
- skcms_PixelFormat_RGB_161616BE, // Big-endian. Pointers must be 16-bit aligned.
303
- skcms_PixelFormat_BGR_161616BE,
304
- skcms_PixelFormat_RGBA_16161616BE,
305
- skcms_PixelFormat_BGRA_16161616BE,
306
-
307
- skcms_PixelFormat_RGB_hhh_Norm, // 1-5-10 half-precision float in [0,1]
308
- skcms_PixelFormat_BGR_hhh_Norm, // Pointers must be 16-bit aligned.
309
- skcms_PixelFormat_RGBA_hhhh_Norm,
310
- skcms_PixelFormat_BGRA_hhhh_Norm,
311
-
312
- skcms_PixelFormat_RGB_hhh, // 1-5-10 half-precision float.
313
- skcms_PixelFormat_BGR_hhh, // Pointers must be 16-bit aligned.
314
- skcms_PixelFormat_RGBA_hhhh,
315
- skcms_PixelFormat_BGRA_hhhh,
316
-
317
- skcms_PixelFormat_RGB_fff, // 1-8-23 single-precision float (the normal kind).
318
- skcms_PixelFormat_BGR_fff, // Pointers must be 32-bit aligned.
319
- skcms_PixelFormat_RGBA_ffff,
320
- skcms_PixelFormat_BGRA_ffff,
321
-
322
- skcms_PixelFormat_RGB_101010x_XR, // Note: This is located here to signal no clamping.
323
- skcms_PixelFormat_BGR_101010x_XR, // Compatible with MTLPixelFormatBGR10_XR.
324
- } skcms_PixelFormat;
325
-
326
- // We always store any alpha channel linearly. In the chart below, tf-1() is the inverse
327
- // transfer function for the given color profile (applying the transfer function linearizes).
328
-
329
- // We treat opaque as a strong requirement, not just a performance hint: we will ignore
330
- // any source alpha and treat it as 1.0, and will make sure that any destination alpha
331
- // channel is filled with the equivalent of 1.0.
332
-
333
- // We used to offer multiple types of premultiplication, but now just one, PremulAsEncoded.
334
- // This is the premul you're probably used to working with.
335
-
336
- typedef enum skcms_AlphaFormat {
337
- skcms_AlphaFormat_Opaque, // alpha is always opaque
338
- // tf-1(r), tf-1(g), tf-1(b), 1.0
339
- skcms_AlphaFormat_Unpremul, // alpha and color are unassociated
340
- // tf-1(r), tf-1(g), tf-1(b), a
341
- skcms_AlphaFormat_PremulAsEncoded, // premultiplied while encoded
342
- // tf-1(r)*a, tf-1(g)*a, tf-1(b)*a, a
343
- } skcms_AlphaFormat;
344
-
345
- // Convert npixels pixels from src format and color profile to dst format and color profile
346
- // and return true, otherwise return false. It is safe to alias dst == src if dstFmt == srcFmt.
347
- SKCMS_API bool skcms_Transform(const void* src,
348
- skcms_PixelFormat srcFmt,
349
- skcms_AlphaFormat srcAlpha,
350
- const skcms_ICCProfile* srcProfile,
351
- void* dst,
352
- skcms_PixelFormat dstFmt,
353
- skcms_AlphaFormat dstAlpha,
354
- const skcms_ICCProfile* dstProfile,
355
- size_t npixels);
356
-
357
- // As skcms_Transform(), supporting srcFmts with a palette.
358
- SKCMS_API bool skcms_TransformWithPalette(const void* src,
359
- skcms_PixelFormat srcFmt,
360
- skcms_AlphaFormat srcAlpha,
361
- const skcms_ICCProfile* srcProfile,
362
- void* dst,
363
- skcms_PixelFormat dstFmt,
364
- skcms_AlphaFormat dstAlpha,
365
- const skcms_ICCProfile* dstProfile,
366
- size_t npixels,
367
- const void* palette);
368
-
369
- // If profile can be used as a destination in skcms_Transform, return true. Otherwise, attempt to
370
- // rewrite it with approximations where reasonable. If successful, return true. If no reasonable
371
- // approximation exists, leave the profile unchanged and return false.
372
- SKCMS_API bool skcms_MakeUsableAsDestination(skcms_ICCProfile* profile);
373
-
374
- // If profile can be used as a destination with a single parametric transfer function (ie for
375
- // rasterization), return true. Otherwise, attempt to rewrite it with approximations where
376
- // reasonable. If successful, return true. If no reasonable approximation exists, leave the
377
- // profile unchanged and return false.
378
- SKCMS_API bool skcms_MakeUsableAsDestinationWithSingleCurve(skcms_ICCProfile* profile);
379
-
380
- // Returns a matrix to adapt XYZ color from given the whitepoint to D50.
381
- SKCMS_API bool skcms_AdaptToXYZD50(float wx, float wy,
382
- skcms_Matrix3x3* toXYZD50);
383
-
384
- // Returns a matrix to convert RGB color into XYZ adapted to D50, given the
385
- // primaries and whitepoint of the RGB model.
386
- SKCMS_API bool skcms_PrimariesToXYZD50(float rx, float ry,
387
- float gx, float gy,
388
- float bx, float by,
389
- float wx, float wy,
390
- skcms_Matrix3x3* toXYZD50);
391
-
392
- // Call before your first call to skcms_Transform() to skip runtime CPU detection.
393
- SKCMS_API void skcms_DisableRuntimeCPUDetection(void);
394
-
395
- // Utilities for programmatically constructing profiles
396
- static inline void skcms_Init(skcms_ICCProfile* p) {
397
- memset(p, 0, sizeof(*p));
398
- p->data_color_space = skcms_Signature_RGB;
399
- p->pcs = skcms_Signature_XYZ;
400
- }
401
-
402
- static inline void skcms_SetTransferFunction(skcms_ICCProfile* p,
403
- const skcms_TransferFunction* tf) {
404
- p->has_trc = true;
405
- for (int i = 0; i < 3; ++i) {
406
- p->trc[i].table_entries = 0;
407
- p->trc[i].parametric = *tf;
408
- }
409
- }
410
-
411
- static inline void skcms_SetXYZD50(skcms_ICCProfile* p, const skcms_Matrix3x3* m) {
412
- p->has_toXYZD50 = true;
413
- p->toXYZD50 = *m;
414
- }
415
-
416
- #ifdef __cplusplus
417
- }
418
- #endif
10
+ #include "src/skcms_public.h" // NO_G3_REWRITE