layout | title | description | keywords | needAutoGenerateSidebar |
---|---|---|---|---|
default-layout |
class CImageSourceAdapter - Dynamsoft Core Module C++ Edition API Reference |
This page shows the C++ edition of the class CImageSourceAdapter in Dynamsoft Core Module. |
image source adapter, c++ |
true |
The CImageSourceAdapter 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.
Namespace: dynamsoft::basic_structures
Assembly: DynamsoftCore
class CImageSourceAdapter
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. |
Adds an image to the buffer of the adapter.
void AddImageToBuffer(const CImageData* img, bool bClone = true);
Parameters
[in] img
The image to add to the buffer.
[in] bClone
Whether the image should be cloned before being added to the buffer.
Determines whether there are more images left to fetch.
virtual bool HasNextImageToFetch() const;
Return value
Returns true if there are more images left to fetch, false otherwise. This function must be implemented in the subclass.
Starts fetching images.
virtual void StartFetching();
Stops fetching images.
virtual void StopFetching();
Returns a buffered image.
virtual CImageData* GetImage();
Return value
Returns a pointer to the image if it exists in the buffer, NULL otherwise.
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.
Returns how many images can be buffered.
int GetMaxImageCount() const;
Return value
Returns the maximum number of images that can be buffered.
Sets a mode that determines the action to take when there is a new incoming image and the buffer is full.
void SetBufferOverflowProtectionMode(BufferOverflowProtectionMode mode);
Parameters
[in] mode
The buffer overflow protection mode to set.
Returns the current buffer overflow protection mode.
BufferOverflowProtectionMode GetBufferOverflowProtectionMode() const;
Return value
Returns the current buffer overflow protection mode.
Determines whether the image is in the buffer or not.
bool HasImage(int imageId) const;
Parameters
[in] imageId
The ID of the image to check.
Return value
Returns true if the image is in the buffer, false otherwise.
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 kept in the buffer after it is returned.
Return value
Returns true if the image is in the buffer and is set as the next image to return, false otherwise.
Returns the actual count of buffered images.
int GetImageCount() const;
Return value
Returns the actual count of buffered images.
Determines whether the buffer is empty.
bool IsBufferEmpty() const;
Return value
Returns true if the buffer is empty, false otherwise.
Clear the image buffer.
void ClearBuffer();
Sets the usage type of a color channel in images.
void SetColourChannelUsageType(ColourChannelUsageType type);
Gets the usage type of a color channel in images.
ColourChannelUsageType GetColourChannelUsageType() const;
Return value
Returns the usage type of a color channel in images.