MatOfRect2d.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // MatOfRect2d.h
  3. //
  4. // Created by Giles Payne on 2019/12/27.
  5. //
  6. #pragma once
  7. #import "Mat.h"
  8. @class Rect2d;
  9. NS_ASSUME_NONNULL_BEGIN
  10. /**
  11. * Mat representation of an array of Rect2d objects
  12. */
  13. CV_EXPORTS @interface MatOfRect2d : Mat
  14. #pragma mark - Constructors
  15. #ifdef __cplusplus
  16. - (instancetype)initWithNativeMat:(cv::Mat*)nativeMat;
  17. + (instancetype)fromNative:(cv::Mat*)nativeMat;
  18. #endif
  19. /**
  20. * Create MatOfRect2d from Mat object
  21. * @param mat Mat object from which to create MatOfRect2d
  22. */
  23. - (instancetype)initWithMat:(Mat*)mat;
  24. /**
  25. * Create MatOfRect2d from array
  26. * @param array Array from which to create MatOfRect2d
  27. */
  28. - (instancetype)initWithArray:(NSArray<Rect2d*>*)array;
  29. #pragma mark - Methods
  30. /**
  31. * Allocate specified number of elements
  32. * @param elemNumber Number of elements
  33. */
  34. - (void)alloc:(int)elemNumber;
  35. /**
  36. * Populate Mat with elements of an array
  37. * @param array Array with which to populate the Mat
  38. */
  39. - (void)fromArray:(NSArray<Rect2d*>*)array;
  40. /**
  41. * Output Mat elements as an array of Rect2d objects
  42. */
  43. - (NSArray<Rect2d*>*)toArray;
  44. /**
  45. * Total number of values in Mat
  46. */
  47. - (int)length;
  48. @end
  49. NS_ASSUME_NONNULL_END