Table of contents

Processing Multiple Images/Pages

Method Description
setInput Sets up an image source to provide images for continuous processing.
getInput Returns the image source object.
addResultReceiver Adds a CapturedResultReceiver object as the receiver of captured results.
removeResultReceiver Removes the specified CapturedResultReceiver object.
removeAllResultReceivers Removes all user-added CapturedResultReceivers.
startCapturing Initiates a capturing process based on a specified template. This process is repeated for each image fetched from the source.
stopCapturing Stops the capturing process.
pauseCapturing Pauses the Capture Vision Router.
resumeCapturing Resumes the Capture Vision Router.
addCaptureStateListener Registers a CaptureStateListener to be used as a callback when capture state is received.
removeCaptureStateListener Removes a CaptureStateListener that has been configured for the Capture Vision Router.
removeAllCaptureStateListeners Removes all user-added CaptureStateListeners.
addResultFilter Adds a CapturedResultFilter object to filter non-essential results.
removeResultFilter Removes the specified CapturedResultFilter object.
removeAllResultFilters Removes all user-added CapturedResultFilters.
addImageSourceStateListener Register a ImageSourceStateListener to get callback when the status of ImageSourceAdapter received.
removeImageSourceStateListener Removes a ImageSourceStateListener from the Capture Vision Router.
removeAllImageSourceStateListeners Removes all user-added ImageSourceStateListeners.
switchCapturingTemplate Switch the image processing settings with the CaptureVisionTemplate name during the image processing workflow.

setInput

Sets an image source that will provide images to be consecutively processed.

  • Objective-C
  • Swift
  1. - (BOOL)setInput:(nullable DSImageSourceAdapter *)adapter
           error:(NSError * _Nullable * _Nullable)error;
    
  2. func setInput(_ adapter: ImageSourceAdapter) throws -> BOOL
    

Parameters

adapter: An object of DSImageSourceAdapter. You can use an internally implemented ImageSourceAdapter such as CameraEnhancer, DirectoryFetcher or FileFetcher.
error: An NSError pointer. If an error occurs, it will represent the error information.

Error

Error Code Value Description
EC_CALL_REJECTED_WHEN_CAPTURING -10062 Function call is rejected when capturing in progress.

Return Value

A BOOL value that indicates whether the input is set successfully.

getInput

Gets the attached image source adapter (DSImageSourceAdapter) object of the Capture Vision Router.

  • Objective-C
  • Swift
  1. - (nullable DSImageSourceAdapter *)getInput;
    
  2. func getInput() -> ImageSourceAdapter
    

Return Value

The attached DSImageSourceAdapter object of the capture vision router.

addImageSourceStateListener

Registers a DSImageSourceStateListener object to be used as a callback when the status of DSImageSourceAdapter is received.

  • Objective-C
  • Swift
  1. - (void)addImageSourceStateListener:(id<DSImageSourceStateListener>)listener;
    
  2. func addImageSourceStateListener(_ listener:ImageSourceStateListener)
    

Parameters

listener: An object of DSImageSourceStateListener.

removeImageSourceStateListener

Removes a DSImageSourceStateListener from the Capture Vision Router.

  • Objective-C
  • Swift
  1. - (void)removeImageSourceStateListener:(id<DSImageSourceStateListener>)listener;
    
  2. func removeImageSourceStateListener(_ listener:ImageSourceStateListener)
    

Parameters

listener: An object of DSImageSourceStateListener.

removeAllImageSourceStateListeners

Removes all user-added DSImageSourceStateListeners.

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

addResultReceiver

Adds a CapturedResultReceiver object as the receiver of captured results.

  • Objective-C
  • Swift
  1. - (void)addResultReceiver:(id<DSCapturedResultReceiver>)receiver;
    
  2. func addResultReceiver(_ listener:CapturedResultReceiver)
    

Parameters

listener: An object of DSCapturedResultReceiver.

removeResultReceiver

Removes the specified CapturedResultReceiver object.

  • Objective-C
  • Swift
  1. - (void)removeResultReceiver:(id<DSCapturedResultReceiver>)receiver;
    
  2. func removeResultReceiver(_ listener:CapturedResultReceiver)
    

Parameters

listener: An object of DSCapturedResultReceiver.

Return Value

A BOOL value that indicates whether the result receiver is removed successfully.

removeAllResultReceivers

Removes all user-added CapturedResultReceivers.

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

startCapturing

Initiates a capturing process based on a specified template. This process is repeated for each image fetched from the source.

  • Objective-C
  • Swift
  1. - (void)startCapturing:(NSString*)templateName
     completionHandler:(nullable void(^)(BOOL isSuccess, NSError *_Nullable error))completionHandler;
    
  2. func startCapturing(_ templateName:String, completionHandler: ((Bool, (any Error)?) -> Void)? = nil)
    

Parameters

templateName: Specifies a “CaptureVisionTemplate” to use. The following value are available for this parameter:

  • One of the DSPresetTemplate member. This is available only if you have never upload a new template via initSettings or initSettingsFromFile.
  • A string that represents one of the template name that you have uploaded via initSettings or initSettingsFromFile.
  • ”” (empty string) to use the default template. The first template will be used if you have uploaded a template file via initSettingsFromFile or initSettings.

completionHandler: A completion handler the system calls after it finishes the startCapturing.

  • isSuccess: A BOOL value that indicates whether the startCapturing operation is successful.
  • error: An error object if the request fails; otherwise, nil.

Error

Error Code Value Description
EC_TEMPLATE_NAME_INVALID -10036 The target template name is invalid.
EC_CALL_REJECTED_WHEN_CAPTURING -10062 Function call is rejected when capturing in progress.
EC_NO_IMAGE_SOURCE -10063 Can not start capturing before you set the input.

Return Value

A BOOL value that indicates whether the capture starts successfully.

stopCapturing

Stops the capturing process.

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

pauseCapturing

Pauses the capturing process.

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

resumeCapturing

Resumes the capturing process.

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

addCaptureStateListener

Registers a DSCaptureStateListener to be used as a callback when capture state changes.

  • Objective-C
  • Swift
  1. - (void)addCaptureStateListener:(nonnull id<DSCaptureStateListener>)listener;
    
  2. func addCaptureStateListener(_ listener:CaptureStateListener)
    

Parameters

listener: A delegate object of DSCaptureStateListener to receive the capture state.

Return Value

A BOOL value that indicates whether the capture state listener is added successfully.

removeCaptureStateListener

Removes a DSCaptureStateListener that has been configured for the Capture Vision Router via the addCaptureStateListener method.

  • Objective-C
  • Swift
  1. - (void)removeCaptureStateListener:(nonnull id<DSCaptureStateListener>)listener;
    
  2. func removeCaptureStateListener(_ listener:CaptureStateListener)
    

Parameters

listener: An object of DSCaptureStateListener.

Return Value

A BOOL value that indicates whether the capture state listener is removed successfully.

removeAllCaptureStateListeners

Removes all user-added DSCaptureStateListeners.

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

addResultFilter

Adds a DSCapturedResultFilter object to filter non-essential results. Currnetly, is must be a MultiFrameCrossFilter object.

  • Objective-C
  • Swift
  1. - (void)addResultFilter:(nonnull id<DSCapturedResultFilter>)filter;
    
  2. func addResultFilter(_ filter:CapturedResultFilter)
    

Parameters

filter: An object of DSCapturedResultFilter.

Return Value

A BOOL value that indicates whether the result filter is added successfully.

removeResultFilter

Removes the specified DSCapturedResultFilter object.

  • Objective-C
  • Swift
  1. - (void)removeResultFilter:(nonnull id<DSCapturedResultFilter>)filter;
    
  2. func removeResultFilter(_ filter:CapturedResultFilter)
    

Parameters

filter: An object of DSCapturedResultFilter.

Return Value

A BOOL value that indicates whether the result filter is removed successfully.

removeAllResultFilters

Removes all user-added DSCapturedResultFilters.

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

switchCapturingTemplate

Switch the image processing settings with the CaptureVisionTemplate name during the image processing workflow.

  • Objective-C
  • Swift
  1. -(BOOL)switchCapturingTemplate:(NSString *)templateName
                         error:(NSError * _Nullable * _Nullable)error;
    
  2. func switchCapturingTemplate(_ templateName:String) throws -> Bool
    

Parameters

templateName: The name of the new capturing template to apply.
error: An NSError pointer. If an error occurs, it will represent the error information.

Return Value

A BOOL value that indicates whether the capture starts successfully.

Remarks

  • Introduced in Dynamsoft Barcode Reader SDK version 11.2.1000 and Dynamsoft Capture Vision version 3.2.1000.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: