MatOfPoint2f.h 1.1 KB

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