MatOfRect2i.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // MatOfRect2i.h
  3. //
  4. // Created by Giles Payne on 2019/12/27.
  5. //
  6. #pragma once
  7. #import "Mat.h"
  8. @class Rect2i;
  9. NS_ASSUME_NONNULL_BEGIN
  10. /**
  11. * Mat representation of an array of Rect objects
  12. */
  13. NS_SWIFT_NAME(MatOfRect)
  14. CV_EXPORTS @interface MatOfRect2i : Mat
  15. #pragma mark - Constructors
  16. #ifdef __cplusplus
  17. - (instancetype)initWithNativeMat:(cv::Mat*)nativeMat;
  18. #endif
  19. /**
  20. * Create MatOfRect from Mat object
  21. * @param mat Mat object from which to create MatOfRect
  22. */
  23. - (instancetype)initWithMat:(Mat*)mat;
  24. /**
  25. * Create MatOfRect from array
  26. * @param array Array from which to create MatOfRect
  27. */
  28. - (instancetype)initWithArray:(NSArray<Rect2i*>*)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<Rect2i*>*)array;
  40. /**
  41. * Output Mat elements as an array of Rect objects
  42. */
  43. - (NSArray<Rect2i*>*)toArray;
  44. /**
  45. * Total number of values in Mat
  46. */
  47. - (int)length;
  48. @end
  49. NS_ASSUME_NONNULL_END