@nativescript/canvas 2.0.0-webgpu.4 → 2.0.0-webgpu.40
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.
- package/Canvas/common.d.ts +5 -10
- package/Canvas/common.js +61 -144
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +6 -5
- package/Canvas/index.android.js +63 -42
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +13 -3
- package/Canvas/index.ios.d.ts +9 -1
- package/Canvas/index.ios.js +117 -66
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas/utils.d.ts +3 -0
- package/Canvas/utils.js +85 -0
- package/Canvas/utils.js.map +1 -0
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +3 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +2 -4
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Dom/Group.d.ts +1 -2
- package/Dom/Group.js.map +1 -1
- package/Dom/Image.js +0 -1
- package/Dom/Image.js.map +1 -1
- package/Dom/Paint.d.ts +1 -1
- package/Dom/shapes/Path.d.ts +1 -1
- package/ImageAsset/index.d.ts +4 -2
- package/ImageAsset/index.js +151 -37
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.js +107 -20
- package/ImageBitmap/index.js.map +1 -1
- package/README.md +2 -4
- package/WebGL/WebGLRenderingContext/common.d.ts +1 -1
- package/WebGL/WebGLRenderingContext/index.js +76 -32
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js +5 -5
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/GPU.js +4 -3
- package/WebGPU/GPU.js.map +1 -1
- package/WebGPU/GPUAdapter.d.ts +6 -3
- package/WebGPU/GPUAdapter.js +31 -0
- package/WebGPU/GPUAdapter.js.map +1 -1
- package/WebGPU/GPUBindGroup.d.ts +1 -0
- package/WebGPU/GPUBindGroup.js +3 -0
- package/WebGPU/GPUBindGroup.js.map +1 -1
- package/WebGPU/GPUBindGroupLayout.d.ts +1 -0
- package/WebGPU/GPUBindGroupLayout.js +3 -0
- package/WebGPU/GPUBindGroupLayout.js.map +1 -1
- package/WebGPU/GPUBuffer.js +10 -2
- package/WebGPU/GPUBuffer.js.map +1 -1
- package/WebGPU/GPUCanvasContext.d.ts +5 -3
- package/WebGPU/GPUCanvasContext.js +52 -10
- package/WebGPU/GPUCanvasContext.js.map +1 -1
- package/WebGPU/GPUCommandBuffer.d.ts +1 -0
- package/WebGPU/GPUCommandBuffer.js +3 -0
- package/WebGPU/GPUCommandBuffer.js.map +1 -1
- package/WebGPU/GPUCommandEncoder.d.ts +3 -9
- package/WebGPU/GPUCommandEncoder.js +94 -41
- package/WebGPU/GPUCommandEncoder.js.map +1 -1
- package/WebGPU/GPUComputePassEncoder.d.ts +1 -0
- package/WebGPU/GPUComputePassEncoder.js +3 -0
- package/WebGPU/GPUComputePassEncoder.js.map +1 -1
- package/WebGPU/GPUComputePipeline.d.ts +1 -0
- package/WebGPU/GPUComputePipeline.js +3 -0
- package/WebGPU/GPUComputePipeline.js.map +1 -1
- package/WebGPU/GPUDevice.d.ts +17 -79
- package/WebGPU/GPUDevice.js +75 -91
- package/WebGPU/GPUDevice.js.map +1 -1
- package/WebGPU/GPUExternalTexture.d.ts +1 -0
- package/WebGPU/GPUExternalTexture.js +3 -0
- package/WebGPU/GPUExternalTexture.js.map +1 -1
- package/WebGPU/GPUPipelineLayout.d.ts +1 -0
- package/WebGPU/GPUPipelineLayout.js +3 -0
- package/WebGPU/GPUPipelineLayout.js.map +1 -1
- package/WebGPU/GPUQuerySet.d.ts +1 -0
- package/WebGPU/GPUQuerySet.js +3 -0
- package/WebGPU/GPUQuerySet.js.map +1 -1
- package/WebGPU/GPUQueue.d.ts +1 -0
- package/WebGPU/GPUQueue.js +65 -14
- package/WebGPU/GPUQueue.js.map +1 -1
- package/WebGPU/GPURenderBundle.d.ts +1 -0
- package/WebGPU/GPURenderBundle.js +3 -0
- package/WebGPU/GPURenderBundle.js.map +1 -1
- package/WebGPU/GPURenderBundleEncoder.d.ts +4 -2
- package/WebGPU/GPURenderBundleEncoder.js +7 -3
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -1
- package/WebGPU/GPURenderPassEncoder.d.ts +5 -1
- package/WebGPU/GPURenderPassEncoder.js +14 -2
- package/WebGPU/GPURenderPassEncoder.js.map +1 -1
- package/WebGPU/GPURenderPipeline.d.ts +1 -0
- package/WebGPU/GPURenderPipeline.js +3 -0
- package/WebGPU/GPURenderPipeline.js.map +1 -1
- package/WebGPU/GPUSampler.d.ts +1 -0
- package/WebGPU/GPUSampler.js +3 -0
- package/WebGPU/GPUSampler.js.map +1 -1
- package/WebGPU/GPUShaderModule.d.ts +1 -1
- package/WebGPU/GPUShaderModule.js +2 -2
- package/WebGPU/GPUShaderModule.js.map +1 -1
- package/WebGPU/GPUTexture.d.ts +1 -0
- package/WebGPU/GPUTexture.js +3 -0
- package/WebGPU/GPUTexture.js.map +1 -1
- package/WebGPU/GPUTextureView.d.ts +1 -0
- package/WebGPU/GPUTextureView.js +3 -0
- package/WebGPU/GPUTextureView.js.map +1 -1
- package/WebGPU/Interfaces.d.ts +95 -4
- package/WebGPU/Types.d.ts +9 -1
- package/WebGPU/Utils.d.ts +6 -0
- package/WebGPU/Utils.js +226 -0
- package/WebGPU/Utils.js.map +1 -1
- package/angular/esm2022/index.mjs +4 -4
- package/angular/fesm2022/nativescript-canvas-angular.mjs +4 -4
- package/angular/fesm2022/nativescript-canvas-angular.mjs.map +1 -1
- package/common.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +3 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +61 -30
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +1 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +144 -176
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +342 -72
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +7997 -5995
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +85 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +85 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +681 -644
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +122 -60
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +1 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +144 -176
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +342 -72
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +7997 -5995
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +85 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +85 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +7997 -5995
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +85 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +85 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +40 -29
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +683 -646
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +736 -684
- package/platforms/ios/src/NSOperationQueueWrapper.h +1 -1
- package/platforms/ios/src/NSOperationQueueWrapper.mm +41 -9
- package/platforms/ios/src/cpp/AsyncCallback.h +16 -8
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +310 -801
- package/platforms/ios/src/cpp/CanvasJSIModule.h +2 -0
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +578 -413
- package/platforms/ios/src/cpp/ImageAssetImpl.h +7 -3
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +60 -3
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +10 -3
- package/platforms/ios/src/cpp/PromiseCallback.h +1 -2
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +7 -11
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +5 -5
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +106 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +6 -6
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +26 -23
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +31 -5
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +26 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +41 -7
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +4 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +11 -5
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +28 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +75 -79
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +4 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +56 -23
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +25 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +2 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +1606 -681
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +2 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +2 -1
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPULabel.h +33 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +26 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +3 -1
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +1 -2
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +83 -14
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +66 -34
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +25 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +151 -52
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +7 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +25 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +26 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +24 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +34 -8
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +2 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +26 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +3 -0
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +511 -0
- package/utils.d.ts +1 -1
|
Binary file
|
|
@@ -342,25 +342,24 @@ 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
|
-
+ (int64_t)initWebGPUWithViewLayer:(int64_t)instance :(
|
|
349
|
-
+ (int64_t)initWebGPUWithView:(int64_t)instance :(
|
|
350
|
-
+ (
|
|
351
|
-
+ (int64_t)
|
|
352
|
-
+ (int64_t)
|
|
353
|
-
+ (int64_t)initSharedGLWidthAndHeight:(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 :(int64_t)shared_context SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
349
|
+
+ (int64_t)initWebGPUWithViewLayer:(int64_t)instance :(NSCCanvas * _Nonnull)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
350
|
+
+ (int64_t)initWebGPUWithView:(int64_t)instance :(NSCCanvas * _Nonnull)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
351
|
+
+ (void)resizeWebGPUWithView:(int64_t)context :(NSCCanvas * _Nonnull)view :(uint32_t)width :(uint32_t)height;
|
|
352
|
+
+ (int64_t)initWebGLWithView:(NSCCanvas * _Nonnull)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 SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
353
|
+
+ (int64_t)initWebGLWithWidthAndHeight:(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 SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
354
354
|
+ (void)resize2DContext:(int64_t)context :(float)width :(float)height;
|
|
355
355
|
+ (void)flush2DContext:(int64_t)context;
|
|
356
|
-
+ (
|
|
357
|
-
+ (void)
|
|
358
|
-
+ (
|
|
359
|
-
+ (void)
|
|
360
|
-
+ (int64_t)create2DContext:(
|
|
361
|
-
+ (
|
|
362
|
-
+ (void)
|
|
363
|
-
+ (NSString * _Nonnull)testToDataURL:(int64_t)context SWIFT_WARN_UNUSED_RESULT;
|
|
356
|
+
+ (void)flush2DContextAndSyncCPU:(int64_t)context;
|
|
357
|
+
+ (void)presentDrawable:(int64_t)context;
|
|
358
|
+
+ (BOOL)flushWebGL:(int64_t)context SWIFT_WARN_UNUSED_RESULT;
|
|
359
|
+
+ (void)releaseWebGL:(int64_t)context;
|
|
360
|
+
+ (int64_t)create2DContext:(NSCCanvas * _Nonnull)view :(int32_t)width :(int32_t)height :(BOOL)alpha :(float)density :(int32_t)fontColor :(float)ppi :(int32_t)direction SWIFT_WARN_UNUSED_RESULT;
|
|
361
|
+
+ (int64_t)create2DContextMetal:(NSCCanvas * _Nonnull)view :(BOOL)alpha :(float)density :(int32_t)fontColor :(float)ppi :(int32_t)direction SWIFT_WARN_UNUSED_RESULT;
|
|
362
|
+
+ (void)updateWebGLSurfaceWithView:(int64_t)view :(int32_t)width :(int32_t)height :(int64_t)context;
|
|
364
363
|
+ (void)writeFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path :(void (^ _Nonnull)(NSString * _Nullable, NSString * _Nullable))callback;
|
|
365
364
|
+ (void)readFile:(NSString * _Nonnull)path :(void (^ _Nonnull)(NSString * _Nullable, NSData * _Nullable))callback;
|
|
366
365
|
+ (void)deleteFile:(NSString * _Nonnull)path :(void (^ _Nonnull)(NSError * _Nullable, BOOL))callback;
|
|
@@ -381,15 +380,20 @@ enum CanvasFit : NSInteger;
|
|
|
381
380
|
|
|
382
381
|
SWIFT_CLASS_NAMED("NSCCanvas")
|
|
383
382
|
@interface NSCCanvas : UIView
|
|
383
|
+
SWIFT_CLASS_PROPERTY(@property (nonatomic, class) BOOL forceGL;)
|
|
384
|
+
+ (BOOL)forceGL SWIFT_WARN_UNUSED_RESULT;
|
|
385
|
+
+ (void)setForceGL:(BOOL)value;
|
|
384
386
|
@property (nonatomic) enum CanvasFit fit;
|
|
387
|
+
@property (nonatomic) BOOL weblikeScale;
|
|
385
388
|
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NSMutableDictionary * _Nonnull store;)
|
|
386
389
|
+ (NSMutableDictionary * _Nonnull)store SWIFT_WARN_UNUSED_RESULT;
|
|
387
390
|
+ (NSMapTable<NSString *, NSCCanvas *> * _Nonnull)getViews SWIFT_WARN_UNUSED_RESULT;
|
|
388
|
-
- (void * _Nonnull)
|
|
391
|
+
- (void * _Nonnull)getGlViewPtr SWIFT_WARN_UNUSED_RESULT;
|
|
389
392
|
- (void * _Nonnull)getMtlViewPtr SWIFT_WARN_UNUSED_RESULT;
|
|
393
|
+
- (void * _Nonnull)getMtlLayerPtr SWIFT_WARN_UNUSED_RESULT;
|
|
390
394
|
@property (nonatomic) BOOL autoScale;
|
|
391
|
-
@property (nonatomic, readonly) int64_t nativeGL;
|
|
392
395
|
@property (nonatomic, readonly) int64_t nativeContext;
|
|
396
|
+
@property (nonatomic, readonly) BOOL is2D;
|
|
393
397
|
@property (nonatomic, readonly) CGFloat drawingBufferWidth;
|
|
394
398
|
@property (nonatomic, readonly) CGFloat drawingBufferHeight;
|
|
395
399
|
@property (nonatomic, readonly) float width;
|
|
@@ -399,15 +403,17 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NSMutableDic
|
|
|
399
403
|
- (int64_t)create2DContext:(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)failIfMajorPerformanceCaveat :(int32_t)powerPreference :(BOOL)premultipliedAlpha :(BOOL)preserveDrawingBuffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xrCompatible :(int32_t)fontColor SWIFT_WARN_UNUSED_RESULT;
|
|
400
404
|
- (UIImage * _Nullable)snapshot:(BOOL)flip SWIFT_WARN_UNUSED_RESULT;
|
|
401
405
|
- (BOOL)render;
|
|
402
|
-
- (void)context2DTest:(int64_t)context;
|
|
403
|
-
- (NSString * _Nonnull)context2DTestToDataURL:(int64_t)context SWIFT_WARN_UNUSED_RESULT;
|
|
404
406
|
@property (nonatomic, copy) void (^ _Nullable touchEventListener)(NSString * _Nonnull, UIGestureRecognizer * _Nonnull);
|
|
405
407
|
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
|
|
406
408
|
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
|
|
409
|
+
@property (nonatomic) BOOL ignoreTouchEvents;
|
|
407
410
|
- (void)setListener:(id <NSCCanvasListener> _Nullable)listener;
|
|
408
411
|
@property (nonatomic) NSInteger surfaceWidth;
|
|
409
412
|
@property (nonatomic) NSInteger surfaceHeight;
|
|
410
413
|
- (void)forceLayout:(CGFloat)width :(CGFloat)height;
|
|
414
|
+
- (void)context2DTest:(int64_t)context;
|
|
415
|
+
- (void)context2DPathTest:(int64_t)context;
|
|
416
|
+
- (void)context2DConic:(int64_t)context;
|
|
411
417
|
- (void)layoutSubviews;
|
|
412
418
|
+ (void)getBoundingClientRect:(UIView * _Nonnull)view :(void * _Nonnull)buffer;
|
|
413
419
|
@end
|
|
@@ -442,11 +448,27 @@ SWIFT_CLASS_NAMED("NSCCanvasRenderingContext2D")
|
|
|
442
448
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
443
449
|
@end
|
|
444
450
|
|
|
451
|
+
@class NSCRender;
|
|
452
|
+
@class AVPlayer;
|
|
453
|
+
@class AVPlayerItemVideoOutput;
|
|
454
|
+
|
|
455
|
+
SWIFT_CLASS_NAMED("NSCCanvasUtils")
|
|
456
|
+
@interface NSCCanvasUtils : NSObject
|
|
457
|
+
+ (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
|
|
458
|
+
+ (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;
|
|
459
|
+
+ (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
|
|
460
|
+
+ (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
|
|
461
|
+
+ (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
|
|
462
|
+
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
463
|
+
@end
|
|
464
|
+
|
|
445
465
|
|
|
446
466
|
SWIFT_CLASS_NAMED("NSCImageAsset")
|
|
447
467
|
@interface NSCImageAsset : NSObject
|
|
448
468
|
+ (BOOL)loadImageFromImageSync:(int64_t)context :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
|
|
449
469
|
+ (void)loadImageFromImage:(int64_t)context :(UIImage * _Nonnull)image :(void (^ _Nonnull)(BOOL))callback;
|
|
470
|
+
+ (BOOL)loadImageFromPathSync:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
|
|
471
|
+
+ (void)loadImageFromPath:(int64_t)asset :(NSString * _Nonnull)path :(void (^ _Nonnull)(BOOL))callback;
|
|
450
472
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
451
473
|
@end
|
|
452
474
|
|
|
@@ -462,11 +484,28 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) dispatch_que
|
|
|
462
484
|
SWIFT_CLASS_NAMED("NSCRender")
|
|
463
485
|
@interface NSCRender : NSObject
|
|
464
486
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
465
|
-
- (void)texImage2D:(int32_t)target :(int32_t)level :(int32_t)internalFormat :(int32_t)format :(int32_t)type :(NSCCanvas * _Nonnull)source :(NSCCanvas * _Nonnull)dest :(BOOL)flipYWebGL;
|
|
466
|
-
- (void)createSurface;
|
|
467
487
|
@end
|
|
468
488
|
|
|
469
489
|
|
|
490
|
+
SWIFT_CLASS_NAMED("NSCVideoFrame")
|
|
491
|
+
@interface NSCVideoFrame : NSObject
|
|
492
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
493
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
494
|
+
@end
|
|
495
|
+
|
|
496
|
+
typedef SWIFT_ENUM_NAMED(NSInteger, NSCVideoFrameFormat, "NSCVideoFrameFormat", open) {
|
|
497
|
+
NSCVideoFrameFormatI420 = 0,
|
|
498
|
+
NSCVideoFrameFormatI420A = 1,
|
|
499
|
+
NSCVideoFrameFormatI422 = 2,
|
|
500
|
+
NSCVideoFrameFormatI444 = 3,
|
|
501
|
+
NSCVideoFrameFormatNV12 = 4,
|
|
502
|
+
NSCVideoFrameFormatRGBA = 5,
|
|
503
|
+
NSCVideoFrameFormatRGBX = 6,
|
|
504
|
+
NSCVideoFrameFormatBGRA = 7,
|
|
505
|
+
NSCVideoFrameFormatBGRX = 8,
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
|
|
470
509
|
SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
|
|
471
510
|
@interface NSCWebGLRenderingContext : NSObject
|
|
472
511
|
+ (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 +513,9 @@ SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
|
|
|
474
513
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
475
514
|
@end
|
|
476
515
|
|
|
477
|
-
@class AVPlayer;
|
|
478
|
-
@class AVPlayerItemVideoOutput;
|
|
479
516
|
|
|
480
|
-
|
|
481
|
-
|
|
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;
|
|
517
|
+
@interface UIView (SWIFT_EXTENSION(CanvasNative))
|
|
518
|
+
- (void)getBoundingClientRect:(void * _Nonnull)buffer;
|
|
488
519
|
@end
|
|
489
520
|
|
|
490
521
|
#endif
|
|
@@ -839,25 +870,24 @@ SWIFT_CLASS_NAMED("CanvasHelpers")
|
|
|
839
870
|
+ (NSMutableData * _Nonnull)getBytesFromUIImage:(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
|
|
840
871
|
+ (int64_t)createPattern:(int64_t)context :(UIImage * _Nonnull)image :(NSString * _Nonnull)repetition SWIFT_WARN_UNUSED_RESULT;
|
|
841
872
|
+ (BOOL)loadImageAssetWithContext:(int64_t)asset :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
|
|
873
|
+
+ (BOOL)loadImageAssetWithPath:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
|
|
842
874
|
+ (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy SWIFT_WARN_UNUSED_RESULT;
|
|
843
875
|
+ (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
876
|
+ (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
|
-
+ (int64_t)initWebGPUWithViewLayer:(int64_t)instance :(
|
|
846
|
-
+ (int64_t)initWebGPUWithView:(int64_t)instance :(
|
|
847
|
-
+ (
|
|
848
|
-
+ (int64_t)
|
|
849
|
-
+ (int64_t)
|
|
850
|
-
+ (int64_t)initSharedGLWidthAndHeight:(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 :(int64_t)shared_context SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
877
|
+
+ (int64_t)initWebGPUWithViewLayer:(int64_t)instance :(NSCCanvas * _Nonnull)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
878
|
+
+ (int64_t)initWebGPUWithView:(int64_t)instance :(NSCCanvas * _Nonnull)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
879
|
+
+ (void)resizeWebGPUWithView:(int64_t)context :(NSCCanvas * _Nonnull)view :(uint32_t)width :(uint32_t)height;
|
|
880
|
+
+ (int64_t)initWebGLWithView:(NSCCanvas * _Nonnull)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 SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
881
|
+
+ (int64_t)initWebGLWithWidthAndHeight:(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 SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
|
|
851
882
|
+ (void)resize2DContext:(int64_t)context :(float)width :(float)height;
|
|
852
883
|
+ (void)flush2DContext:(int64_t)context;
|
|
853
|
-
+ (
|
|
854
|
-
+ (void)
|
|
855
|
-
+ (
|
|
856
|
-
+ (void)
|
|
857
|
-
+ (int64_t)create2DContext:(
|
|
858
|
-
+ (
|
|
859
|
-
+ (void)
|
|
860
|
-
+ (NSString * _Nonnull)testToDataURL:(int64_t)context SWIFT_WARN_UNUSED_RESULT;
|
|
884
|
+
+ (void)flush2DContextAndSyncCPU:(int64_t)context;
|
|
885
|
+
+ (void)presentDrawable:(int64_t)context;
|
|
886
|
+
+ (BOOL)flushWebGL:(int64_t)context SWIFT_WARN_UNUSED_RESULT;
|
|
887
|
+
+ (void)releaseWebGL:(int64_t)context;
|
|
888
|
+
+ (int64_t)create2DContext:(NSCCanvas * _Nonnull)view :(int32_t)width :(int32_t)height :(BOOL)alpha :(float)density :(int32_t)fontColor :(float)ppi :(int32_t)direction SWIFT_WARN_UNUSED_RESULT;
|
|
889
|
+
+ (int64_t)create2DContextMetal:(NSCCanvas * _Nonnull)view :(BOOL)alpha :(float)density :(int32_t)fontColor :(float)ppi :(int32_t)direction SWIFT_WARN_UNUSED_RESULT;
|
|
890
|
+
+ (void)updateWebGLSurfaceWithView:(int64_t)view :(int32_t)width :(int32_t)height :(int64_t)context;
|
|
861
891
|
+ (void)writeFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path :(void (^ _Nonnull)(NSString * _Nullable, NSString * _Nullable))callback;
|
|
862
892
|
+ (void)readFile:(NSString * _Nonnull)path :(void (^ _Nonnull)(NSString * _Nullable, NSData * _Nullable))callback;
|
|
863
893
|
+ (void)deleteFile:(NSString * _Nonnull)path :(void (^ _Nonnull)(NSError * _Nullable, BOOL))callback;
|
|
@@ -878,15 +908,20 @@ enum CanvasFit : NSInteger;
|
|
|
878
908
|
|
|
879
909
|
SWIFT_CLASS_NAMED("NSCCanvas")
|
|
880
910
|
@interface NSCCanvas : UIView
|
|
911
|
+
SWIFT_CLASS_PROPERTY(@property (nonatomic, class) BOOL forceGL;)
|
|
912
|
+
+ (BOOL)forceGL SWIFT_WARN_UNUSED_RESULT;
|
|
913
|
+
+ (void)setForceGL:(BOOL)value;
|
|
881
914
|
@property (nonatomic) enum CanvasFit fit;
|
|
915
|
+
@property (nonatomic) BOOL weblikeScale;
|
|
882
916
|
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NSMutableDictionary * _Nonnull store;)
|
|
883
917
|
+ (NSMutableDictionary * _Nonnull)store SWIFT_WARN_UNUSED_RESULT;
|
|
884
918
|
+ (NSMapTable<NSString *, NSCCanvas *> * _Nonnull)getViews SWIFT_WARN_UNUSED_RESULT;
|
|
885
|
-
- (void * _Nonnull)
|
|
919
|
+
- (void * _Nonnull)getGlViewPtr SWIFT_WARN_UNUSED_RESULT;
|
|
886
920
|
- (void * _Nonnull)getMtlViewPtr SWIFT_WARN_UNUSED_RESULT;
|
|
921
|
+
- (void * _Nonnull)getMtlLayerPtr SWIFT_WARN_UNUSED_RESULT;
|
|
887
922
|
@property (nonatomic) BOOL autoScale;
|
|
888
|
-
@property (nonatomic, readonly) int64_t nativeGL;
|
|
889
923
|
@property (nonatomic, readonly) int64_t nativeContext;
|
|
924
|
+
@property (nonatomic, readonly) BOOL is2D;
|
|
890
925
|
@property (nonatomic, readonly) CGFloat drawingBufferWidth;
|
|
891
926
|
@property (nonatomic, readonly) CGFloat drawingBufferHeight;
|
|
892
927
|
@property (nonatomic, readonly) float width;
|
|
@@ -896,15 +931,17 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NSMutableDic
|
|
|
896
931
|
- (int64_t)create2DContext:(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)failIfMajorPerformanceCaveat :(int32_t)powerPreference :(BOOL)premultipliedAlpha :(BOOL)preserveDrawingBuffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xrCompatible :(int32_t)fontColor SWIFT_WARN_UNUSED_RESULT;
|
|
897
932
|
- (UIImage * _Nullable)snapshot:(BOOL)flip SWIFT_WARN_UNUSED_RESULT;
|
|
898
933
|
- (BOOL)render;
|
|
899
|
-
- (void)context2DTest:(int64_t)context;
|
|
900
|
-
- (NSString * _Nonnull)context2DTestToDataURL:(int64_t)context SWIFT_WARN_UNUSED_RESULT;
|
|
901
934
|
@property (nonatomic, copy) void (^ _Nullable touchEventListener)(NSString * _Nonnull, UIGestureRecognizer * _Nonnull);
|
|
902
935
|
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
|
|
903
936
|
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
|
|
937
|
+
@property (nonatomic) BOOL ignoreTouchEvents;
|
|
904
938
|
- (void)setListener:(id <NSCCanvasListener> _Nullable)listener;
|
|
905
939
|
@property (nonatomic) NSInteger surfaceWidth;
|
|
906
940
|
@property (nonatomic) NSInteger surfaceHeight;
|
|
907
941
|
- (void)forceLayout:(CGFloat)width :(CGFloat)height;
|
|
942
|
+
- (void)context2DTest:(int64_t)context;
|
|
943
|
+
- (void)context2DPathTest:(int64_t)context;
|
|
944
|
+
- (void)context2DConic:(int64_t)context;
|
|
908
945
|
- (void)layoutSubviews;
|
|
909
946
|
+ (void)getBoundingClientRect:(UIView * _Nonnull)view :(void * _Nonnull)buffer;
|
|
910
947
|
@end
|
|
@@ -939,11 +976,27 @@ SWIFT_CLASS_NAMED("NSCCanvasRenderingContext2D")
|
|
|
939
976
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
940
977
|
@end
|
|
941
978
|
|
|
979
|
+
@class NSCRender;
|
|
980
|
+
@class AVPlayer;
|
|
981
|
+
@class AVPlayerItemVideoOutput;
|
|
982
|
+
|
|
983
|
+
SWIFT_CLASS_NAMED("NSCCanvasUtils")
|
|
984
|
+
@interface NSCCanvasUtils : NSObject
|
|
985
|
+
+ (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
|
|
986
|
+
+ (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;
|
|
987
|
+
+ (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
|
|
988
|
+
+ (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
|
|
989
|
+
+ (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
|
|
990
|
+
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
991
|
+
@end
|
|
992
|
+
|
|
942
993
|
|
|
943
994
|
SWIFT_CLASS_NAMED("NSCImageAsset")
|
|
944
995
|
@interface NSCImageAsset : NSObject
|
|
945
996
|
+ (BOOL)loadImageFromImageSync:(int64_t)context :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
|
|
946
997
|
+ (void)loadImageFromImage:(int64_t)context :(UIImage * _Nonnull)image :(void (^ _Nonnull)(BOOL))callback;
|
|
998
|
+
+ (BOOL)loadImageFromPathSync:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
|
|
999
|
+
+ (void)loadImageFromPath:(int64_t)asset :(NSString * _Nonnull)path :(void (^ _Nonnull)(BOOL))callback;
|
|
947
1000
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
948
1001
|
@end
|
|
949
1002
|
|
|
@@ -959,11 +1012,28 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) dispatch_que
|
|
|
959
1012
|
SWIFT_CLASS_NAMED("NSCRender")
|
|
960
1013
|
@interface NSCRender : NSObject
|
|
961
1014
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
962
|
-
- (void)texImage2D:(int32_t)target :(int32_t)level :(int32_t)internalFormat :(int32_t)format :(int32_t)type :(NSCCanvas * _Nonnull)source :(NSCCanvas * _Nonnull)dest :(BOOL)flipYWebGL;
|
|
963
|
-
- (void)createSurface;
|
|
964
1015
|
@end
|
|
965
1016
|
|
|
966
1017
|
|
|
1018
|
+
SWIFT_CLASS_NAMED("NSCVideoFrame")
|
|
1019
|
+
@interface NSCVideoFrame : NSObject
|
|
1020
|
+
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
|
|
1021
|
+
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
|
|
1022
|
+
@end
|
|
1023
|
+
|
|
1024
|
+
typedef SWIFT_ENUM_NAMED(NSInteger, NSCVideoFrameFormat, "NSCVideoFrameFormat", open) {
|
|
1025
|
+
NSCVideoFrameFormatI420 = 0,
|
|
1026
|
+
NSCVideoFrameFormatI420A = 1,
|
|
1027
|
+
NSCVideoFrameFormatI422 = 2,
|
|
1028
|
+
NSCVideoFrameFormatI444 = 3,
|
|
1029
|
+
NSCVideoFrameFormatNV12 = 4,
|
|
1030
|
+
NSCVideoFrameFormatRGBA = 5,
|
|
1031
|
+
NSCVideoFrameFormatRGBX = 6,
|
|
1032
|
+
NSCVideoFrameFormatBGRA = 7,
|
|
1033
|
+
NSCVideoFrameFormatBGRX = 8,
|
|
1034
|
+
};
|
|
1035
|
+
|
|
1036
|
+
|
|
967
1037
|
SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
|
|
968
1038
|
@interface NSCWebGLRenderingContext : NSObject
|
|
969
1039
|
+ (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 +1041,9 @@ SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
|
|
|
971
1041
|
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
|
|
972
1042
|
@end
|
|
973
1043
|
|
|
974
|
-
@class AVPlayer;
|
|
975
|
-
@class AVPlayerItemVideoOutput;
|
|
976
1044
|
|
|
977
|
-
|
|
978
|
-
|
|
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;
|
|
1045
|
+
@interface UIView (SWIFT_EXTENSION(CanvasNative))
|
|
1046
|
+
- (void)getBoundingClientRect:(void * _Nonnull)buffer;
|
|
985
1047
|
@end
|
|
986
1048
|
|
|
987
1049
|
#endif
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NSCMTLView.h
|
|
3
|
+
// CanvasNative
|
|
4
|
+
//
|
|
5
|
+
// Created by Osei Fortune on 08/10/2024.
|
|
6
|
+
//
|
|
7
|
+
#ifndef NSCMTLView_h
|
|
8
|
+
#define NSCMTLView_h
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
#import <UIKit/UIKit.h>
|
|
12
|
+
#import <MetalKit/MetalKit.h>
|
|
13
|
+
typedef enum {
|
|
14
|
+
kNone,
|
|
15
|
+
kPending,
|
|
16
|
+
kInvalidating
|
|
17
|
+
} NSCSurfaceState;
|
|
18
|
+
|
|
19
|
+
@interface NSCMTLView : UIView
|
|
20
|
+
@property(weak, nonatomic) UIView* canvas;
|
|
21
|
+
@property id<MTLCommandQueue> queue;
|
|
22
|
+
@property int state;
|
|
23
|
+
@property (nonatomic) CGSize drawableSize;
|
|
24
|
+
@property NSUInteger sampleCount;
|
|
25
|
+
-(void) present;
|
|
26
|
+
-(void) setup;
|
|
27
|
+
-(void*) getDevicePtr;
|
|
28
|
+
-(void*) getQueuePtr;
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
#endif /* NSCMTLView_h */
|