Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices;
using OpenCvSharp.Aruco;

#pragma warning disable 1591
Expand All @@ -10,83 +9,83 @@

static partial class NativeMethods
{
[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_detectMarkers(
IntPtr image, IntPtr dictionary, IntPtr corners, IntPtr ids, ref DetectorParameters detectParameters, IntPtr outrejectedImgPoints);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_drawDetectedMarkers(
IntPtr image,
[MarshalAs(UnmanagedType.LPArray)] IntPtr[] corners, int cornerSize1, int[] contoursSize2,
[MarshalAs(UnmanagedType.LPArray)] int[] ids, int idxLength, Scalar borderColor);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_drawDetectedMarkers(
IntPtr image, [MarshalAs(UnmanagedType.LPArray)] IntPtr[] corners, int cornerSize1, int[] contoursSize2, IntPtr ids, int idxLength, Scalar borderColor);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_estimatePoseSingleMarkers(
[MarshalAs(UnmanagedType.LPArray)] IntPtr[] corners, int cornersLength1,
int[] cornersLengths2, float markerLength,
IntPtr cameraMatrix, IntPtr distCoeffs, IntPtr rvecs, IntPtr tvecs, IntPtr objPoints);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_getPredefinedDictionary(int name, out IntPtr returnValue);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]

Check warning on line 35 in src/OpenCvSharp/Internal/PInvoke/NativeMethods/NativeMethods_aruco.cs

View workflow job for this annotation

GitHub Actions / build_test (24.04, libgtk-3-dev)

Specify marshaling for P/Invoke string arguments (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2101)

Check warning on line 35 in src/OpenCvSharp/Internal/PInvoke/NativeMethods/NativeMethods_aruco.cs

View workflow job for this annotation

GitHub Actions / build_test (24.04, libgtk-3-dev)

Specify marshaling for P/Invoke string arguments (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2101)

Check warning on line 35 in src/OpenCvSharp/Internal/PInvoke/NativeMethods/NativeMethods_aruco.cs

View workflow job for this annotation

GitHub Actions / build

Specify marshaling for P/Invoke string arguments (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2101)

Check warning on line 35 in src/OpenCvSharp/Internal/PInvoke/NativeMethods/NativeMethods_aruco.cs

View workflow job for this annotation

GitHub Actions / build

Specify marshaling for P/Invoke string arguments (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2101)

Check warning on line 35 in src/OpenCvSharp/Internal/PInvoke/NativeMethods/NativeMethods_aruco.cs

View workflow job for this annotation

GitHub Actions / build_test (22.04, libgtk2.0-dev)

Specify marshaling for P/Invoke string arguments (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2101)

Check warning on line 35 in src/OpenCvSharp/Internal/PInvoke/NativeMethods/NativeMethods_aruco.cs

View workflow job for this annotation

GitHub Actions / build_test (22.04, libgtk2.0-dev)

Specify marshaling for P/Invoke string arguments (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2101)

Check warning on line 35 in src/OpenCvSharp/Internal/PInvoke/NativeMethods/NativeMethods_aruco.cs

View workflow job for this annotation

GitHub Actions / build

Specify marshaling for P/Invoke string arguments (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2101)
public static extern ExceptionStatus aruco_readDictionary(string dictionaryFile, out IntPtr returnValue);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_detectCharucoDiamond(
IntPtr image, [MarshalAs(UnmanagedType.LPArray)] IntPtr[] markerCorners, int markerCornersSize1, int[] markerCornersSize2,
IntPtr markerIds, float squareMarkerLengthRate,
IntPtr diamondCorners, IntPtr diamondIds, IntPtr cameraMatrix, IntPtr distCoeffs);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_drawDetectedDiamonds(
IntPtr image,
[MarshalAs(UnmanagedType.LPArray)] IntPtr[] corners, int cornerSize1, int[] contoursSize2,
IntPtr ids, Scalar borderColor);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_detectCharucoBoard(
IntPtr image,
int squaresX, int squaresY, float squareLength, float markerLength, int arucoDictId,
IntPtr charucoCorners, IntPtr charucoIds, IntPtr markerCorners, IntPtr markerIds);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_interpolateCornersCharuco(
IntPtr image,
int squaresX, int squaresY, float squareLength, float markerLength, int arucoDictId,
[MarshalAs(UnmanagedType.LPArray)] IntPtr[] markerCorners, int markerCornersSize1, int[] markerCornersSize2, IntPtr markerIds,
IntPtr charucoCorners, IntPtr charucoIds);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_drawDetectedCornersCharuco(
IntPtr image,
IntPtr corners, IntPtr ids, Scalar cornerColor);

#region Dictionary

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_delete(IntPtr ptr);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_setMarkerSize(IntPtr obj, int value);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_setMaxCorrectionBits(IntPtr obj, int value);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_getBytesList(IntPtr obj, out IntPtr returnValue);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_getMarkerSize(IntPtr obj, out int returnValue);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_getMaxCorrectionBits(IntPtr obj, out int returnValue);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_identify(
IntPtr obj,
IntPtr onlyBits,
Expand All @@ -95,28 +94,28 @@
double maxCorrectionRate,
out int returnValue);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_getDistanceToId(
IntPtr obj,
IntPtr bits,
int id,
int allRotations,
out int returnValue);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_generateImageMarker(
IntPtr obj,
int id,
int sidePixels,
IntPtr img,
int borderBits);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_getByteListFromBits(
IntPtr bits,
IntPtr returnValue);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus aruco_Dictionary_getBitsFromByteList(
IntPtr byteList,
int markerSize,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices;
#pragma warning disable 1591
#pragma warning disable CA1401 // P/Invokes should not be visible
#pragma warning disable CA1707 // Underscore
Expand All @@ -12,41 +11,41 @@ namespace OpenCvSharp.Internal;
static partial class NativeMethods
{

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus barcode_BarcodeDetector_create(
[MarshalAs(UnmanagedType.LPStr)] string super_resolution_prototxt_path,
[MarshalAs(UnmanagedType.LPStr)] string super_resolution_caffe_model_path,
out IntPtr ptr
);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus barcode_BarcodeDetector_setDownsamplingThreshold(
IntPtr obj,
double thresh
);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus barcode_BarcodeDetector_setDetectorScales(
IntPtr obj,
IntPtr sizes
);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus barcode_BarcodeDetector_setGradientThreshold(
IntPtr obj,
double thresh
);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus barcode_Ptr_BarcodeDetector_get(
IntPtr ptr,
out IntPtr ret
);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus barcode_Ptr_BarcodeDetector_delete(IntPtr ptr);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus barcode_BarcodeDetector_decodeWithType(
IntPtr obj,
IntPtr inputImage,
Expand All @@ -55,7 +54,7 @@ public static extern ExceptionStatus barcode_BarcodeDetector_decodeWithType(
IntPtr types
);

[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern ExceptionStatus barcode_BarcodeDetector_detectAndDecodeWithType(
IntPtr obj,
IntPtr inputImage,
Expand Down
Loading
Loading