34 #ifndef vpImageStorageWorker_h
35 #define vpImageStorageWorker_h
37 #include <visp3/core/vpConfig.h>
39 #include <visp3/io/vpImageIo.h>
40 #include <visp3/io/vpImageQueue.h>
58 : m_queue(queue), m_dataname(
""), m_cpt(1), m_ofs_data(), m_data_file_created(false)
72 char filename[FILENAME_MAX];
78 snprintf(filename, FILENAME_MAX, m_seqname.c_str(), m_cpt);
80 if (m_record_mode > 0) {
81 std::cout <<
"Save image: " << filename << std::endl;
83 else if (m_cpt == 1) {
84 std::cout <<
"Started sequence saving: " << m_seqname << std::endl;
89 if (!m_data_file_created) {
91 if (!parent.empty()) {
97 std::cout <<
"Create data file: " << m_dataname << std::endl;
98 m_ofs_data.open(m_dataname);
100 m_data_file_created =
true;
109 std::cout <<
"Receive cancel during color image saving." << std::endl;
110 if (m_data_file_created) {
111 std::cout <<
"Close data file: " << m_dataname << std::endl;
116 std::cout <<
"Receive cancel during gray image saving." << std::endl;
117 if (m_data_file_created) {
118 std::cout <<
"Close data file: " << m_dataname << std::endl;
126 std::string m_seqname;
127 std::string m_dataname;
130 std::ofstream m_ofs_data;
131 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.