36 #ifndef vpImageStorageWorker_h
37 #define vpImageStorageWorker_h
39 #include <visp3/core/vpConfig.h>
41 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
43 #include <visp3/io/vpImageIo.h>
44 #include <visp3/io/vpImageQueue.h>
62 : m_queue(queue), m_dataname(
""), m_cpt(1), m_ofs_data(), m_data_file_created(false)
76 char filename[FILENAME_MAX];
82 snprintf(filename, FILENAME_MAX, m_seqname.c_str(), m_cpt);
84 if (m_record_mode > 0) {
85 std::cout <<
"Save image: " << filename << std::endl;
86 }
else if (m_cpt == 1) {
87 std::cout <<
"Started sequence saving: " << m_seqname << std::endl;
92 if (!m_data_file_created) {
94 if (!parent.empty()) {
100 std::cout <<
"Create data file: " << m_dataname << std::endl;
101 m_ofs_data.open(m_dataname);
103 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;
117 std::cout <<
"Receive cancel during gray image saving." << std::endl;
118 if (m_data_file_created) {
119 std::cout <<
"Close data file: " << m_dataname << std::endl;
127 std::string m_seqname;
128 std::string m_dataname;
131 std::ofstream m_ofs_data;
132 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.