MatOfDouble.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // MatOfDouble.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 doubles
  11. */
  12. CV_EXPORTS @interface MatOfDouble : Mat
  13. #pragma mark - Constructors
  14. #ifdef __cplusplus
  15. - (instancetype)initWithNativeMat:(cv::Mat*)nativeMat;
  16. #endif
  17. /**
  18. * Create MatOfDouble from Mat object
  19. * @param mat Mat object from which to create MatOfDouble
  20. */
  21. - (instancetype)initWithMat:(Mat*)mat;
  22. /**
  23. * Create MatOfDouble from array
  24. * @param array Array from which to create MatOfDouble
  25. */
  26. - (instancetype)initWithArray:(NSArray<NSNumber*>*)array;
  27. #pragma mark - Methods
  28. /**
  29. * Allocate specified number of elements
  30. * @param elemNumber Number of elements
  31. */
  32. - (void)alloc:(int)elemNumber;
  33. /**
  34. * Populate Mat with elements of an array
  35. * @param array Array with which to populate the Mat
  36. */
  37. - (void)fromArray:(NSArray<NSNumber*>*)array;
  38. /**
  39. * Output Mat elements as an array
  40. */
  41. - (NSArray<NSNumber*>*)toArray;
  42. /**
  43. * Total number of values in Mat
  44. */
  45. - (int)length;
  46. @end
  47. NS_ASSUME_NONNULL_END