34 #ifndef vpImageStorageWorker_h
35 #define vpImageStorageWorker_h
37 #include <visp3/core/vpConfig.h>
39 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) && defined(VISP_HAVE_THREADS)
41 #include <visp3/io/vpImageIo.h>
42 #include <visp3/io/vpImageQueue.h>
60 : m_queue(queue), m_dataname(
""), m_cpt(1), m_ofs_data(), m_data_file_created(false)
74 char filename[FILENAME_MAX];
80 snprintf(filename, FILENAME_MAX, m_seqname.c_str(), m_cpt);
82 if (m_record_mode > 0) {
83 std::cout <<
"Save image: " << filename << std::endl;
85 else if (m_cpt == 1) {
86 std::cout <<
"Started sequence saving: " << m_seqname << std::endl;
91 if (!m_data_file_created) {
93 if (!parent.empty()) {
99 std::cout <<
"Create data file: " << m_dataname << std::endl;
100 m_ofs_data.open(m_dataname);
102 m_data_file_created =
true;
111 std::cout <<
"Receive cancel during color image saving." << std::endl;
112 if (m_data_file_created) {
113 std::cout <<
"Close data file: " << m_dataname << std::endl;
118 std::cout <<
"Receive cancel during gray image saving." << std::endl;
119 if (m_data_file_created) {
120 std::cout <<
"Close data file: " << m_dataname << std::endl;
128 std::string m_seqname;
129 std::string m_dataname;
132 std::ofstream m_ofs_data;
133 bool m_data_file_created;
static void write(const vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
int getRecordingMode() const
std::string getSeqName() const
vpImageStorageWorker(vpImageQueue< Type > &queue)
Definition of the vpImage class member functions.