NativeMethods_dnn_superres.cs 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System.Diagnostics.Contracts;
  2. using System.Runtime.InteropServices;
  3. #pragma warning disable 1591
  4. #pragma warning disable CA1401 // P/Invokes should not be visible
  5. #pragma warning disable CA2101 // Specify marshaling for P/Invoke string arguments
  6. #pragma warning disable IDE1006 // Naming style
  7. namespace OpenCvSharp.Internal;
  8. static partial class NativeMethods
  9. {
  10. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  11. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  12. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_new1(
  13. out IntPtr returnValue);
  14. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  15. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  16. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_new2(
  17. [MarshalAs(UnmanagedType.LPStr)] string algo, int scale, out IntPtr returnValue);
  18. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  19. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  20. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_delete(IntPtr obj);
  21. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  22. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  23. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_readModel1(
  24. IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string path);
  25. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  26. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  27. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_readModel2(
  28. IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string weights, [MarshalAs(UnmanagedType.LPStr)] string definition);
  29. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  30. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  31. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_setModel(
  32. IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string algo, int scale);
  33. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  34. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  35. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_setPreferableBackend(
  36. IntPtr obj, int backendId);
  37. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  38. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  39. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_setPreferableTarget(
  40. IntPtr obj, int targetId);
  41. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  42. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  43. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_upsample(
  44. IntPtr obj, IntPtr img, IntPtr result);
  45. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  46. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  47. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_upsampleMultioutput(
  48. IntPtr obj, IntPtr img, IntPtr imgsNew,
  49. int[] scaleFactors, int scaleFactorsSize,
  50. string[] nodeNames, int nodeNamesSize);
  51. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  52. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  53. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_getScale(
  54. IntPtr obj, out int returnValue);
  55. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false,
  56. ThrowOnUnmappableChar = true, ExactSpelling = true)]
  57. public static extern ExceptionStatus dnn_superres_DnnSuperResImpl_getAlgorithm(
  58. IntPtr obj, IntPtr returnValue);
  59. }