iVS3D v2.0.0
Loading...
Searching...
No Matches
ConcurrentReader Class Reference

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>

Inheritance diagram for ConcurrentReader:

Public Slots

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.
 

Signals

void sig_imageReady (uint idx, const cv::Mat &img)
 [signal] sig_imageReady is emitted after image is loaded.
 

Public Member Functions

 ConcurrentReader (Reader *reader)
 ConcurrentReader creates a wrapper for the given Reader object.
 

Private Slots

void slot_pull ()
 slot_pull takes the most recent index from queue and reads the image from.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ConcurrentReader()

ConcurrentReader::ConcurrentReader ( Reader reader)
explicit

ConcurrentReader creates a wrapper for the given Reader object.

Parameters
readerThe object to use for reading images.

Member Function Documentation

◆ sig_imageReady

void ConcurrentReader::sig_imageReady ( uint  idx,
const cv::Mat &  img 
)
signal

[signal] sig_imageReady is emitted after image is loaded.

Parameters
idxThe index of the image that has been loaded
imgThe 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
idxThe index to read from

The documentation for this class was generated from the following files: