From b978393303805807ca06543b548f7542d5bd3463 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 19 Jul 2022 14:44:11 -0400 Subject: [PATCH] [Vision] Add support for Xcode 14 beta 1,2 & 3 (#15538) Co-authored-by: Alex Soto --- src/vision.cs | 31 +++++++++++++++++++ .../api-annotations-dotnet/iOS-Vision.todo | 11 ------- .../api-annotations-dotnet/macOS-Vision.todo | 11 ------- .../api-annotations-dotnet/tvOS-Vision.todo | 11 ------- tests/xtro-sharpie/iOS-Vision.todo | 11 ------- tests/xtro-sharpie/macOS-Vision.todo | 11 ------- tests/xtro-sharpie/tvOS-Vision.todo | 11 ------- 7 files changed, 31 insertions(+), 66 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-Vision.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-Vision.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/tvOS-Vision.todo delete mode 100644 tests/xtro-sharpie/iOS-Vision.todo delete mode 100644 tests/xtro-sharpie/macOS-Vision.todo delete mode 100644 tests/xtro-sharpie/tvOS-Vision.todo diff --git a/src/vision.cs b/src/vision.cs index fa441694ed..6b70df5fe6 100644 --- a/src/vision.cs +++ b/src/vision.cs @@ -39,6 +39,7 @@ namespace Vision { [TV (11,0), Mac (10,13), iOS (11,0)] [Native] enum VNErrorCode : long { + TuriCore = -1, Ok = 0, RequestCancelled, InvalidFormat, @@ -59,6 +60,7 @@ namespace Vision { DataUnavailable, TimeStampNotFound, UnsupportedRequest, + Timeout, } [TV (11,0), Mac (10,13), iOS (11,0)] @@ -74,6 +76,10 @@ namespace Vision { CenterCrop = 0, ScaleFit = 1, ScaleFill = 2, + [TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + ScaleFitRotate90Ccw = 256 + ScaleFit, + [TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + ScaleFillRotate90Ccw = 256 + ScaleFill, } [TV (11,0), Mac (10,13), iOS (11,0)] @@ -663,6 +669,15 @@ namespace Vision { Fast, } + [TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Native] + public enum VNPointsClassification : long + { + Disconnected = 0, + OpenPath, + ClosedPath, + } + [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] [BaseType (typeof(VNDetectedObjectObservation))] [DisableDefaultCtor] @@ -1081,6 +1096,10 @@ namespace Vision { [BindAs (typeof (nfloat []))] [NullAllowed, Export ("precisionEstimatesPerPoint")] NSNumber [] PrecisionEstimatesPerPoint { get; } + + [TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("pointsClassification")] + VNPointsClassification PointsClassification { get; } } [TV (11,0), Mac (10,13), iOS (11,0)] @@ -1837,6 +1856,10 @@ namespace Vision { [Export ("angle")] nfloat Angle { get; } + + [TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("transformForImageWidth:height:")] + CGAffineTransform CreateTransform (nuint width, nuint height); } [TV (11,0), Mac (10,13), iOS (11,0)] @@ -2829,6 +2852,10 @@ namespace Vision { [Static] [Export ("currentRevision")] VNRecognizeTextRequestRevision CurrentRevision { get; } + + [TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("automaticallyDetectsLanguage")] + bool AutomaticallyDetectsLanguage { get; set; } } [TV (13,0), Mac (10,15), iOS (13,0)] @@ -3477,6 +3504,10 @@ namespace Vision { [Static] [Export ("currentRevision")] VNGenerateOpticalFlowRequestRevision CurrentRevision { get; } + + [TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("keepNetworkOutput")] + bool KeepNetworkOutput { get; set; } } [TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-Vision.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-Vision.todo deleted file mode 100644 index 3089ee5d86..0000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-Vision.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-enum! VNPointsClassification not bound -!missing-enum-value! VNErrorCode native value VNErrorTimeout = 20 not bound -!missing-enum-value! VNErrorCode native value VNErrorTuriCoreErrorCode = -1 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFillRotate90CCW = 258 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFitRotate90CCW = 257 not bound -!missing-selector! VNFaceLandmarkRegion2D::pointsClassification not bound -!missing-selector! VNGenerateOpticalFlowRequest::keepNetworkOutput not bound -!missing-selector! VNGenerateOpticalFlowRequest::setKeepNetworkOutput: not bound -!missing-selector! VNHorizonObservation::transformForImageWidth:height: not bound -!missing-selector! VNRecognizeTextRequest::automaticallyDetectsLanguage not bound -!missing-selector! VNRecognizeTextRequest::setAutomaticallyDetectsLanguage: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-Vision.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-Vision.todo deleted file mode 100644 index 3089ee5d86..0000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-Vision.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-enum! VNPointsClassification not bound -!missing-enum-value! VNErrorCode native value VNErrorTimeout = 20 not bound -!missing-enum-value! VNErrorCode native value VNErrorTuriCoreErrorCode = -1 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFillRotate90CCW = 258 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFitRotate90CCW = 257 not bound -!missing-selector! VNFaceLandmarkRegion2D::pointsClassification not bound -!missing-selector! VNGenerateOpticalFlowRequest::keepNetworkOutput not bound -!missing-selector! VNGenerateOpticalFlowRequest::setKeepNetworkOutput: not bound -!missing-selector! VNHorizonObservation::transformForImageWidth:height: not bound -!missing-selector! VNRecognizeTextRequest::automaticallyDetectsLanguage not bound -!missing-selector! VNRecognizeTextRequest::setAutomaticallyDetectsLanguage: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-Vision.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-Vision.todo deleted file mode 100644 index 3089ee5d86..0000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-Vision.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-enum! VNPointsClassification not bound -!missing-enum-value! VNErrorCode native value VNErrorTimeout = 20 not bound -!missing-enum-value! VNErrorCode native value VNErrorTuriCoreErrorCode = -1 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFillRotate90CCW = 258 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFitRotate90CCW = 257 not bound -!missing-selector! VNFaceLandmarkRegion2D::pointsClassification not bound -!missing-selector! VNGenerateOpticalFlowRequest::keepNetworkOutput not bound -!missing-selector! VNGenerateOpticalFlowRequest::setKeepNetworkOutput: not bound -!missing-selector! VNHorizonObservation::transformForImageWidth:height: not bound -!missing-selector! VNRecognizeTextRequest::automaticallyDetectsLanguage not bound -!missing-selector! VNRecognizeTextRequest::setAutomaticallyDetectsLanguage: not bound diff --git a/tests/xtro-sharpie/iOS-Vision.todo b/tests/xtro-sharpie/iOS-Vision.todo deleted file mode 100644 index 3089ee5d86..0000000000 --- a/tests/xtro-sharpie/iOS-Vision.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-enum! VNPointsClassification not bound -!missing-enum-value! VNErrorCode native value VNErrorTimeout = 20 not bound -!missing-enum-value! VNErrorCode native value VNErrorTuriCoreErrorCode = -1 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFillRotate90CCW = 258 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFitRotate90CCW = 257 not bound -!missing-selector! VNFaceLandmarkRegion2D::pointsClassification not bound -!missing-selector! VNGenerateOpticalFlowRequest::keepNetworkOutput not bound -!missing-selector! VNGenerateOpticalFlowRequest::setKeepNetworkOutput: not bound -!missing-selector! VNHorizonObservation::transformForImageWidth:height: not bound -!missing-selector! VNRecognizeTextRequest::automaticallyDetectsLanguage not bound -!missing-selector! VNRecognizeTextRequest::setAutomaticallyDetectsLanguage: not bound diff --git a/tests/xtro-sharpie/macOS-Vision.todo b/tests/xtro-sharpie/macOS-Vision.todo deleted file mode 100644 index 3089ee5d86..0000000000 --- a/tests/xtro-sharpie/macOS-Vision.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-enum! VNPointsClassification not bound -!missing-enum-value! VNErrorCode native value VNErrorTimeout = 20 not bound -!missing-enum-value! VNErrorCode native value VNErrorTuriCoreErrorCode = -1 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFillRotate90CCW = 258 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFitRotate90CCW = 257 not bound -!missing-selector! VNFaceLandmarkRegion2D::pointsClassification not bound -!missing-selector! VNGenerateOpticalFlowRequest::keepNetworkOutput not bound -!missing-selector! VNGenerateOpticalFlowRequest::setKeepNetworkOutput: not bound -!missing-selector! VNHorizonObservation::transformForImageWidth:height: not bound -!missing-selector! VNRecognizeTextRequest::automaticallyDetectsLanguage not bound -!missing-selector! VNRecognizeTextRequest::setAutomaticallyDetectsLanguage: not bound diff --git a/tests/xtro-sharpie/tvOS-Vision.todo b/tests/xtro-sharpie/tvOS-Vision.todo deleted file mode 100644 index 3089ee5d86..0000000000 --- a/tests/xtro-sharpie/tvOS-Vision.todo +++ /dev/null @@ -1,11 +0,0 @@ -!missing-enum! VNPointsClassification not bound -!missing-enum-value! VNErrorCode native value VNErrorTimeout = 20 not bound -!missing-enum-value! VNErrorCode native value VNErrorTuriCoreErrorCode = -1 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFillRotate90CCW = 258 not bound -!missing-enum-value! VNImageCropAndScaleOption native value VNImageCropAndScaleOptionScaleFitRotate90CCW = 257 not bound -!missing-selector! VNFaceLandmarkRegion2D::pointsClassification not bound -!missing-selector! VNGenerateOpticalFlowRequest::keepNetworkOutput not bound -!missing-selector! VNGenerateOpticalFlowRequest::setKeepNetworkOutput: not bound -!missing-selector! VNHorizonObservation::transformForImageWidth:height: not bound -!missing-selector! VNRecognizeTextRequest::automaticallyDetectsLanguage not bound -!missing-selector! VNRecognizeTextRequest::setAutomaticallyDetectsLanguage: not bound