Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
DSLineSegmentsUnit
The DSLineSegmentsUnit
class extends the DSIntermediateResultUnit
class and represents a unit of intermediate result specifically for line segments.
Definition
Assembly: DynamsoftCore.framework
- Objective-C
- Swift
@interface DSLineSegmentsUnit: DSIntermediateResultUnit
class LineSegmentsUnit : IntermediateResultUnit
Methods
Method | Description |
---|---|
getLineSegments |
Gets an array of DSLineSegment objects, each representing a segment of a line detected within the image. |
getCount |
Returns the number of line segments. |
getLineSegment |
Returns the line segment at the specified index. |
removeAllLineSegments |
Removes all line segments. |
removeLineSegment |
Removes the line segment at the specified index. |
addLineSegment |
Adds a line segment. |
setLineSegment |
Sets a line segment. |
Inherited Methods
The following methods are inherited from class DSIntermediateResultUnit
.
Method | Description |
---|---|
getHashId |
Gets the hash ID of the unit. The hash ID is the unique identifier for the intermediate result unit. |
getOriginalImageHashId |
Gets the hash ID of the original image associated with this unit. |
getOriginalImageTag |
Gets the tag associated with the original image. |
getType |
Gets the type of the intermediate result unit, defined by the enumeration IntermediateResultUnitType . |
getTransformMatrix |
Gets the transformation matrix via DSTransformMatrixType . |
clone |
Creates a copy of the intermediate result unit. |
replace |
Replaces the content of the intermediate result unit. |
getLineSegments
Get an array of DSLineSegment
objects, each representing a segment of a line detected within the image.
- Objective-C
- Swift
-(nullable NSArray<DSLineSegment*>*)getLineSegments;
func getLineSegments() -> [LineSegment]?
Return Value
An array of DSLineSegment
objects.
getCount
Returns the number of line segments.
- Objective-C
- Swift
-(NSInteger)getCount;
func getCount() -> Int
Return Value
Returns the number of line segments.
getLineSegment
Returns the line segment at the specified index.
- Objective-C
- Swift
-(nullable DSLineSegment *)getLineSegment:(NSInteger)index;
func getLineSegment(_ index: Int) -> LineSegment?
Parameters
index
: The index of the line segment.
Return Value
Returns the line segment at the specified index.
removeAllLineSegments
Removes all line segments.
- Objective-C
- Swift
-(void)removeAllLineSegments;
func removeAllLineSegments()
removeLineSegment
Removes the line segment at the specified index.
- Objective-C
- Swift
-(NSInteger)removeLineSegment:(NSInteger)index;
func removeLineSegment(_ index: Int) -> Int
Parameters
index
: The index of the line segment.
Return Value
Returns the ErrorCode
if failed. Otherwise, returns 0.
addLineSegment
Adds a line segment.
- Objective-C
- Swift
-(NSInteger)addLineSegment:(DSLineSegment *)line matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
func addLineSegment(_ line: LineSegment, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
line
: A DSLineSegment
object as the line segment.
matrixToOriginalImage
: A CGAffineTransform
object as the matrix to original image.
Return Value
Returns the ErrorCode
if failed. Otherwise, returns 0.
setLineSegment
Sets a line segment.
- Objective-C
- Swift
-(NSInteger)setLineSegment:(NSInteger)index line:(DSLineSegment *)line matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
func setLineSegment(_ index: Int, line: LineSegment, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
index
: The index of the line segment.
line
: A DSLineSegment
object as the line segment.
matrixToOriginalImage
: A CGAffineTransform
object as the matrix to original image.
Return Value
Returns the ErrorCode
if failed. Otherwise, returns 0.