The ConcurrentReader class is a wrapper for a Reader object. The ConcurrentReader can be moved to a separate thread to read images in parallel. The images can be requested using ConcurrentReader::slot_read. The reader sends the signal ConcurrentReader::sig_imageReady if the image is loaded. Since usually requests for images from the gui thread comi in much faster than they can be handled by the Reader, the ConcurrentReader collects blocks incoming requests and only passes the latest read request to the Reader. This ensures that on slower hardware and with higher resolution images always the most recent image is loaded and send to the gui.
More...
#include <concurrentreader.h>
|
| void | slot_read (uint idx) |
| | [slot] slot_read adds the requested idx to the waiting-queue or starts the reader if the queue is empty.
|
| |
|
| void | sig_imageReady (uint idx, const cv::Mat &img) |
| | [signal] sig_imageReady is emitted after image is loaded.
|
| |
|
|
void | slot_pull () |
| | slot_pull takes the most recent index from queue and reads the image from.
|
| |
The ConcurrentReader class is a wrapper for a Reader object. The ConcurrentReader can be moved to a separate thread to read images in parallel. The images can be requested using ConcurrentReader::slot_read. The reader sends the signal ConcurrentReader::sig_imageReady if the image is loaded. Since usually requests for images from the gui thread comi in much faster than they can be handled by the Reader, the ConcurrentReader collects blocks incoming requests and only passes the latest read request to the Reader. This ensures that on slower hardware and with higher resolution images always the most recent image is loaded and send to the gui.
- Author
- Dominik Wüst
- Date
- 2021/04/13
◆ ConcurrentReader()
| ConcurrentReader::ConcurrentReader |
( |
Reader * |
reader | ) |
|
|
explicit |
ConcurrentReader creates a wrapper for the given Reader object.
- Parameters
-
| reader | The object to use for reading images. |
◆ sig_imageReady
| void ConcurrentReader::sig_imageReady |
( |
uint |
idx, |
|
|
const cv::Mat & |
img |
|
) |
| |
|
signal |
[signal] sig_imageReady is emitted after image is loaded.
- Parameters
-
| idx | The index of the image that has been loaded |
| img | The image that has been loaded |
◆ slot_read
| void ConcurrentReader::slot_read |
( |
uint |
idx | ) |
|
|
slot |
[slot] slot_read adds the requested idx to the waiting-queue or starts the reader if the queue is empty.
- Parameters
-
| idx | The index to read from |
The documentation for this class was generated from the following files:
- iVS3D/src/iVS3D-core/model/reader/concurrentreader.h
- iVS3D/src/iVS3D-core/model/reader/concurrentreader.cpp