Visual Servoing Platform  version 3.4.0
vpImageQueue< Type > Class Template Reference

#include <vpImageQueue.h>

Classes

struct  cancelled
 

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=NULL, 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, and tutorial-grabber-v4l2.cpp.

Definition at line 63 of file vpImageQueue.h.

Constructor & Destructor Documentation

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

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

Emit cancel signal.

Definition at line 91 of file vpImageQueue.h.

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 101 of file vpImageQueue.h.

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

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

Return recording trigger indicating if recording is started.

Definition at line 109 of file vpImageQueue.h.

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

Return generic name of the sequence of images.

Definition at line 117 of file vpImageQueue.h.

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

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 129 of file vpImageQueue.h.

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 160 of file vpImageQueue.h.

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

template<class Type>
bool vpImageQueue< Type >::record ( const vpImage< Type > &  I,
std::string *  data = NULL,
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 NULL 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 191 of file vpImageQueue.h.

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

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 258 of file vpImageQueue.h.