Table of contents

DSQuadrilateral

The DSQuadrilateral class represents a quadrilateral defined by four points.

Definition

Assembly: DynamsoftCaptureVisionBundle.xcframework

  • Objective-C
  • Swift
  1. @interface DSQuadrilateral : NSObject
    
  2. class 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
  1. @property (nonatomic, readonly, copy) NSArray<NSValue *> *points;
    
  2. var points: [NSValue] { get }
    

id

The ID of the quadrilateral.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) NSInteger quadId;
    
  2. var quadId: Int { get set }
    

boundingRect

Get the bounding rectangle of the quadrilateral.

  • Objective-C
  • Swift
  1. @property (nonatomic, readonly) CGRect boundingRect;
    
  2. var boundingRect: CGRect { get }
    

Return Value

The bounding rectangle of the quadrilateral.

centrePoint

Get the centre point of the quadrilateral.

  • Objective-C
  • Swift
  1. @property (nonatomic, readonly) CGPoint centrePoint;
    
  2. var centrePoint: CGPoint { get }
    

Return Value

The centre point of the quadrilateral.

area

Get the area of the quadrilateral.

  • Objective-C
  • Swift
  1. @property (nonatomic, readonly) NSUInteger area;
    
  2. 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
  1. - (instancetype)initWithPointArray:(NSArray<NSValue *> *)points;
    
  2. init(points: [NSValue])
    

initWithPointArray(points:quadId:)

The constructor. Creates a quadrilateral from an array of points and an ID.

  • Objective-C
  • Swift
  1. - (instancetype)initWithPointArray:(NSArray<NSValue *> *)points quadId:(NSInteger)quadId;
    
  2. init(points: [NSValue], quadId: Int)
    

contains

Check whether the input point is contained by the quadrilateral.

  • Objective-C
  • Swift
  1. - (BOOL)contains:(CGPoint)point;
    
  2. 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.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: