TermCriteria.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // TermCriteria.h
  3. //
  4. // Created by Giles Payne on 2019/10/08.
  5. //
  6. #pragma once
  7. #ifdef __cplusplus
  8. #import "opencv2/core.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. NS_ASSUME_NONNULL_BEGIN
  14. /**
  15. * Class representing termination criteria for iterative algorithms.
  16. */
  17. CV_EXPORTS @interface TermCriteria : NSObject
  18. #pragma mark - Properties
  19. @property(class, readonly) int COUNT;
  20. @property(class, readonly) int EPS;
  21. @property(class, readonly) int MAX_ITER;
  22. @property int type;
  23. @property int maxCount;
  24. @property double epsilon;
  25. #ifdef __cplusplus
  26. @property(readonly) cv::TermCriteria& nativeRef;
  27. #endif
  28. #pragma mark - Constructors
  29. - (instancetype)init;
  30. - (instancetype)initWithType:(int)type maxCount:(int)maxCount epsilon:(double)epsilon;
  31. - (instancetype)initWithVals:(NSArray<NSNumber*>*)vals;
  32. #ifdef __cplusplus
  33. + (instancetype)fromNative:(cv::TermCriteria&)nativeTermCriteria;
  34. #endif
  35. #pragma mark - Methods
  36. /**
  37. * Set the termination criteria values from the values of an array
  38. * @param vals The array of values from which to set the termination criteria values
  39. */
  40. - (void)set:(NSArray<NSNumber*>*)vals NS_SWIFT_NAME(set(vals:));
  41. #pragma mark - Common Methods
  42. /**
  43. * Clone object
  44. */
  45. - (TermCriteria*)clone;
  46. /**
  47. * Compare for equality
  48. * @param other Object to compare
  49. */
  50. - (BOOL)isEqual:(nullable id)object;
  51. /**
  52. * Calculate hash value for this object
  53. */
  54. - (NSUInteger)hash;
  55. /**
  56. * Returns a string that describes the contents of the object
  57. */
  58. - (NSString*)description;
  59. @end
  60. NS_ASSUME_NONNULL_END