DSQuadrilateral
The DSQuadrilateral class represents a quadrilateral defined by four points.
Definition
Assembly: DynamsoftCaptureVisionBundle.xcframework
- Objective-C
- Swift
@interface DSQuadrilateral : NSObjectclass Quadrilateral : NSObject
Attributes & Methods
| Attributes | Type | Description |
|---|---|---|
points |
NSArray | An array of four Point objects defining the vertices of the quadrilateral. |
id |
NSInteger | The ID of the quadrilateral. |
boundingRect |
CGRect | Get the bounding rectangle of the quadrilateral. |
centrePoint |
CGPoint | Get the centre point of the quadrilateral. |
area |
NSUInteger | Get the area of the quadrilateral. |
| Method | Description |
|---|---|
initWithPointArray(points:) |
The constructor. Creates a quadrilateral from an array of points. |
initWithPointArray(points:quadId:) |
The constructor. Creates a quadrilateral from an array of points and an ID. |
contains |
Check whether the input point is contained by the quadrilateral. |
points
An array of four Point objects defining the vertices of the quadrilateral.
- Objective-C
- Swift
@property (nonatomic, readonly, copy) NSArray<NSValue *> *points;var points: [NSValue] { get }
id
The ID of the quadrilateral.
- Objective-C
- Swift
@property (nonatomic, assign) NSInteger quadId;var quadId: Int { get set }
boundingRect
Get the bounding rectangle of the quadrilateral.
- Objective-C
- Swift
@property (nonatomic, readonly) CGRect boundingRect;var boundingRect: CGRect { get }
Return Value
The bounding rectangle of the quadrilateral.
centrePoint
Get the centre point of the quadrilateral.
- Objective-C
- Swift
@property (nonatomic, readonly) CGPoint centrePoint;var centrePoint: CGPoint { get }
Return Value
The centre point of the quadrilateral.
area
Get the area of the quadrilateral.
- Objective-C
- Swift
@property (nonatomic, readonly) NSUInteger area;var area: Int { get }
Return Value
The area of the quadrilateral.
initWithPointArray(points:)
The constructor. Creates a quadrilateral from an array of points.
- Objective-C
- Swift
- (instancetype)initWithPointArray:(NSArray<NSValue *> *)points;init(points: [NSValue])
initWithPointArray(points:quadId:)
The constructor. Creates a quadrilateral from an array of points and an ID.
- Objective-C
- Swift
- (instancetype)initWithPointArray:(NSArray<NSValue *> *)points quadId:(NSInteger)quadId;init(points: [NSValue], quadId: Int)
contains
Check whether the input point is contained by the quadrilateral.
- Objective-C
- Swift
- (BOOL)contains:(CGPoint)point;func contains(_ point: CGPoint) -> Bool
Parameters
point: Input a point.
Return Value
A BOOL value that indicates whether the point is contained by the quadrilateral.