Resource Base
Table of contents

ProactiveImageSourceAdapter

The ProactiveImageSourceAdapter class is an abstract class that extends the ImageSourceAdapter class. It provides classs for proactively fetching images in a separate thread.

Definition

Module: dynamsoft_utility

Inheritance: ImageSourceAdapter -> ProactiveImageSourceAdapter

class ProactiveImageSourceAdapter(ImageSourceAdapter, ABC):

Methods

Method Description
_fetch_image This method needs to be implemented in the derived class. It is called in a loop in the Fetching thread to obtain images.
set_image_fetch_interval Sets the time interval for the ImageSource to wait before attempting to fetch another image to put in the buffer.
get_image_fetch_interval Gets the time interval for the ImageSource to wait before attempting to fetch another image to put in the buffer.
has_next_image_to_fetch Determines whether there are more images left to fetch.
start_fetching Starts fetching images.
stop_fetching Stops fetching images.

_fetch_image

This method needs to be implemented in the derived class. It is called in a loop in the Fetching thread to obtain images.

@abstractmethod
def _fetch_image():

set_image_fetch_interval

Sets the time interval for the ImageSource to wait before attempting to fetch another image to put in the buffer.

def set_image_fetch_interval(self, milliseconds: int) -> None:

Parameters

  • milliseconds Specifies the wait time in milliseconds. If setting to -1, the ImageSource does not proactively fetch images.

get_image_fetch_interval

Gets the time interval for the ImageSource to wait before attempting to fetch another image to put in the buffer.

def get_image_fetch_interval(self) -> int:

Return Value

Returns the wait time in milliseconds. If the value is -1, the ImageSource does not proactively fetch images.

has_next_image_to_fetch

Determines whether there are more images left to fetch.

def has_next_image_to_fetch(self) -> bool:

Return Value

Returns true if there are more images left to fetch, false otherwise.

start_fetching

Starts fetching images.

def start_fetching(self) -> None:

stop_fetching

Stops fetching images.

def stop_fetching(self) -> None:

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article:

latest version

    Change +