Skip to content

Commit

Permalink
Update based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelkang committed Aug 19, 2021
1 parent cb1bfd6 commit cd3178c
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 37 deletions.
38 changes: 33 additions & 5 deletions src/Vision/VNUtils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// VNUtils.cs
//
// Authors:
Expand Down Expand Up @@ -54,21 +54,49 @@ public static partial class VNUtils {
[DllImport (Constants.VisionLibrary, EntryPoint = "VNNormalizedRectForImageRect")]
public static extern CGRect GetNormalizedRect (CGRect imageRect, nuint imageWidth, nuint imageHeight);

#if NET
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("tvos15.0")]
[SupportedOSPlatform ("macos12.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#endif
[DllImport (Constants.VisionLibrary, EntryPoint="VNImagePointForNormalizedPointUsingRegionOfInterest")]
public static extern CGPoint GetImagePoint (CGPoint normalizedPoint, nuint imageWidth, nuint imageHeight, CGRect roi);
public static extern CGPoint GetImagePoint (CGPoint normalizedPoint, nuint imageWidth, nuint imageHeight, CGRect regionOfInterest);

#if NET
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("tvos15.0")]
[SupportedOSPlatform ("macos12.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#endif
[DllImport (Constants.VisionLibrary, EntryPoint="VNNormalizedPointForImagePointUsingRegionOfInterest")]
public static extern CGPoint GetNormalizedPoint (CGPoint imagePoint, nuint imageWidth, nuint imageHeight, CGRect roi);
public static extern CGPoint GetNormalizedPoint (CGPoint imagePoint, nuint imageWidth, nuint imageHeight, CGRect regionOfInterest);

#if NET
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("tvos15.0")]
[SupportedOSPlatform ("macos12.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#endif
[DllImport (Constants.VisionLibrary, EntryPoint="VNImageRectForNormalizedRectUsingRegionOfInterest")]
public static extern CGRect GetImageRect (CGRect normalizedRect, nuint imageWidth, nuint imageHeight, CGRect roi);
public static extern CGRect GetImageRect (CGRect normalizedRect, nuint imageWidth, nuint imageHeight, CGRect regionOfInterest);

#if NET
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("tvos15.0")]
[SupportedOSPlatform ("macos12.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
#endif
[DllImport (Constants.VisionLibrary, EntryPoint="VNNormalizedRectForImageRectUsingRegionOfInterest")]
public static extern CGRect GetNormalizedRect (CGRect imageRect, nuint imageWidth, nuint imageHeight, CGRect roi);
public static extern CGRect GetNormalizedRect (CGRect imageRect, nuint imageWidth, nuint imageHeight, CGRect regionOfInterest);

[DllImport ("__Internal", EntryPoint = "xamarin_CGPoint__VNNormalizedFaceBoundingBoxPointForLandmarkPoint_Vector2_CGRect_nuint_nuint_string")]
static extern CGPoint VNNormalizedFaceBoundingBoxPointForLandmarkPoint (Vector2 faceLandmarkPoint, CGRect faceBoundingBox, nuint imageWidth, nuint imageHeight, out IntPtr error);
Expand Down
Loading

0 comments on commit cd3178c

Please sign in to comment.