Dev Center
Swift
Objective-C
Table of contents

IntermediateResult Decoding Methods

Method Description
createIntermediateResult Inits an intermediateResult struct with default values.
getIntermediateResult Get intermediate results.
decodeIntermediateResults Decodes barcode from intermediate results.

createIntermediateResult

Inits an intermediateResult struct with default values.

  • Objective-C
  • Swift
  1. - (iIntermediateResult* _Nullable)createIntermediateResult:(EnumIntermediateResultType)type
                                                     error:(NSError* _Nullable * _Nullable)error;
    
  2. func createIntermediateResult(_ type: EnumIntermediateResultType) throws -> iIntermediateResult
    

Parameters

[in] type: The intermediate result type (EnumIntermediateResultType) to initialize.
[in,out] error: A pointer to an error object.

An error occurs when:

  • Your license key doesn’t include the intermediate result item.

Return Value

An iIntermediateResult struct with default values.

Code Snippet

  • Objective-C
  • Swift
  1. NSError __autoreleasing * _Nullable error;
    iIntermediateResult *irResult;
    irResult = [barcodeReader createIntermediateResult:EnumIntermediateResultTypeOriginalImage error:&error];
    
  2. do{
       let irResult = try barcodeReader.createIntermediateResult(EnumIntermediateResultType(rawValue: EnumIntermediateResultType.originalImage.rawValue)!)
    }catch{
       // Add your code to deal with exceptions
    }
    

getIntermediateResult

Return intermediate results containing the original image, the color clustered image, the binarized image, contours, lines, text blocks, etc.

  • Objective-C
  • Swift
  1. -(NSArray<iIntermediateResult*>* _Nullable)getIntermediateResult:(NSError* _Nullable *  _Nullable)error;
    
  2. func getIntermediateResult() throws -> [iIntermediateResult]
    

Parameters

[in,out] error Input a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

Return Value

Returns an iIntermediateResult array.

Code Snippet

  • Objective-C
  • Swift
  1. iPublicRuntimeSettings *settings;
    NSArray<iTextResult *> *result;
    NSArray<iIntermediateResult *> *irResult;
    [_barcodeReader getRuntimeSettings:nil];
    settings.intermediateResultTypes = EnumIntermediateResultTypeColourConvertedGrayScaleImage|EnumIntermediateResultTypeOriginalImage|EnumIntermediateResultTypeColourClusteredImage;
    [_barcodeReader updateRuntimeSettings:settings error:nil];
    result = [_barcodeReader decodeFileWithName:@"your file path" error:nil];
    irResult = [_barcodeReader getIntermediateResult:&error];
    
  2. do{
       let settings = try barcodeReader.getRuntimeSettings()
       settings.intermediateResultTypes = EnumIntermediateResultType.ColourConvertedGrayScaleImage.rawValue | EnumIntermediateResultType.OriginalImage.rawValue | EnumIntermediateResultType.ColourClusteredImage.rawValue
       barcodeReader.updateRuntimeSettings(settings)
       let result = try barcodeReader.decodeFileWithName("your file path", templateName:"")
       let irResult = try barcodeReader.getIntermediateResult()
    }catch{
       // Add your code to deal with exceptions
    }
    

decodeIntermediateResults

Decodes barcode from intermediate results.

  • Objective-C
  • Swift
  1. - (NSArray<iTextResult*>* _Nullable)decodeIntermediateResults:(NSArray<iIntermediateResult*>* _Nullable)array
                                                        error:(NSError* _Nullable * _Nullable)error;
    
  2. func decodeIntermediateResults(_ array: [iIntermediateResult]?) throws -> [iTextResult]
    

Parameters

[in] array: The intermediate result array for decoding.
[in,out] error: A pointer to an error object.

An error occurs when:

  • The library failed to read the image.

Return Value

The iTextResult of each successfully decoded barcode.

Code Snippet

  • Objective-C
  • Swift
  1. NSError __autoreleasing * _Nullable error;
    [barcodeReader getRuntimeSettings:&error];
    settings.intermediateResultTypes = EnumIntermediateResultTypeOriginalImage | EnumIntermediateResultTypeTypedBarcodeZone;
    settings.intermediateResultSavingMode = EnumIntermediateResultSavingModeMemory;
    [barcodeReader updateRuntimeSettings:settings error:&error];
    NSArray<iTextResult*>* resultByFile = [barcodeReader decodeFileWithName:@"your file path" error:&error];
    NSArray<iIntermediateResult*>* array = [barcodeReader getIntermediateResult:&error];
    NSArray<iTextResult*>* result = [barcodeReader decodeIntermediateResults:array error:&error];
    
  2. do{
       let settings = try barcodeReader.getRuntimeSettings()
       settings.intermediateResultTypes = EnumIntermediateResultType.originalImage.rawValue | EnumIntermediateResultType.typedBarcodeZone.rawValue
       settings.intermediateResultSavingMode = .memory
       try barcodeReader.updateRuntimeSettings(settings)
       let resultFromFile = try barcodeReader.decodeFilewithName("your file path")
       let intermediateResult = try barcodeReader.getIntermediateResult()
       let resultFromIrtResult = try barcodeReader.decodeIntermediateResults(intermediateResult)
    }catch{
       // Add your code to deal with exceptions
    }
    

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 10.x
    • Version 10.2.10
    • Version 10.0.21
    • Version 10.0.20
    • Version 10.2.10
    • Version 10.0.21
    • Version 10.0.20
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.20
    • Version 9.6.11
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.11
    • Version 9.2.10
    • Version 9.0.2
    • Version 9.0.1
    • Version 9.0.0
    • Version 9.6.40
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.13
    • Version 9.2.10
    • Version 9.0.2
    • Version 9.0.1
    • Version 9.0.0
  • Version 8.x
    • Version 8.9.3
    • Version 8.9.1
    • Version 8.9.0
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.1
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
    • Version 8.9.3
    • Version 8.9.1
    • Version 8.9.0
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.1
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
    • Version 7.6.0
    • Version 7.5.0
Change +