Resource Base
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

DSImageSourceAdapter

The DSImageSourceAdapter class provides an interface for fetching and buffering images. It is an abstract class that needs to be implemented by a concrete class to provide actual functionality.

Definition

Assembly: DynamsoftCore.framework

  • Objective-C
  • Swift
  1. @interface DSImageSourceAdapter : NSObject
    
  2. class ImageSourceAdapter : NSObject
    

Methods & Attributes

Attributes Type Description
hasNextImageToFetch BOOL Determines whether there are more images left to fetch.
maxImageCount NSUInteger The property defines the maximum capability of the Video Buffer.
bufferOverflowProtectionMode DSBufferOverflowProtectionMode Sets a mode that determines the action to take when there is a new incoming image and the buffer is full. You can either block the Video Buffer or push out the oldest image and append a new one.
imageCount NSUInteger The property defines current image count in the Video Buffer.
bufferEmpty BOOL The read only property indicates whether the Video Buffer is empty.
colourChannelUsageType colourChannelUsageType The usage type of a color channel in an image.
Method Description
startFetching Start fetching images from the source to the Video Buffer of ImageSourceAdapter.
stopFetching Stop fetching images from the source to the Video Buffer of ImageSourceAdapter.
getImage Get an image from the Video Buffer.
setNextImageToReturn Specify the next image that is returned by method getImage.
hasImage Check the availability of the specified image.
addImageToBuffer Adds an image to the buffer of the adapter.
clearBuffer Clears the image buffer.

hasNextImageToFetch

Determines whether there are more images left to fetch.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) BOOL hasNextImageToFetch;
    
  2. var hasNextImageToFetch: Bool { get set }
    

maxImageCount

The property defines the maximum capability of the Video Buffer.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) NSUInteger maxImageCount;
    
  2. var maxImageCount: Int { get set }
    

bufferOverflowProtectionMode

Sets a mode that determines the action to take when there is a new incoming image and the buffer is full. You can either block the Video Buffer or push out the oldest image and append a new one.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) DSBufferOverflowProtectionMode bufferOverflowProtectionMode;
    
  2. var bufferOverflowProtectionMode: DSBufferOverflowProtectionMode { get set }
    

imageCount

The property defines current image count in the Video Buffer.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) NSUInteger imageCount;
    
  2. var imageCount: Int { get set }
    

bufferEmpty

The read only property indicates whether the Video Buffer is empty.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign, readonly, getter=isBufferEmpty) BOOL bufferEmpty;
    
  2. var bufferEmpty: Bool { get }
    

colourChannelUsageType

The usage type of a color channel in an image.

  • Objective-C
  • Swift
  1. @property (nonatomic, assign) colourChannelUsageType;
    
  2. var colourChannelUsageType: colourChannelUsageType { get set }
    

startFetching

Start fetching images from the source to the Video Buffer of ImageSourceAdapter.

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

stopFetching

Stop fetching images from the source to the Video Buffer of ImageSourceAdapter.

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

getImage

Get an image from the Video Buffer.

  • Objective-C
  • Swift
  1. - (DSImageData *_Nullable)getImage;
    
  2. func getImage() -> DSImageData?
    

Return Value

An object of DSImageData.

  • If an image is set as the “next image” by method setNextImageToReturn, return that image.
  • If no image is set as the “next image”, return the latest image.

setNextImageToReturn

Specify the next image that is returned by method getImage.

  • Objective-C
  • Swift
  1. - (BOOL)setNextImageToReturn:(NSInteger)imageId;
    
  2. func setNextImageToReturn(imageId: Int) -> Bool
    

Parameters

[in] imageId: The imageId of image you want to set as the “next image”.
[in] keepInBuffer: Set this value to true so that the “next image” is protected from being pushed out before is it returned by method getImage.

Return Value

A BOOL value that indicates whether the specified image is successfully set as the “next image”.

hasImage

Check the availability of the specified image.

  • Objective-C
  • Swift
  1. - (BOOL)hasImage:(NSInteger)imageId;
    
  2. func hasImage(imageId: Int) -> Bool
    

Parameters

[in] imageId: The imageId of image you want to check the availability.

Return Value

A BOOL value that indicates whether the specified image is found in the video buffer.

addImageToBuffer

Adds an image to the buffer of the adapter.

  • Objective-C
  • Swift
  1. - (void)addImageToBuffer:(DSImageData*)image;
    
  2. func addImageToBuffer(image: DSImageData)
    

Parameters

[in] image: The DSImageData object to add.

clearBuffer

Clears the image buffer.

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

setErrorListener

Registers a ImageSourceErrorListener to be used as a callback when an error occurs in the ImageSourceAdapter.

  • Objective-C
  • Swift
  1. -(void)setErrorListener:(DSImageSourceErrorListener)listener;
    
  2. func setErrorListener(_ listener:ImageSourceErrorListener)
    

Parameters

[in] listener: A delegate object of DSImageSourceErrorListener to receive the errors that occurs in the ImageSourceAdapter.

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

version 3.0.10

  • Latest version
  • Version 2.x
    • Version 2.2.10
    • Version 2.0.21
    • Version 2.0.20
    • Version 2.0.10
    • Version 2.2.10
    • Version 2.0.21
    • Version 2.0.20
    • Version 2.0.10
  • Version 1.x
    • Version 1.2.1
    • Version 1.2.0
    • Version 1.1.0
    • Version 1.0.0
    • Version 1.0.4
    • Version 1.0.3
    • Version 1.0.2
    • Version 1.0.1
    • Version 1.0.0
    • Version 1.1.11
    • Version 1.1.9
    • Version 1.1.8
    • Version 1.1.7
    • Version 1.1.6
    • Version 1.1.5
    • Version 1.1.4
    • Version 1.1.3
    • Version 1.1.2
    • Version 1.1.1
    • Version 1.1.0
    • Version 1.0.0
    • Version 1.0.4
    • Version 1.0.3
    • Version 1.0.2
    • Version 1.0.1
    • Version 1.0.0
Change +
© 2003–2024 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support