ProactiveImageSourceAdapter
The ProactiveImageSourceAdapter class is an abstract class that extends the ImageSourceAdapter class. It provides classes for proactively fetching images in a separate thread.
Definition
Namespace: com.dynamsoft.utility
Inheritance: ImageSourceAdapter -> ProactiveImageSourceAdapter
public abstract class ProactiveImageSourceAdapter extends ImageSourceAdapter
Methods
| Method | Description |
|---|---|
fetchImage |
This method needs to be implemented in the derived class. It is called in a loop in the Fetching thread to obtain images. |
setImageFetchInterval |
Sets the time interval for the ImageSource to wait before attempting to fetch another image to put in the buffer. |
getImageFetchInterval |
Gets the time interval for the ImageSource to wait before attempting to fetch another image to put in the buffer. |
hasNextImageToFetch |
Determines whether there are more images left to fetch. |
startFetching |
Starts fetching images. |
stopFetching |
Stops fetching images. |
fetchImage
This method needs to be implemented in the derived class. It is called in a loop in the Fetching thread to obtain images.
protected abstract ImageData fetchImage()
Return Value
Returns an ImageData object representing the fetched image.
See Also
setImageFetchInterval
Sets the time interval for the ImageSource to wait before attempting to fetch another image to put in the buffer.
void setImageFetchInterval(int milliseconds)
Parameters
milliseconds Specifies the wait time in milliseconds. If setting to -1, the ImageSource does not proactively fetch images.
getImageFetchInterval
Gets the time interval for the ImageSource to wait before attempting to fetch another image to put in the buffer.
int getImageFetchInterval()
Return Value
Returns the wait time in milliseconds. If the value is -1, the ImageSource does not proactively fetch images.
hasNextImageToFetch
Determines whether there are more images left to fetch.
boolean hasNextImageToFetch()
Return Value
Returns true if there are more images left to fetch, false otherwise.
startFetching
Starts fetching images.
void startFetching()
stopFetching
Stops fetching images.
void stopFetching()