Table of contents

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: Dynamsoft.Core

Assembly: Dynamsoft.Core.dll

public abstract class ImageSourceAdapter 

Methods

Method Description
AddImageToBuffer Adds an image to the buffer of the adapter.
HasNextImageToFetch Determines whether there are more images left to fetch.
StartFetching Starts fetching images.
StopFetching Stops fetching images.
GetImage Returns a buffered image.
SetMaxImageCount Sets how many images are allowed to be buffered.
GetMaxImageCount Returns how many images can be buffered.
SetBufferOverflowProtectionMode Sets a mode that determines the action to take when there is a new incoming image and the buffer is full.
GetBufferOverflowProtectionMode Returns the current buffer overflow protection mode.
HasImage Determines whether the image is in the buffer or not.
SetNextImageToReturn Sets the next image to return.
GetImageCount Returns the actual count of buffered images.
IsBufferEmpty Determines whether the buffer is empty.
ClearBuffer Clears the image buffer.
SetColourChannelUsageType Sets the usage type of a color channel in an image.
GetColourChannelUsageType Gets the usage type of a color channel in an image.
SetErrorListener Sets the error listener for the image source.
Dispose Releases all resources used by current object.

AddImageToBuffer

Adds an image to the buffer of the adapter.

void AddImageToBuffer(ImageData img)

Parameters

[in] img The image to add to the buffer.

See Also

ImageData

HasNextImageToFetch

Determines whether there are more images left to fetch.

abstract bool HasNextImageToFetch()

Return Value

Returns true if there are more images left to fetch, false otherwise. This function must be implemented in the subclass.

StartFetching

Starts fetching images.

virtual void StartFetching()

StopFetching

Stops fetching images.

virtual void StopFetching()

GetImage

Returns a buffered image.

virtual ImageData GetImage()

Return Value

Returns an image if it exists in the buffer, null otherwise.

See Also

ImageData

SetMaxImageCount

Sets how many images are allowed to be buffered.

void SetMaxImageCount(int count)

Parameters

[in] count The maximum number of images that can be buffered.

GetMaxImageCount

Returns how many images can be buffered.

int GetMaxImageCount()

Return Value

Returns the maximum number of images that can be buffered.

SetBufferOverflowProtectionMode

Sets a mode that determines the action to take when there is a new incoming image and the buffer is full.

void SetBufferOverflowProtectionMode(EnumBufferOverflowProtectionMode mode)

Parameters

[in] mode The buffer overflow protection mode to set.

See Also

EnumBufferOverflowProtectionMode

GetBufferOverflowProtectionMode

Returns the current buffer overflow protection mode.

EnumBufferOverflowProtectionMode GetBufferOverflowProtectionMode()

Return Value

Returns the current buffer overflow protection mode.

See Also

EnumBufferOverflowProtectionMode

HasImage

Determines whether the image is in the buffer or not.

bool HasImage(int imageId)

Parameters

[in] imageId The ID of the image to check.

Return Value

Returns true if the image is in the buffer, false otherwise.

SetNextImageToReturn

Sets the next image to return.

bool SetNextImageToReturn(int imageId, bool keepInBuffer = true)

Parameters

[in] imageId The ID of the next image to return.

[in] keepInBuffer Whether the image should be retained in the buffer, even if the buffer is full and the image needs to be updated based on the BufferOverflowProtectionMode parameter.

Return Value

Returns true if the image is in the buffer and is set as the next image to return, false otherwise.

GetImageCount

Returns the actual count of buffered images.

int GetImageCount()

Return Value

Returns the actual count of buffered images.

IsBufferEmpty

Determines whether the buffer is empty.

bool IsBufferEmpty()

Return Value

Returns true if the buffer is empty, false otherwise.

ClearBuffer

Clear the image buffer.

void ClearBuffer()

SetColourChannelUsageType

Sets the usage type of a color channel in images.

void SetColourChannelUsageType(EnumColourChannelUsageType type)

Parameters

[in] type The usage type of a color channel in images to set.

See Also

EnumColourChannelUsageType

GetColourChannelUsageType

Gets the usage type of a color channel in images.

EnumColourChannelUsageType GetColourChannelUsageType()

Return Value

Returns the usage type of a color channel in images.

See Also

EnumColourChannelUsageType

SetErrorListener

This function allows you to set an error listener object that will receive notifications when errors occur during image source operations. If an error occurs, the error infomation will be passed to the listener’s OnErrorReceived method.

void SetErrorListener(IImageSourceErrorListener listener)

Parameters

[in] listener Specifies a listening object of the type IImageSourceErrorListener, which will handle error notifications.

See Also

IImageSourceErrorListener

Dispose

Releases all resources used by current object.

void Dispose()

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: