4 // Created by Giles Payne on 2019/10/06.
17 #import <Foundation/Foundation.h>
19 NS_ASSUME_NONNULL_BEGIN
22 * Represents the dimensions of a rectangle the values of which are of type `int`
25 CV_EXPORTS @interface Size2i : NSObject
27 #pragma mark - Properties
32 @property(readonly) cv::Size2i& nativeRef;
35 #pragma mark - Constructors
38 - (instancetype)initWithWidth:(int)width height:(int)height;
39 - (instancetype)initWithPoint:(Point2i*)point;
40 - (instancetype)initWithVals:(NSArray<NSNumber*>*)vals;
43 + (instancetype)fromNative:(cv::Size2i&)size;
45 + (instancetype)width:(int)width height:(int)height;
47 #pragma mark - Methods
50 * Returns the area of a rectangle with corresponding dimensions
55 * Determines if a rectangle with corresponding dimensions has area of zero
60 * Set the dimensions from the values of an array
61 * @param vals The array of values from which to set the dimensions
63 - (void)set:(NSArray<NSNumber*>*)vals NS_SWIFT_NAME(set(vals:));
65 #pragma mark - Common Methods
73 * Compare for equality
74 * @param other Object to compare
76 - (BOOL)isEqual:(nullable id)object;
79 * Calculate hash value for this object
84 * Returns a string that describes the contents of the object
86 - (NSString*)description;