DSCornersUnit
The DSCornersUnit class represents an intermediate result unit whose type is corners.
Definition
Assembly: DynamsoftCaptureVisionBundle.xcframework
- Objective-C
- Swift
@interface DSCornersUnit : DSIntermediateResultUnitclass CornersUnit : IntermediateResultUnit
Methods
| Methods | Description |
|---|---|
getCorners |
Get an array of corners. It includes all corners that participate quadrilaterals assembling. |
getCount |
Get the number of corners. |
getCorner |
Get a corner. |
removeAllCorners |
Remove all corners. |
removeCorner |
Remove a corner. |
addCorner |
Add a corner. |
setCorner |
Set a corner. |
The following methods are inherited from class DSIntermediateResultUnit.
| Method | Description |
|---|---|
getHashId |
Returns the hash ID of the unit. |
getOriginalImageHashId |
Returns the hash ID of the original image. |
getOriginalImageTag |
Returns the image tag of the original image. |
getType |
Returns the type of the intermediate result unit. |
getTransformMatrix |
Returns the transformation matrix via DSTransformMatrixType. |
clone |
Creates a copy of the intermediate result unit. |
replace |
Replaces the content of the intermediate result unit. |
getCorners
Get an array of DSCorner that represent all the assembled corners. The corners will participate assembling.
- Objective-C
- Swift
-(nullable NSArray<DSCorner*>*)getCorners;func getCorners() -> [Corner]?
Return Value
An array of DSCorner as the assembled corners.
getCount
Get the number of corners.
- Objective-C
- Swift
-(NSInteger)getCount;func getCount() -> Int
Return Value
The number of corners.
getCorner
Get the corner at the specified index.
- Objective-C
- Swift
-(nullable DSCorner*)getCorner:(NSInteger)index;func getCorner(_ index: Int) -> Corner?
Parameters
[in] index: The index of the corner.
Return Value
The corner at the specified index.
removeAllCorners
Remove all corners.
- Objective-C
- Swift
-(void)removeAllCorners;func removeAllCorners()
removeCorner
Remove the corner at the specified index.
- Objective-C
- Swift
-(NSInteger)removeCorner:(NSInteger)index;func removeCorner(_ index: Int) -> Int
Parameters
[in] index: The index of the corner to be removed.
Return Value
The index of the removed corner.
addCorner
Add a corner.
- Objective-C
- Swift
-(NSInteger)addCorner:(DSCorner*)corner matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;func addCorner(_ corner: Corner, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
[in] corner: The corner to be added.
[in] matrixToOriginalImage: The matrix to the original image.
Return Value
Returns the ErrorCode if failed. Otherwise, returns 0.
setCorner
Set the corner at the specified index.
- Objective-C
- Swift
-(NSInteger)setCorner:(NSInteger)index corner:(DSCorner*)corner matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;func setCorner(_ index: Int, corner: Corner, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
[in] index: The index of the corner to be set.
[in] corner: The corner to be set.
[in] matrixToOriginalImage: The matrix to the original image.
Return Value
Returns the ErrorCode if failed. Otherwise, returns 0.