DSDecodedBarcodeElement Class
DSDecodedBarcodeElement extends the DSRegionObjectElement class and represents a decoded barcode element.
Definition
Assembly: DynamsoftCaptureVisionBundle.xcframework
- Objective-C
- Swift
@interface DSDecodedBarcodeElement: DSRegionObjectElementclass DecodedBarcodeElement: RegionObjectElement
Methods
| Methods | Description |
|---|---|
init |
Initialize a new DSDecodedBarcodeElement object. |
getText |
Returns the text of the decoded barcode. |
setText |
Set the text of the decoded barcode. |
getBytes |
Returns the raw bytes of the decoded barcode. |
setBytes |
Set the raw bytes of the decoded barcode. |
getFormat |
Returns the format of the decoded barcode. |
setFormat |
Set the format of the decoded barcode. |
getConfidence |
Returns the confidence score of the decoded barcode. |
setConfidence |
Set the confidence of the decoded barcode. |
getFormatString |
Returns the format string of the decoded barcode. |
getAngle |
Returns the orientation angle of the decoded barcode. |
getModuleSize |
Returns the module size of the decoded barcode. |
getDetails |
Returns the DSBarcodeDetails of the decoded barcode. |
getExtendedBarcodeResults |
Returns the extended barcode results of the decoded barcode. |
isDPM |
Specifies if the decoded barcode is a DPM code or not. |
isMirrored |
Specifies if the decoded barcode is mirrored or not. |
setLocation |
Sets the location of the decoded barcode. |
The following attributes are inherited from class DSRegionObjectElement.
| Method | Description |
|——- |————-|
| getLocation | Gets the location of the region object, represented as a quadrilateral. |
| getReferencedElement | Gets the referenced element that supports the capturing of this element. |
| getRegionObjectElementType | Gets the type of the region object element, defined by the enumeration DSRegionObjectElementType. |
| getImageData | Gets the image data of this region object element. |
init
Create a new DSDecodedBarcodeElement object.
- Objective-C
- Swift
- (instancetype)init;init()
getText
Returns the text of the decoded barcode.
- Objective-C
- Swift
- (NSString *)getTextfunc getText() -> String
Return Value
A string representing the text of the decoded barcode.
setText
Set the text of the decoded barcode. The barcode bytes are changed as well to reflect the new text.
- Objective-C
- Swift
- (void)setText:(NSString *)textfunc setText(text: String)
Parameters
[in] text: The text to be set for the decoded barcode.
Return Value
Returns the ErrorCode if it fails. Otherwise, returns 0.
getBytes
Returns the raw bytes of the decoded barcode.
- Objective-C
- Swift
- (NSData *)getBytesfunc getBytes() -> NSData
Return Value
A NSData object representing the raw bytes of the decoded barcode.
setBytes
Set the raw bytes of the decoded barcode. The text of the barcode will change to reflect the new barcode bytes.
- Objective-C
- Swift
- (void)setBytes:(NSData *)bytesfunc setBytes(bytes: NSData)
Parameters
[in] bytes: The bytes of the decoded barcode.
Return Value
Returns the ErrorCode if it fails. Otherwise, returns 0.
getFormat
Returns the format of the decoded barcode as a DSBarcodeFormat item.
- Objective-C
- Swift
- (DSBarcodeFormat)getFormatfunc getFormat() -> BarcodeFormat
Return Value
A DSBarcodeFormat item representing the format of the decoded barcode.
setFormat
Set the format of the decoded barcode using a DSBarcodeFormat item.
- Objective-C
- Swift
- (void)setFormat:(DSBarcodeFormat)formatfunc setFormat(_ format: BarcodeFormat)
Parameters
[in] format: The format of the decoded barcode.
Return Value
Returns the ErrorCode if it fails. Otherwise, returns 0.
getConfidence
Returns the confidence score of the decoded barcode.
- Objective-C
- Swift
- (NSInteger)getConfidencefunc getConfidence() -> NSInteger
Return Value
An integer representing the confidence score.
setConfidence
Set the confidence score of the decoded barcode.
- Objective-C
- Swift
- (void)setConfidence:(NSInteger)confidencefunc setConfidence(_ confidence: NSInteger)
Parameters
[in] confidence: The confidence of the decoded barcode.
Return Value
Returns the ErrorCode if it fails. Otherwise, returns 0.
getFormatString
Returns the format of the decode barcode as a string.
- Objective-C
- Swift
- (NSString *)getFormatStringfunc getFormatString() -> String
Return Value
A string representing the format of the barcode.
getAngle
Returns the orientation angle of the decoded barcode should it be rotated in any way.
- Objective-C
- Swift
- (NSInteger)getAnglefunc getAngle() -> NSInteger
Return Value
An integer representing the orientation angle of the barcode.
getModuleSize
Returns the module size of the decoded barcode.
- Objective-C
- Swift
- (NSInteger)getModuleSizefunc getModuleSize() -> NSInteger
Return Value
An integer representing the module size of the decoded barcode.
getDetails
Returns the BarcodeDetails of the decoded barcode.
- Objective-C
- Swift
- (DSBarcodeDetails *)getDetailsfunc getDetails() -> BarcodeDetails
Return Value
A DSBarcodeDetails object representing the details of the decoded barcode.
getExtendedBarcodeResults
Returns the extended barcode result(s) of the decoded barcode as a DSExtendedBarcodeResult object. Please visit the DSExtendedBarcodeResult page to learn more of what information is contained there.
- Objective-C
- Swift
- (nullable NSArray<DSExtendedBarcodeResult *>*)getExtendedBarcodeResultsfunc getExtendedBarcodeResults() -> [ExtendedBarcodeResult]?
Return Value
An array of DSExtendedBarcodeResult that represents the extended barcode results.
isDPM
Specifies if the decoded barcode is a Direct Part Marking (DPM) code or not. DPM codes are read by setting the DPMCodeReadingModes.
- Objective-C
- Swift
- (BOOL)isDPMfunc isDPM() -> Bool
Return Value
A BOOL value describing whether the barcode is a DPM code or not.
isMirrored
Specifies if the decoded barcode is mirrored or not. Mirrored barcodes are read by setting the MirrorMode.
- Objective-C
- Swift
- (BOOL)isMirroredfunc isMirrored() -> Bool
Return Value
A BOOL value describing whether the barcode is mirrored or not.
setLocation
Sets the location of the decoded barcode.
- Objective-C
- Swift
- (NSInteger)setLocation:(DSQuadrilateral *)location;func setLocation(_ location: DSQuadrilateral)
Parameters
[in] location: The location of the decoded barcode as a DSQuadrilateral object.
Return Value
Returns 0 if the location is set successfully, otherwise returns the error code.