MatOfFloat.h 1.0 KB

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