Documentation
Table of contents

DSLocalizedTextLinesUnit

The DSLocalizedTextLinesUnit class represents a unit that contains localized text lines. It inherits from the DSIntermediateResultUnit class.

Definition

Assembly: DynamsoftLabelRecognizer.xcframework

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

Inheritance: DSIntermediateResultUnit -> DSLocalizedTextLinesUnit

Methods

Method Description
getLocalizedTextLines Get all the text lines in an array of DSLocalizedTextLineElement, which is the basic unit of the localized text line result.
getCount Get the number of text lines in this unit.
getLocalizedTextLine Get the localized text line at the specified index in a LocalizedTextLineElement object.
removeAllLocalizedTextLines Remove all the text lines from this unit.
removeLocalizedTextLine Remove the localized text line at the specified index from this unit.
addLocalizedTextLine Add a localized text line to this unit.
setLocalizedTextLine Set the localized text line at the specified index in a LocalizedTextLineElement object.

getLocalizedTextLines

Get all the text lines in an array of DSLocalizedTextLineElement, which is the basic unit of the localized text line result.

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

Return value

All the text lines in an array of DSLocalizedTextLineElement, which is the basic unit of the localized text line result.

getCount

Get the number of text lines in this unit.

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

Return value

The number of text lines in this unit.

getLocalizedTextLine

Get the localized text line at the specified index in a LocalizedTextLineElement object.

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

Parameters

index: The index of the localized text line to be retrieved.

Return value

The localized text line at the specified index in a LocalizedTextLineElement object.

removeAllLocalizedTextLines

Remove all the localized text lines from the unit.

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

removeLocalizedTextLine

Remove a localized text line from the unit.

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

Parameters

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

Return value

Returns the ErrorCode if failed. Otherwise, returns 0.

addLocalizedTextLine

Add a localized text line to the unit.

  • Objective-C
  • Swift
  1. -(NSInteger)addLocalizedTextLine:(DSLocalizedTextLineElement*)element
           matrixToOriginalImage:(CGAffineTransform)matrixToOriginalImage;
    
  2. func addLocalizedTextLine(_ element: DSLocalizedTextLineElement, matrixToOriginalImage: CGAffineTransform) -> Int
    

Parameters

element: A LocalizedTextLineElement object as the localized 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.

setLocalizedTextLine

Set a localized text line in the unit.

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

Parameters

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

element: A LocalizedTextLineElement object as the localized text line to be set.

matrixToOriginalImage: The matrix to the original image.

Return value

Returns the ErrorCode if failed. Otherwise, returns 0.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: