Class ImageContainer
Container for images queried from each camera. More...
#include <imageContainer.h>
Inherits the following classes: QObject
Public Attributes
| Type | Name |
|---|---|
| bool | m_PollImage |
| std::shared_ptr< XiAPIWrapper > | m_apiWrapper |
| std::unique_ptr< FileImage > | m_imageFile |
Public Signals
| Type | Name |
|---|---|
| signal void | NewImage |
Public Functions
| Type | Name |
|---|---|
| void | CloseFile () |
| XI_IMG | GetCurrentImage () |
| ImageContainer () |
|
| void | Initialize (const std::shared_ptr< XiAPIWrapper > & apiWrapper) |
| void | InitializeFile (const char * filePath) |
| void | PollImage (const HANDLE * cameraHandle, int pollingRate) Polls for a new image from the camera at a given polling rate. |
| void | StartPolling () |
| void | StopPolling () |
| ~ImageContainer () override |
Detailed Description
This class handles the polling of images from the camera and emits a Qt signal when a new image is available. If an error occurs when acquiring an image from the camera, e.g. connection error, the file associated with the acquisition is closed, metadata is appended, and throws an exception.
The file associated with the images can be initialized with ImageContainer::InitializeFile, and it can be closed using ImageContainer::CloseFile. Closing the file automatically appends the corresponding metadata to the file.
Public Attributes Documentation
variable m_PollImage
Indicates if images should be polled or not
variable m_apiWrapper
Wrapper to xiAPI, useful for mocking the aPI during testing
variable m_imageFile
Pointer to image file object in charge of writing data to file.
Public Signals Documentation
signal NewImage
Qt signal used to indicate that a new image has arrived to the container
Public Functions Documentation
function CloseFile
Manages proper closing of file in case in case it has been initialized.
function GetCurrentImage
Queries current imag ein container
Returns:
current image in container
function ImageContainer
Constructor of image container. The memory of the current image in container is set here with memset
function Initialize
Initializes the container by setting the API for communication with the cameras
Parameters:
apiWrapper
function InitializeFile
It initializes the file object that will be used to store the data.
Parameters:
filePathfile path (without extension) where data will be stored
function PollImage
Polls for a new image from the camera at a given polling rate.
This function continuously polls for a new image from the camera using the specified camera handle. It uses the given polling rate to determine how frequently to poll for new images. Once a new image is obtained, it emits a signal to notify that a new image is available.
A lock guard is used to avoid overwriting the current container image when other processes are using it.
Parameters:
cameraHandleThe handle to the camera device.pollingRateThe polling rate in milliseconds.
function StartPolling
Starts image polling
function StopPolling
Stops image polling
function ~ImageContainer
Destructor of image container
The documentation for this class was generated from the following file src/imageContainer.h