MarrHildrethHash.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.Img_hashModule
  8. {
  9. // C++: class MarrHildrethHash
  10. //javadoc: MarrHildrethHash
  11. public class MarrHildrethHash : ImgHashBase
  12. {
  13. protected override void Dispose (bool disposing)
  14. {
  15. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  16. try {
  17. if (disposing) {
  18. }
  19. if (IsEnabledDispose) {
  20. if (nativeObj != IntPtr.Zero)
  21. img_1hash_MarrHildrethHash_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal MarrHildrethHash (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new MarrHildrethHash __fromPtr__ (IntPtr addr) { return new MarrHildrethHash (addr); }
  34. //
  35. // C++: static Ptr_MarrHildrethHash cv::img_hash::MarrHildrethHash::create(float alpha = 2.0f, float scale = 1.0f)
  36. //
  37. //javadoc: MarrHildrethHash::create(alpha, scale)
  38. public static MarrHildrethHash create (float alpha, float scale)
  39. {
  40. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  41. MarrHildrethHash retVal = MarrHildrethHash.__fromPtr__(img_1hash_MarrHildrethHash_create_10(alpha, scale));
  42. return retVal;
  43. #else
  44. return null;
  45. #endif
  46. }
  47. //javadoc: MarrHildrethHash::create(alpha)
  48. public static MarrHildrethHash create (float alpha)
  49. {
  50. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  51. MarrHildrethHash retVal = MarrHildrethHash.__fromPtr__(img_1hash_MarrHildrethHash_create_11(alpha));
  52. return retVal;
  53. #else
  54. return null;
  55. #endif
  56. }
  57. //javadoc: MarrHildrethHash::create()
  58. public static MarrHildrethHash create ()
  59. {
  60. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  61. MarrHildrethHash retVal = MarrHildrethHash.__fromPtr__(img_1hash_MarrHildrethHash_create_12());
  62. return retVal;
  63. #else
  64. return null;
  65. #endif
  66. }
  67. //
  68. // C++: float cv::img_hash::MarrHildrethHash::getAlpha()
  69. //
  70. //javadoc: MarrHildrethHash::getAlpha()
  71. public float getAlpha ()
  72. {
  73. ThrowIfDisposed ();
  74. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  75. float retVal = img_1hash_MarrHildrethHash_getAlpha_10(nativeObj);
  76. return retVal;
  77. #else
  78. return -1;
  79. #endif
  80. }
  81. //
  82. // C++: float cv::img_hash::MarrHildrethHash::getScale()
  83. //
  84. //javadoc: MarrHildrethHash::getScale()
  85. public float getScale ()
  86. {
  87. ThrowIfDisposed ();
  88. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  89. float retVal = img_1hash_MarrHildrethHash_getScale_10(nativeObj);
  90. return retVal;
  91. #else
  92. return -1;
  93. #endif
  94. }
  95. //
  96. // C++: void cv::img_hash::MarrHildrethHash::setKernelParam(float alpha, float scale)
  97. //
  98. //javadoc: MarrHildrethHash::setKernelParam(alpha, scale)
  99. public void setKernelParam (float alpha, float scale)
  100. {
  101. ThrowIfDisposed ();
  102. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  103. img_1hash_MarrHildrethHash_setKernelParam_10(nativeObj, alpha, scale);
  104. return;
  105. #else
  106. return;
  107. #endif
  108. }
  109. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  110. const string LIBNAME = "__Internal";
  111. #else
  112. const string LIBNAME = "opencvforunity";
  113. #endif
  114. // C++: static Ptr_MarrHildrethHash cv::img_hash::MarrHildrethHash::create(float alpha = 2.0f, float scale = 1.0f)
  115. [DllImport (LIBNAME)]
  116. private static extern IntPtr img_1hash_MarrHildrethHash_create_10 (float alpha, float scale);
  117. [DllImport (LIBNAME)]
  118. private static extern IntPtr img_1hash_MarrHildrethHash_create_11 (float alpha);
  119. [DllImport (LIBNAME)]
  120. private static extern IntPtr img_1hash_MarrHildrethHash_create_12 ();
  121. // C++: float cv::img_hash::MarrHildrethHash::getAlpha()
  122. [DllImport (LIBNAME)]
  123. private static extern float img_1hash_MarrHildrethHash_getAlpha_10 (IntPtr nativeObj);
  124. // C++: float cv::img_hash::MarrHildrethHash::getScale()
  125. [DllImport (LIBNAME)]
  126. private static extern float img_1hash_MarrHildrethHash_getScale_10 (IntPtr nativeObj);
  127. // C++: void cv::img_hash::MarrHildrethHash::setKernelParam(float alpha, float scale)
  128. [DllImport (LIBNAME)]
  129. private static extern void img_1hash_MarrHildrethHash_setKernelParam_10 (IntPtr nativeObj, float alpha, float scale);
  130. // native support for java finalize()
  131. [DllImport (LIBNAME)]
  132. private static extern void img_1hash_MarrHildrethHash_delete (IntPtr nativeObj);
  133. }
  134. }