Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
ImageSourceAdapter
The ImageSourceAdapter
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
Namespace: com.dynamsoft.core.basic_structures
Assembly: DynamsoftCore.aar
class ImageSourceAdapter
Methods
Method | Description |
---|---|
hasNextImageToFetch |
Determines whether there are more images left to fetch. |
setMaxImageCount |
Set the maximum capability of the Video Buffer. |
getMaxImageCount |
Get the property defines the maximum capability of the Video Buffer. |
setBufferOverflowProtectionMode |
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. |
getBufferOverflowProtectionMode |
Get the buffer overflow protection mode. |
getImageCount |
Get the current image count in the Video Buffer. |
isBufferEmpty |
Check whether the Video Buffer is empty. |
setColourChannelUsageType |
Set the usage type of a color channel in an image. |
getColourChannelUsageType |
Get the usage type of a color channel in an image. |
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(imageId) |
Specify the next image that is returned by method getImage. |
setNextImageToReturn(imageId,keepInBuffer) |
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
An abstract method that controls whether there are more images left to fetch.
abstract boolean hasNextImageToFetch();
Return value
A boolean value that determines whether there are more images left to fetch.
setMaxImageCount
Set the maximum capability of the Video Buffer.
void setMaximumImageCount(int count);
Parameters
[in] count
: The maximum capability of the Video Buffer.
getMaxImageCount
Get the maximum capability of the Video Buffer.
int getMaximumImageCount();
Return Value
The maximum capability of the Video Buffer.
setBufferOverflowProtectionMode
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.
void setBufferOverflowProtectionMode(BufferOverflowProtectionMode mode);
Parameters
[in] mode
: One of the EnumBufferOverflowProtectionMode
that indicates the buffer overflow protection mode.
getBufferOverflowProtectionMode
Get the buffer overflow protection mode.
BufferOverflowProtectionMode getBufferOverflowProtectionMode();
Return Value
The buffer overflow protection mode.
getImageCount
Get the current image count in the Video Buffer.
int getImageCount();
Return Value
The current image count in the Video Buffer.
isBufferEmpty
Check whether the Video Buffer is empty.
boolean isBufferEmpty();
Return Value
A boolean value that indicates whether the Video Buffer is empty.
setColourChannelUsageType
The usage type of a color channel in an image.
void setColourChannelUsageType(EnumColourChannelUsageType type);
Parameters
[in] type
: One of the EnumColourChannelUsageType
that indicates whether the colour channel usage type.
getColourChannelUsageType
The usage type of a color channel in an image.
EnumColourChannelUsageType getColourChannelUsageType();
Return Value
One of the EnumColourChannelUsageType
that indicates whether the colour channel usage type.
startFetching
Start fetching images from the source to the Video Buffer of ImageSourceAdapter
.
void startFetching();
stopFetching
Stop fetching images from the source to the Video Buffer of ImageSourceAdapter
.
void stopFetching();
getImage
Get an image from the Video Buffer.
ImageData getImage();
Return Value
An object of ImageData.
- 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(imageId)
Specify the next image that is returned by method getImage.
boolean setNextImageToReturn(int imageId);
Parameters
[in] imageId
: The imageId of image you want to set as the “next image”.
Return Value
A boolean value that indicates whether the specified image is successfully set as the “next image”.
setNextImageToReturn(imageId,keepInBuffer)
Specify the next image that is returned by method getImage.
boolean setNextImageToReturn(int imageId, boolean keepInBuffer)
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 boolean value that indicates whether the specified image is successfully set as the “next image”.
hasImage
Check the availability of the specified image.
boolean hasImage(int imageId);
Parameters
[in] imageId
: The imageId of image you want to check the availability.
Return Value
A boolean value that indicates whether the specified image is found in the video buffer.
addImageToBuffer
Adds an image to the buffer of the adapter.
void addImageToBuffer(ImageData image);
Parameters
[in] image
: The ImageData object to add.
clearBuffer
Clears the image buffer.
void clearBuffer();