Table of contents

DSRawTextLinesUnit

The DSRawTextLinesUnit class represents a unit which holds the raw text lines.

Definition

Assembly: DynamsoftLabelRecognizer.xcframework

  • Objective-C
  • Swift
  1. @interface DSLocalizedTextLinesUnit: DSIntermediateResultUnit
    
  2. class LocalizedTextLinesUnit: IntermediateResultUnit
    

Inheritance: DSIntermediateResultUnit -> DSLocalizedTextLinesUnit

Methods

Method Description
getCount Gets the number of raw text lines in the unit.
getRawTextLine Gets a raw text line at the specified index.
getRawTextLines Gets all raw text lines of the unit.
removeAllRawTextLines Removes all raw text lines.
removeRawTextLine Removes the raw text line at the specified index.
addRawTextLine Adds a raw text line.
setRawTextLine Sets the raw text line at the specified index.

getCount

Returns the number of raw text lines in the unit.

  • Objective-C
  • Swift
  1. -(NSInteger)getCount;
    
  2. func getCount() -> Int
    

Return value

Returns the number of raw text lines in the unit.

getRawTextLine

Gets a raw text line at the specified index.

  • Objective-C
  • Swift
  1. -(nullable DSRawTextLine)getRawTextLine:(NSInteger)index;
    
  2. func getRawTextLine(_ index: Int) -> DSRawTextLine?
    

Parameters

index: The index of the raw text line.

Return value

Returns a pointer to the RawTextLine object at the specified index.

getRawTextLines

Gets all raw text lines of the unit.

  • Objective-C
  • Swift
  1. -(nullable NSArray<DSRawTextLine *> *)getRawTextLines;
    
  2. func getRawTextLines() -> [DSRawTextLine]?
    

Return value

Returns all the RawTextLine objects of the unit in an array.

removeAllRawTextLines

Removes all raw text lines.

  • Objective-C
  • Swift
  1. -(void)removeAllRawTextLines;
    
  2. func removeAllRawTextLines()
    

removeRawTextLine

Removes the raw text line at the specified index.

  • Objective-C
  • Swift
  1. -(NSInteger)removeRawTextLine:(NSInteger)index;
    
  2. func removeRawTextLine(_ index: Int) -> Int
    

Parameters

index: The index of the raw text line to be removed.

Return value

Returns the ErrorCode if failed. Otherwise, returns 0.

addRawTextLine

Adds a raw text line to the unit.

  • Objective-C
  • Swift
  1. -(NSInteger)addRawTextLine:(DSRawTextLine *)textline
     matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
    
  2. func addRawTextLine(_ textline: DSRawTextLine, matrixToOriginalImage: CGAffineTransform) -> Int
    

Parameters

textline: A RawTextLine object as the raw text line to be added to the unit.

matrixToOriginalImage: The matrix to the original image.

Return value

Returns the ErrorCode if failed. Otherwise, returns 0.

setRawTextLine

Sets the raw text line at the specified index.

  • Objective-C
  • Swift
  1. -(NSInteger)setRawTextLine:(NSInteger)index
                   element:(DSRawTextLine *)textline
     matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
    
  2. func setRawTextLine(_ index: Int, textline: DSRawTextLine, matrixToOriginalImage: CGAffineTransform) -> Int
    

Parameters

index: The index of the raw text line to be set.

textline: A RawTextLine object as the raw text line to be set.

matrixToOriginalImage: The matrix to the original image.

Return value

Returns the ErrorCode if failed. Otherwise, returns 0.