Visual Servoing Platform  version 3.6.1 under development (2024-04-23)
vpImageQueue< Type > Class Template Reference

#include <visp3/io/vpImageQueue.h>

Classes

struct  vpCancelled_t
 

Public Member Functions

 vpImageQueue (const std::string &seqname, int record_mode)
 
void cancel ()
 
int getRecordingMode () const
 
bool getRecordingTrigger () const
 
std::string getSeqName () const
 
void pop (vpImage< Type > &I, std::string &data)
 
void push (const vpImage< Type > &I, std::string *data)
 
bool record (const vpImage< Type > &I, std::string *data=nullptr, bool trigger_recording=false, bool disable_left_click=false)
 
void setMaxQueueSize (const size_t max_queue_size)
 

Detailed Description

template<class Type>
class vpImageQueue< Type >

Create a queue containing images and optional additional strings that could be useful to save additional information like the timestamp.

This call is to use with vpImageStorageWorker.

Examples
tutorial-grabber-1394.cpp, tutorial-grabber-basler-pylon.cpp, tutorial-grabber-bebop2.cpp, tutorial-grabber-flycapture.cpp, tutorial-grabber-ids-ueye.cpp, tutorial-grabber-opencv.cpp, tutorial-grabber-realsense-T265.cpp, tutorial-grabber-realsense.cpp, tutorial-grabber-structure-core.cpp, and tutorial-grabber-v4l2.cpp.

Definition at line 61 of file vpImageQueue.h.

Constructor & Destructor Documentation

◆ vpImageQueue()

template<class Type >
vpImageQueue< Type >::vpImageQueue ( const std::string &  seqname,
int  record_mode 
)
inline

Queue (FIFO) constructor. By default the max queue size is set to 1024*8.

Parameters
[in]seqname: Generic sequence name like "folder/I%04d.png". If this name contains a parent folder, it will be created.
[in]record_mode: 0 to record a sequence of images, 1 to record single images.

Definition at line 74 of file vpImageQueue.h.

References vpIoTools::checkDirectory(), and vpIoTools::getParent().

Member Function Documentation

◆ cancel()

template<class Type >
void vpImageQueue< Type >::cancel ( )
inline

Emit cancel signal.

Definition at line 92 of file vpImageQueue.h.

◆ getRecordingMode()

template<class Type >
int vpImageQueue< Type >::getRecordingMode ( ) const
inline

Return record mode; 0 when recording a sequence of images, 1 when recording recording single imagess.

Definition at line 103 of file vpImageQueue.h.

Referenced by vpImageStorageWorker< Type >::vpImageStorageWorker().

◆ getRecordingTrigger()

template<class Type >
bool vpImageQueue< Type >::getRecordingTrigger ( ) const
inline

Return recording trigger indicating if recording is started.

Definition at line 108 of file vpImageQueue.h.

◆ getSeqName()

template<class Type >
std::string vpImageQueue< Type >::getSeqName ( ) const
inline

Return generic name of the sequence of images.

Definition at line 113 of file vpImageQueue.h.

Referenced by vpImageStorageWorker< Type >::vpImageStorageWorker().

◆ pop()

template<class Type >
void vpImageQueue< Type >::pop ( vpImage< Type > &  I,
std::string &  data 
)
inline

Pop the image to save from the queue (FIFO).

Parameters
[out]I: Image to record.
[out]data: Data to record.

Definition at line 122 of file vpImageQueue.h.

◆ push()

template<class Type >
void vpImageQueue< Type >::push ( const vpImage< Type > &  I,
std::string *  data 
)
inline

Push data to save in the queue (FIFO).

Parameters
[in]I: Image to record.
[in]data: Data to record.

Definition at line 154 of file vpImageQueue.h.

Referenced by vpImageQueue< Type >::record().

◆ record()

template<class Type >
bool vpImageQueue< Type >::record ( const vpImage< Type > &  I,
std::string *  data = nullptr,
bool  trigger_recording = false,
bool  disable_left_click = false 
)
inline

Record helper that display information in the windows associated to the image, pop current image and additional data in the queue.

Parameters
[in]I: Image to record.
[in]data: Data to record. Set to nullptr when no additional data have to be considered.
[in]trigger_recording: External trigger to start data saving.
[in]disable_left_click: Disable left click usage to trigger data saving.
Returns
true when the used asked to quit using a right click in the display window.

Definition at line 187 of file vpImageQueue.h.

References vpMouseButton::button1, vpMouseButton::button3, vpImage< Type >::display, vpDisplay::displayText(), vpDisplay::getClick(), vpDisplay::getDownScalingFactor(), vpIoTools::makeDirectory(), vpImageQueue< Type >::push(), and vpColor::red.

◆ setMaxQueueSize()

template<class Type >
void vpImageQueue< Type >::setMaxQueueSize ( const size_t  max_queue_size)
inline

Set queue size.

Parameters
[in]max_queue_size: Queue size.

Definition at line 268 of file vpImageQueue.h.