39 #include <visp3/io/vpDiskGrabber.h> 45 : m_image_number(0), m_image_number_next(0), m_image_step(1), m_number_of_zero(0), m_directory(
"/tmp"),
46 m_base_name(
"I"), m_extension(
"pgm"), m_use_generic_name(false), m_generic_name(
"empty")
55 : m_image_number(0), m_image_number_next(0), m_image_step(1), m_number_of_zero(0), m_directory(
"/tmp"),
56 m_base_name(
"I"), m_extension(
"pgm"), m_use_generic_name(true), m_generic_name(generic_name)
73 unsigned int noz,
const std::string &ext)
74 : m_image_number(number), m_image_number_next(number), m_image_step(step), m_number_of_zero(noz), m_directory(dir),
75 m_base_name(basename), m_extension(ext), m_use_generic_name(false), m_generic_name(
"empty"), m_image_name()
146 m_image_number = m_image_number_next;
147 std::stringstream ss;
149 if (m_use_generic_name) {
150 char filename[FILENAME_MAX];
151 sprintf(filename, m_generic_name.c_str(), m_image_number);
154 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << m_image_number <<
"." 158 m_image_number_next += m_image_step;
159 m_image_name = ss.str();
174 m_image_number = m_image_number_next;
175 std::stringstream ss;
177 if (m_use_generic_name) {
178 char filename[FILENAME_MAX];
179 sprintf(filename, m_generic_name.c_str(), m_image_number);
182 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << m_image_number <<
"." 186 m_image_number_next += m_image_step;
187 m_image_name = ss.str();
202 m_image_number = m_image_number_next;
203 std::stringstream ss;
204 if (m_use_generic_name) {
205 char filename[FILENAME_MAX];
206 sprintf(filename, m_generic_name.c_str(), m_image_number);
209 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << m_image_number <<
"." 213 m_image_number_next += m_image_step;
230 m_image_number = img_number;
231 std::stringstream ss;
232 if (m_use_generic_name) {
233 char filename[FILENAME_MAX];
234 sprintf(filename, m_generic_name.c_str(), m_image_number);
237 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << m_image_number <<
"." 241 m_image_number_next = m_image_number + m_image_step;
258 m_image_number = img_number;
259 std::stringstream ss;
260 if (m_use_generic_name) {
261 char filename[FILENAME_MAX];
262 sprintf(filename, m_generic_name.c_str(), m_image_number);
265 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << m_image_number <<
"." 269 m_image_number_next = m_image_number + m_image_step;
286 m_image_number = m_image_number_next;
287 std::stringstream ss;
288 if (m_use_generic_name) {
289 char filename[FILENAME_MAX];
290 sprintf(filename, m_generic_name.c_str(), m_image_number);
293 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << img_number <<
"." 297 m_image_number_next += m_image_step;
342 m_image_number = number;
343 m_image_number_next = number;
357 m_generic_name = generic_name;
358 m_use_generic_name =
true;
long getImageNumber() const
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
void setGenericName(const std::string &genericName)
void setDirectory(const std::string &dir)
void setBaseName(const std::string &name)
void setExtension(const std::string &ext)
void setNumberOfZero(unsigned int noz)
unsigned int height
Number of rows in the image.
void setImageNumber(long number)
void open(vpImage< unsigned char > &I)
static void readPFM(vpImage< float > &I, const std::string &filename)
bool init
Set to true if the frame grabber has been initialized.
unsigned int getHeight() const
void acquire(vpImage< unsigned char > &I)
unsigned int getWidth() const
unsigned int width
Number of columns in the image.