DSRecognizedTextLinesUnit
The DSRecognizedTextLinesUnit
class represents an intermediate result unit containing recognized text lines. It inherits from the DSIntermediateResultUnit class.
Definition
Assembly: DynamsoftLabelRecognizer.xcframework
- Objective-C
- Swift
@interface DSRecognizedTextLinesUnit: DSIntermediateResultUnit
class RecognizedTextLinesUnit: IntermediateResultUnit
Inheritance: DSIntermediateResultUnit -> DSRecognizedTextLinesUnit
Methods
Method | Description |
---|---|
addRecognizedTextLine |
Adds a recognized text line. |
getRecognizedTextLines |
Get all the recognized text lines in an array of DSRecognizedTextLineElement . |
getCount |
Returns the number of text lines in this unit. |
getRecognizedTextLine |
Returns the text line at the specified index in a DSRecognizedTextLineElement object. |
removeAllRecognizedTextLines |
Removes all the recognized text lines from this unit. |
removeRecognizedTextLine |
Removes the recognized text line at the specified index. |
setRecognizedTextLine(index, element, matrixToOriginalImage) |
Sets the recognized text line at the specified index. |
setRecognizedTextLine(element, matrixToOriginalImage) |
Sets the recognized text line at the specified index. |
AddRecognizedTextLine
Adds a recognized text line.
- Objective-C
- Swift
-(NSInteger)addRecognizedTextLine:(DSRecognizedTextLineElement*)element matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
func addRecognizedTextLine(_ element: RecognizedTextLineElement, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
element
: The DSRecognizedTextLineElement
object to be added.
matrixToOriginalImage
: The matrix to transform the original image.
Return value
Returns the ErrorCode
if failed. Otherwise, returns 0.
recognizedTextLines
All the recognized text lines of this unit in an array of DSRecognizedTextLineElement
.
- Objective-C
- Swift
@property (nonatomic, nullable, copy) NSArray<DSRecognizedTextLineElement*>* recognizedTextLines;
var recognizedTextLines: [RecognizedTextLineElement]? { get }
getRecognizedTextLines
Gets all the recognized text lines in an array of DSRecognizedTextLineElement
.
- Objective-C
- Swift
- (NSArray<DSRecognizedTextLineElement*>*)getRecognizedTextLines;
func getRecognizedTextLines() -> [RecognizedTextLineElement]?
Return value
All the recognized text lines in an array of DSRecognizedTextLineElement
.
getCount
Returns the number of text lines in this unit.
- Objective-C
- Swift
- (NSInteger)getCount;
func getCount() -> Int
Return value
The number of text lines in this unit.
getRecognizedTextLine
Returns the text line at the specified index in a DSRecognizedTextLineElement
object.
- Objective-C
- Swift
- (nullable DSRecognizedTextLineElement*)getRecognizedTextLine:(NSInteger)index;
func getRecognizedTextLine(_ index: Int) -> RecognizedTextLineElement?
Parameters
index
: The index of the text line in this unit.
Return value
The text line at the specified index in a DSRecognizedTextLineElement
object.
removeAllRecognizedTextLines
Removes all the recognized text lines from this unit.
- Objective-C
- Swift
- (void)removeAllRecognizedTextLines;
func removeAllRecognizedTextLines()
removeRecognizedTextLine
Removes the RecognizedTextLineElement
at the specified index.
- Objective-C
- Swift
-(NSInteger)removeRecognizedTextLine:(NSInteger)index;
func removeRecognizedTextLine(_ index: Int) -> Int
Parameters
index
: The index of the recognized text line to remove.
Return value
Returns the ErrorCode
if failed. Otherwise, returns 0.
setRecognizedTextLine(index, element, matrixToOriginalImage)
Sets the text line at the specified index in a DSRecognizedTextLineElement
object.
- Objective-C
- Swift
-(NSInteger)setRecognizedTextLine:(NSInteger)index element:(DSRecognizedTextLineElement*)element matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
func setRecognizedTextLine(_ index: Int, element: RecognizedTextLineElement, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
index
: The index of the recognized text line to set.
element
: The DSRecognizedTextLineElement
object to be set.
matrixToOriginalImage
: The matrix to transform the original image.
Return value
Returns the ErrorCode
if failed. Otherwise, returns 0.
setRecognizedTextLine(element, matrixToOriginalImage)
This method is deprecated.
Sets the text line at the specified index in a DSRecognizedTextLineElement
object.
- Objective-C
- Swift
- (NSInteger)setRecognizedTextLine:(DSRecognizedTextLineElement*)element matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
func setRecognizedTextLine(_ element: RecognizedTextLineElement, matrixToOriginalImage: CGAffineTransform) -> Int
Parameters
element
: The DSRecognizedTextLineElement
object to be set.
matrixToOriginalImage
: The matrix to transform the original image.
Return value
Returns the ErrorCode
if failed. Otherwise, returns 0.