RadialVarianceHash.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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 RadialVarianceHash
  10. //javadoc: RadialVarianceHash
  11. public class RadialVarianceHash : 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_RadialVarianceHash_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal RadialVarianceHash (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new RadialVarianceHash __fromPtr__ (IntPtr addr) { return new RadialVarianceHash (addr); }
  34. //
  35. // C++: static Ptr_RadialVarianceHash cv::img_hash::RadialVarianceHash::create(double sigma = 1, int numOfAngleLine = 180)
  36. //
  37. //javadoc: RadialVarianceHash::create(sigma, numOfAngleLine)
  38. public static RadialVarianceHash create (double sigma, int numOfAngleLine)
  39. {
  40. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  41. RadialVarianceHash retVal = RadialVarianceHash.__fromPtr__(img_1hash_RadialVarianceHash_create_10(sigma, numOfAngleLine));
  42. return retVal;
  43. #else
  44. return null;
  45. #endif
  46. }
  47. //javadoc: RadialVarianceHash::create(sigma)
  48. public static RadialVarianceHash create (double sigma)
  49. {
  50. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  51. RadialVarianceHash retVal = RadialVarianceHash.__fromPtr__(img_1hash_RadialVarianceHash_create_11(sigma));
  52. return retVal;
  53. #else
  54. return null;
  55. #endif
  56. }
  57. //javadoc: RadialVarianceHash::create()
  58. public static RadialVarianceHash create ()
  59. {
  60. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  61. RadialVarianceHash retVal = RadialVarianceHash.__fromPtr__(img_1hash_RadialVarianceHash_create_12());
  62. return retVal;
  63. #else
  64. return null;
  65. #endif
  66. }
  67. //
  68. // C++: double cv::img_hash::RadialVarianceHash::getSigma()
  69. //
  70. //javadoc: RadialVarianceHash::getSigma()
  71. public double getSigma ()
  72. {
  73. ThrowIfDisposed ();
  74. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  75. double retVal = img_1hash_RadialVarianceHash_getSigma_10(nativeObj);
  76. return retVal;
  77. #else
  78. return -1;
  79. #endif
  80. }
  81. //
  82. // C++: int cv::img_hash::RadialVarianceHash::getNumOfAngleLine()
  83. //
  84. //javadoc: RadialVarianceHash::getNumOfAngleLine()
  85. public int getNumOfAngleLine ()
  86. {
  87. ThrowIfDisposed ();
  88. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  89. int retVal = img_1hash_RadialVarianceHash_getNumOfAngleLine_10(nativeObj);
  90. return retVal;
  91. #else
  92. return -1;
  93. #endif
  94. }
  95. //
  96. // C++: void cv::img_hash::RadialVarianceHash::setNumOfAngleLine(int value)
  97. //
  98. //javadoc: RadialVarianceHash::setNumOfAngleLine(value)
  99. public void setNumOfAngleLine (int value)
  100. {
  101. ThrowIfDisposed ();
  102. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  103. img_1hash_RadialVarianceHash_setNumOfAngleLine_10(nativeObj, value);
  104. return;
  105. #else
  106. return;
  107. #endif
  108. }
  109. //
  110. // C++: void cv::img_hash::RadialVarianceHash::setSigma(double value)
  111. //
  112. //javadoc: RadialVarianceHash::setSigma(value)
  113. public void setSigma (double value)
  114. {
  115. ThrowIfDisposed ();
  116. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  117. img_1hash_RadialVarianceHash_setSigma_10(nativeObj, value);
  118. return;
  119. #else
  120. return;
  121. #endif
  122. }
  123. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  124. const string LIBNAME = "__Internal";
  125. #else
  126. const string LIBNAME = "opencvforunity";
  127. #endif
  128. // C++: static Ptr_RadialVarianceHash cv::img_hash::RadialVarianceHash::create(double sigma = 1, int numOfAngleLine = 180)
  129. [DllImport (LIBNAME)]
  130. private static extern IntPtr img_1hash_RadialVarianceHash_create_10 (double sigma, int numOfAngleLine);
  131. [DllImport (LIBNAME)]
  132. private static extern IntPtr img_1hash_RadialVarianceHash_create_11 (double sigma);
  133. [DllImport (LIBNAME)]
  134. private static extern IntPtr img_1hash_RadialVarianceHash_create_12 ();
  135. // C++: double cv::img_hash::RadialVarianceHash::getSigma()
  136. [DllImport (LIBNAME)]
  137. private static extern double img_1hash_RadialVarianceHash_getSigma_10 (IntPtr nativeObj);
  138. // C++: int cv::img_hash::RadialVarianceHash::getNumOfAngleLine()
  139. [DllImport (LIBNAME)]
  140. private static extern int img_1hash_RadialVarianceHash_getNumOfAngleLine_10 (IntPtr nativeObj);
  141. // C++: void cv::img_hash::RadialVarianceHash::setNumOfAngleLine(int value)
  142. [DllImport (LIBNAME)]
  143. private static extern void img_1hash_RadialVarianceHash_setNumOfAngleLine_10 (IntPtr nativeObj, int value);
  144. // C++: void cv::img_hash::RadialVarianceHash::setSigma(double value)
  145. [DllImport (LIBNAME)]
  146. private static extern void img_1hash_RadialVarianceHash_setSigma_10 (IntPtr nativeObj, double value);
  147. // native support for java finalize()
  148. [DllImport (LIBNAME)]
  149. private static extern void img_1hash_RadialVarianceHash_delete (IntPtr nativeObj);
  150. }
  151. }