Float6.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. //
  2. // Float6.h
  3. //
  4. // Created by Giles Payne on 2020/02/05.
  5. //
  6. #pragma once
  7. #ifdef __cplusplus
  8. #import "opencv2/core.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. @class Mat;
  14. NS_ASSUME_NONNULL_BEGIN
  15. /**
  16. * Simple wrapper for a vector of six `float`
  17. */
  18. CV_EXPORTS @interface Float6 : NSObject
  19. #pragma mark - Properties
  20. /**
  21. * First vector element
  22. */
  23. @property float v0;
  24. /**
  25. * Second vector element
  26. */
  27. @property float v1;
  28. /**
  29. * Third vector element
  30. */
  31. @property float v2;
  32. /**
  33. * Fourth vector element
  34. */
  35. @property float v3;
  36. /**
  37. * Fifth vector element
  38. */
  39. @property float v4;
  40. /**
  41. * Sixth vector element
  42. */
  43. @property float v5;
  44. #ifdef __cplusplus
  45. /**
  46. * The wrapped vector
  47. */
  48. @property(readonly) cv::Vec6f& nativeRef;
  49. #endif
  50. #pragma mark - Constructors
  51. /**
  52. * Create zero-initialize vecior
  53. */
  54. -(instancetype)init;
  55. /**
  56. * Create vector with specified element values
  57. * @param v0 First element
  58. * @param v1 Second element
  59. * @param v2 Third element
  60. * @param v3 Fourth element
  61. * @param v4 Fifth element
  62. * @param v5 Sixth element
  63. */
  64. -(instancetype)initWithV0:(float)v0 v1:(float)v1 v2:(float)v2 v3:(float)v3 v4:(float)v4 v5:(float)v5;
  65. /**
  66. * Create vector with specified element values
  67. * @param vals array of element values
  68. */
  69. -(instancetype)initWithVals:(NSArray<NSNumber*>*)vals;
  70. #ifdef __cplusplus
  71. +(instancetype)fromNative:(cv::Vec6f&)vec6f;
  72. #endif
  73. /**
  74. * Update vector with specified element values
  75. * @param vals array of element values
  76. */
  77. -(void)set:(NSArray<NSNumber*>*)vals NS_SWIFT_NAME(set(vals:));
  78. /**
  79. * Get vector as an array
  80. */
  81. -(NSArray<NSNumber*>*)get;
  82. #pragma mark - Common Methods
  83. /**
  84. * Compare for equality
  85. * @param other Object to compare
  86. */
  87. -(BOOL)isEqual:(nullable id)other;
  88. @end
  89. NS_ASSUME_NONNULL_END