@nativescript/canvas 2.0.0-webgpu.3 → 2.0.0-webgpu.30

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 (197) hide show
  1. package/Canvas/common.d.ts +4 -9
  2. package/Canvas/common.js +37 -126
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +0 -1
  5. package/Canvas/index.android.js +45 -38
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.d.ts +11 -3
  8. package/Canvas/index.ios.js +49 -40
  9. package/Canvas/index.ios.js.map +1 -1
  10. package/Canvas/utils.d.ts +3 -0
  11. package/Canvas/utils.js +85 -0
  12. package/Canvas/utils.js.map +1 -0
  13. package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -0
  14. package/Canvas2D/CanvasRenderingContext2D/index.js +1 -0
  15. package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
  16. package/Dom/Group.d.ts +1 -2
  17. package/Dom/Group.js.map +1 -1
  18. package/Dom/Image.js +0 -1
  19. package/Dom/Image.js.map +1 -1
  20. package/Dom/Paint.d.ts +1 -1
  21. package/Dom/shapes/Path.d.ts +1 -1
  22. package/ImageAsset/index.js +77 -33
  23. package/ImageAsset/index.js.map +1 -1
  24. package/ImageBitmap/index.js +107 -20
  25. package/ImageBitmap/index.js.map +1 -1
  26. package/README.md +2 -4
  27. package/WebGL/WebGLRenderingContext/index.js +73 -31
  28. package/WebGL/WebGLRenderingContext/index.js.map +1 -1
  29. package/WebGL2/WebGL2RenderingContext/index.js +4 -4
  30. package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
  31. package/WebGPU/GPU.js +4 -3
  32. package/WebGPU/GPU.js.map +1 -1
  33. package/WebGPU/GPUAdapter.d.ts +6 -3
  34. package/WebGPU/GPUAdapter.js +31 -0
  35. package/WebGPU/GPUAdapter.js.map +1 -1
  36. package/WebGPU/GPUBindGroup.d.ts +1 -0
  37. package/WebGPU/GPUBindGroup.js +3 -0
  38. package/WebGPU/GPUBindGroup.js.map +1 -1
  39. package/WebGPU/GPUBindGroupLayout.d.ts +1 -0
  40. package/WebGPU/GPUBindGroupLayout.js +3 -0
  41. package/WebGPU/GPUBindGroupLayout.js.map +1 -1
  42. package/WebGPU/GPUBuffer.js +10 -2
  43. package/WebGPU/GPUBuffer.js.map +1 -1
  44. package/WebGPU/GPUCanvasContext.d.ts +3 -2
  45. package/WebGPU/GPUCanvasContext.js +52 -10
  46. package/WebGPU/GPUCanvasContext.js.map +1 -1
  47. package/WebGPU/GPUCommandBuffer.d.ts +1 -0
  48. package/WebGPU/GPUCommandBuffer.js +3 -0
  49. package/WebGPU/GPUCommandBuffer.js.map +1 -1
  50. package/WebGPU/GPUCommandEncoder.d.ts +3 -9
  51. package/WebGPU/GPUCommandEncoder.js +94 -41
  52. package/WebGPU/GPUCommandEncoder.js.map +1 -1
  53. package/WebGPU/GPUComputePassEncoder.d.ts +1 -0
  54. package/WebGPU/GPUComputePassEncoder.js +3 -0
  55. package/WebGPU/GPUComputePassEncoder.js.map +1 -1
  56. package/WebGPU/GPUComputePipeline.d.ts +1 -0
  57. package/WebGPU/GPUComputePipeline.js +3 -0
  58. package/WebGPU/GPUComputePipeline.js.map +1 -1
  59. package/WebGPU/GPUDevice.d.ts +17 -79
  60. package/WebGPU/GPUDevice.js +76 -91
  61. package/WebGPU/GPUDevice.js.map +1 -1
  62. package/WebGPU/GPUExternalTexture.d.ts +1 -0
  63. package/WebGPU/GPUExternalTexture.js +3 -0
  64. package/WebGPU/GPUExternalTexture.js.map +1 -1
  65. package/WebGPU/GPUPipelineLayout.d.ts +1 -0
  66. package/WebGPU/GPUPipelineLayout.js +3 -0
  67. package/WebGPU/GPUPipelineLayout.js.map +1 -1
  68. package/WebGPU/GPUQuerySet.d.ts +1 -0
  69. package/WebGPU/GPUQuerySet.js +3 -0
  70. package/WebGPU/GPUQuerySet.js.map +1 -1
  71. package/WebGPU/GPUQueue.d.ts +1 -0
  72. package/WebGPU/GPUQueue.js +56 -14
  73. package/WebGPU/GPUQueue.js.map +1 -1
  74. package/WebGPU/GPURenderBundle.d.ts +1 -0
  75. package/WebGPU/GPURenderBundle.js +3 -0
  76. package/WebGPU/GPURenderBundle.js.map +1 -1
  77. package/WebGPU/GPURenderBundleEncoder.d.ts +4 -2
  78. package/WebGPU/GPURenderBundleEncoder.js +7 -3
  79. package/WebGPU/GPURenderBundleEncoder.js.map +1 -1
  80. package/WebGPU/GPURenderPassEncoder.d.ts +2 -1
  81. package/WebGPU/GPURenderPassEncoder.js +5 -2
  82. package/WebGPU/GPURenderPassEncoder.js.map +1 -1
  83. package/WebGPU/GPURenderPipeline.d.ts +1 -0
  84. package/WebGPU/GPURenderPipeline.js +3 -0
  85. package/WebGPU/GPURenderPipeline.js.map +1 -1
  86. package/WebGPU/GPUSampler.d.ts +1 -0
  87. package/WebGPU/GPUSampler.js +3 -0
  88. package/WebGPU/GPUSampler.js.map +1 -1
  89. package/WebGPU/GPUShaderModule.d.ts +1 -1
  90. package/WebGPU/GPUShaderModule.js +2 -2
  91. package/WebGPU/GPUShaderModule.js.map +1 -1
  92. package/WebGPU/GPUTexture.d.ts +1 -0
  93. package/WebGPU/GPUTexture.js +3 -0
  94. package/WebGPU/GPUTexture.js.map +1 -1
  95. package/WebGPU/GPUTextureView.d.ts +1 -0
  96. package/WebGPU/GPUTextureView.js +3 -0
  97. package/WebGPU/GPUTextureView.js.map +1 -1
  98. package/WebGPU/Interfaces.d.ts +95 -4
  99. package/WebGPU/Types.d.ts +9 -1
  100. package/WebGPU/Utils.d.ts +6 -0
  101. package/WebGPU/Utils.js +224 -0
  102. package/WebGPU/Utils.js.map +1 -1
  103. package/angular/esm2022/index.mjs +4 -4
  104. package/angular/fesm2022/nativescript-canvas-angular.mjs +4 -4
  105. package/package.json +1 -1
  106. package/platforms/android/canvas-release.aar +0 -0
  107. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  108. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +39 -10
  109. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +7 -0
  110. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +227 -62
  111. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
  112. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  113. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +1635 -151
  114. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +57 -1
  115. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  116. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +57 -1
  117. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/NSCCanvas.nib +0 -0
  118. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  119. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +690 -644
  120. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  121. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +78 -20
  122. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +7 -0
  123. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +227 -62
  124. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  125. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  126. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  127. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +1635 -151
  128. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +57 -1
  129. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  130. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +57 -1
  131. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1635 -151
  132. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +57 -1
  133. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  134. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +57 -1
  135. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/NSCCanvas.nib +0 -0
  136. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +27 -27
  137. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  138. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +692 -646
  139. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +730 -684
  140. package/platforms/ios/src/NSOperationQueueWrapper.h +1 -1
  141. package/platforms/ios/src/NSOperationQueueWrapper.mm +41 -9
  142. package/platforms/ios/src/cpp/AsyncCallback.h +16 -8
  143. package/platforms/ios/src/cpp/CanvasJSIModule.cpp +208 -789
  144. package/platforms/ios/src/cpp/ImageAssetImpl.cpp +18 -28
  145. package/platforms/ios/src/cpp/ImageAssetImpl.h +3 -3
  146. package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +60 -3
  147. package/platforms/ios/src/cpp/ImageBitmapImpl.h +10 -3
  148. package/platforms/ios/src/cpp/PromiseCallback.h +1 -2
  149. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +1 -1
  150. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +3 -3
  151. package/platforms/ios/src/cpp/canvas2d/Path2D.h +5 -5
  152. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +106 -1
  153. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +26 -23
  154. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +31 -5
  155. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +4 -1
  156. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +26 -0
  157. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +3 -0
  158. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +41 -7
  159. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +4 -0
  160. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +11 -5
  161. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +28 -1
  162. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +3 -0
  163. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +75 -79
  164. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +4 -0
  165. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +42 -14
  166. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +3 -0
  167. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +25 -0
  168. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +2 -0
  169. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +1597 -674
  170. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +2 -0
  171. package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +2 -1
  172. package/platforms/ios/src/cpp/webgpu/GPUImpl.h +1 -1
  173. package/platforms/ios/src/cpp/webgpu/GPULabel.h +33 -0
  174. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +26 -0
  175. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +3 -1
  176. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +1 -2
  177. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +1 -1
  178. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +50 -13
  179. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +3 -0
  180. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +43 -14
  181. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +3 -0
  182. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +25 -0
  183. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +3 -0
  184. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +39 -13
  185. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +3 -0
  186. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +25 -0
  187. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +3 -0
  188. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +26 -0
  189. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +4 -1
  190. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +24 -0
  191. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +3 -0
  192. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +34 -8
  193. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +2 -0
  194. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +26 -0
  195. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +3 -0
  196. package/platforms/ios/src/cpp/webgpu/GPUUtils.h +511 -0
  197. package/utils.d.ts +1 -1
@@ -342,11 +342,13 @@ SWIFT_CLASS_NAMED("CanvasHelpers")
342
342
  + (NSMutableData * _Nonnull)getBytesFromUIImage:(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
343
343
  + (int64_t)createPattern:(int64_t)context :(UIImage * _Nonnull)image :(NSString * _Nonnull)repetition SWIFT_WARN_UNUSED_RESULT;
344
344
  + (BOOL)loadImageAssetWithContext:(int64_t)asset :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
345
+ + (BOOL)loadImageAssetWithPath:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
345
346
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy SWIFT_WARN_UNUSED_RESULT;
346
347
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy dw:(float)dw dh:(float)dh SWIFT_WARN_UNUSED_RESULT;
347
348
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image sx:(float)sx sy:(float)sy sw:(float)sw sh:(float)sh dx:(float)dx dy:(float)dy dw:(float)dw dh:(float)dh SWIFT_WARN_UNUSED_RESULT;
348
349
  + (int64_t)initWebGPUWithViewLayer:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
349
350
  + (int64_t)initWebGPUWithView:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
351
+ + (void)resizeWebGPUWithView:(int64_t)context :(int64_t)view :(uint32_t)width :(uint32_t)height;
350
352
  + (int64_t)initGLWithView:(int64_t)view :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
351
353
  + (int64_t)initSharedGLWithView:(int64_t)view :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas :(int64_t)shared_context SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
352
354
  + (int64_t)initGLWithWidthAndHeight:(int32_t)width :(int32_t)height :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
@@ -442,11 +444,27 @@ SWIFT_CLASS_NAMED("NSCCanvasRenderingContext2D")
442
444
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
443
445
  @end
444
446
 
447
+ @class NSCRender;
448
+ @class AVPlayer;
449
+ @class AVPlayerItemVideoOutput;
450
+
451
+ SWIFT_CLASS_NAMED("NSCCanvasUtils")
452
+ @interface NSCCanvasUtils : NSObject
453
+ + (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
454
+ + (CVOpenGLESTextureRef _Nullable)createImage:(CVOpenGLESTextureCacheRef _Nonnull)texturecache :(CVImageBufferRef _Nonnull)buffer :(CFDictionaryRef _Nullable)textureAttributes :(GLenum)target :(GLint)internalFormat :(GLsizei)width :(GLsizei)height :(GLenum)format :(GLenum)type :(NSInteger)planeIndex SWIFT_WARN_UNUSED_RESULT;
455
+ + (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
456
+ + (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(NSCRender * _Nonnull)render :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
457
+ + (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
458
+ - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
459
+ @end
460
+
445
461
 
446
462
  SWIFT_CLASS_NAMED("NSCImageAsset")
447
463
  @interface NSCImageAsset : NSObject
448
464
  + (BOOL)loadImageFromImageSync:(int64_t)context :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
449
465
  + (void)loadImageFromImage:(int64_t)context :(UIImage * _Nonnull)image :(void (^ _Nonnull)(BOOL))callback;
466
+ + (BOOL)loadImageFromPathSync:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
467
+ + (void)loadImageFromPath:(int64_t)asset :(NSString * _Nonnull)path :(void (^ _Nonnull)(BOOL))callback;
450
468
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
451
469
  @end
452
470
 
@@ -467,6 +485,25 @@ SWIFT_CLASS_NAMED("NSCRender")
467
485
  @end
468
486
 
469
487
 
488
+ SWIFT_CLASS_NAMED("NSCVideoFrame")
489
+ @interface NSCVideoFrame : NSObject
490
+ - (nonnull instancetype)init SWIFT_UNAVAILABLE;
491
+ + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
492
+ @end
493
+
494
+ typedef SWIFT_ENUM_NAMED(NSInteger, NSCVideoFrameFormat, "NSCVideoFrameFormat", open) {
495
+ NSCVideoFrameFormatI420 = 0,
496
+ NSCVideoFrameFormatI420A = 1,
497
+ NSCVideoFrameFormatI422 = 2,
498
+ NSCVideoFrameFormatI444 = 3,
499
+ NSCVideoFrameFormatNV12 = 4,
500
+ NSCVideoFrameFormatRGBA = 5,
501
+ NSCVideoFrameFormatRGBX = 6,
502
+ NSCVideoFrameFormatBGRA = 7,
503
+ NSCVideoFrameFormatBGRX = 8,
504
+ };
505
+
506
+
470
507
  SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
471
508
  @interface NSCWebGLRenderingContext : NSObject
472
509
  + (void)texImage2D:(int64_t)context :(int32_t)target :(int32_t)level :(int32_t)internalformat :(int32_t)format :(int32_t)type :(uint8_t * _Nonnull)data :(NSUInteger)size :(CGSize)dimensions :(BOOL)flipY;
@@ -474,17 +511,9 @@ SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
474
511
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
475
512
  @end
476
513
 
477
- @class AVPlayer;
478
- @class AVPlayerItemVideoOutput;
479
514
 
480
- SWIFT_CLASS_NAMED("Utils")
481
- @interface Utils : NSObject
482
- + (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
483
- + (CVOpenGLESTextureRef _Nullable)createImage:(CVOpenGLESTextureCacheRef _Nonnull)texturecache :(CVImageBufferRef _Nonnull)buffer :(CFDictionaryRef _Nullable)textureAttributes :(GLenum)target :(GLint)internalFormat :(GLsizei)width :(GLsizei)height :(GLenum)format :(GLenum)type :(NSInteger)planeIndex SWIFT_WARN_UNUSED_RESULT;
484
- + (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
485
- + (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(NSCRender * _Nonnull)render :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
486
- + (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
487
- - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
515
+ @interface UIView (SWIFT_EXTENSION(CanvasNative))
516
+ - (void)getBoundingClientRect:(void * _Nonnull)buffer;
488
517
  @end
489
518
 
490
519
  #endif
@@ -839,11 +868,13 @@ SWIFT_CLASS_NAMED("CanvasHelpers")
839
868
  + (NSMutableData * _Nonnull)getBytesFromUIImage:(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
840
869
  + (int64_t)createPattern:(int64_t)context :(UIImage * _Nonnull)image :(NSString * _Nonnull)repetition SWIFT_WARN_UNUSED_RESULT;
841
870
  + (BOOL)loadImageAssetWithContext:(int64_t)asset :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
871
+ + (BOOL)loadImageAssetWithPath:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
842
872
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy SWIFT_WARN_UNUSED_RESULT;
843
873
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy dw:(float)dw dh:(float)dh SWIFT_WARN_UNUSED_RESULT;
844
874
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image sx:(float)sx sy:(float)sy sw:(float)sw sh:(float)sh dx:(float)dx dy:(float)dy dw:(float)dw dh:(float)dh SWIFT_WARN_UNUSED_RESULT;
845
875
  + (int64_t)initWebGPUWithViewLayer:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
846
876
  + (int64_t)initWebGPUWithView:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
877
+ + (void)resizeWebGPUWithView:(int64_t)context :(int64_t)view :(uint32_t)width :(uint32_t)height;
847
878
  + (int64_t)initGLWithView:(int64_t)view :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
848
879
  + (int64_t)initSharedGLWithView:(int64_t)view :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas :(int64_t)shared_context SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
849
880
  + (int64_t)initGLWithWidthAndHeight:(int32_t)width :(int32_t)height :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
@@ -939,11 +970,27 @@ SWIFT_CLASS_NAMED("NSCCanvasRenderingContext2D")
939
970
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
940
971
  @end
941
972
 
973
+ @class NSCRender;
974
+ @class AVPlayer;
975
+ @class AVPlayerItemVideoOutput;
976
+
977
+ SWIFT_CLASS_NAMED("NSCCanvasUtils")
978
+ @interface NSCCanvasUtils : NSObject
979
+ + (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
980
+ + (CVOpenGLESTextureRef _Nullable)createImage:(CVOpenGLESTextureCacheRef _Nonnull)texturecache :(CVImageBufferRef _Nonnull)buffer :(CFDictionaryRef _Nullable)textureAttributes :(GLenum)target :(GLint)internalFormat :(GLsizei)width :(GLsizei)height :(GLenum)format :(GLenum)type :(NSInteger)planeIndex SWIFT_WARN_UNUSED_RESULT;
981
+ + (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
982
+ + (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(NSCRender * _Nonnull)render :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
983
+ + (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
984
+ - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
985
+ @end
986
+
942
987
 
943
988
  SWIFT_CLASS_NAMED("NSCImageAsset")
944
989
  @interface NSCImageAsset : NSObject
945
990
  + (BOOL)loadImageFromImageSync:(int64_t)context :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
946
991
  + (void)loadImageFromImage:(int64_t)context :(UIImage * _Nonnull)image :(void (^ _Nonnull)(BOOL))callback;
992
+ + (BOOL)loadImageFromPathSync:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
993
+ + (void)loadImageFromPath:(int64_t)asset :(NSString * _Nonnull)path :(void (^ _Nonnull)(BOOL))callback;
947
994
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
948
995
  @end
949
996
 
@@ -964,6 +1011,25 @@ SWIFT_CLASS_NAMED("NSCRender")
964
1011
  @end
965
1012
 
966
1013
 
1014
+ SWIFT_CLASS_NAMED("NSCVideoFrame")
1015
+ @interface NSCVideoFrame : NSObject
1016
+ - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1017
+ + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1018
+ @end
1019
+
1020
+ typedef SWIFT_ENUM_NAMED(NSInteger, NSCVideoFrameFormat, "NSCVideoFrameFormat", open) {
1021
+ NSCVideoFrameFormatI420 = 0,
1022
+ NSCVideoFrameFormatI420A = 1,
1023
+ NSCVideoFrameFormatI422 = 2,
1024
+ NSCVideoFrameFormatI444 = 3,
1025
+ NSCVideoFrameFormatNV12 = 4,
1026
+ NSCVideoFrameFormatRGBA = 5,
1027
+ NSCVideoFrameFormatRGBX = 6,
1028
+ NSCVideoFrameFormatBGRA = 7,
1029
+ NSCVideoFrameFormatBGRX = 8,
1030
+ };
1031
+
1032
+
967
1033
  SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
968
1034
  @interface NSCWebGLRenderingContext : NSObject
969
1035
  + (void)texImage2D:(int64_t)context :(int32_t)target :(int32_t)level :(int32_t)internalformat :(int32_t)format :(int32_t)type :(uint8_t * _Nonnull)data :(NSUInteger)size :(CGSize)dimensions :(BOOL)flipY;
@@ -971,17 +1037,9 @@ SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
971
1037
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
972
1038
  @end
973
1039
 
974
- @class AVPlayer;
975
- @class AVPlayerItemVideoOutput;
976
1040
 
977
- SWIFT_CLASS_NAMED("Utils")
978
- @interface Utils : NSObject
979
- + (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
980
- + (CVOpenGLESTextureRef _Nullable)createImage:(CVOpenGLESTextureCacheRef _Nonnull)texturecache :(CVImageBufferRef _Nonnull)buffer :(CFDictionaryRef _Nullable)textureAttributes :(GLenum)target :(GLint)internalFormat :(GLsizei)width :(GLsizei)height :(GLenum)format :(GLenum)type :(NSInteger)planeIndex SWIFT_WARN_UNUSED_RESULT;
981
- + (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
982
- + (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(NSCRender * _Nonnull)render :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
983
- + (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
984
- - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
1041
+ @interface UIView (SWIFT_EXTENSION(CanvasNative))
1042
+ - (void)getBoundingClientRect:(void * _Nonnull)buffer;
985
1043
  @end
986
1044
 
987
1045
  #endif
@@ -20,6 +20,13 @@ long long canvas_native_init_ios_webgpu_uiview(int64_t instance,
20
20
  uint32_t height);
21
21
  #endif
22
22
 
23
+ #if defined(TARGET_OS_IOS)
24
+ void canvas_native_resize_ios_webgpu_uiview(int64_t context,
25
+ int64_t view,
26
+ uint32_t width,
27
+ uint32_t height);
28
+ #endif
29
+
23
30
  long long canvas_native_init_ios_gl(int64_t view,
24
31
  bool alpha,
25
32
  bool antialias,