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")
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;
173 m_image_number = m_image_number_next;
174 std::stringstream ss;
176 if (m_use_generic_name) {
177 char filename[FILENAME_MAX];
178 sprintf(filename, m_generic_name.c_str(), m_image_number);
181 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << m_image_number <<
"." 185 m_image_number_next += m_image_step;
201 m_image_number = m_image_number_next;
202 std::stringstream ss;
203 if (m_use_generic_name) {
204 char filename[FILENAME_MAX];
205 sprintf(filename, m_generic_name.c_str(), m_image_number);
208 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << m_image_number <<
"." 212 m_image_number_next += m_image_step;
229 m_image_number = m_image_number_next;
230 std::stringstream ss;
231 if (m_use_generic_name) {
232 char filename[FILENAME_MAX];
233 sprintf(filename, m_generic_name.c_str(), m_image_number);
236 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << img_number <<
"." 240 m_image_number_next += m_image_step;
257 m_image_number = m_image_number_next;
258 std::stringstream ss;
259 if (m_use_generic_name) {
260 char filename[FILENAME_MAX];
261 sprintf(filename, m_generic_name.c_str(), m_image_number);
264 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << img_number <<
"." 268 m_image_number_next += m_image_step;
285 m_image_number = m_image_number_next;
286 std::stringstream ss;
287 if (m_use_generic_name) {
288 char filename[FILENAME_MAX];
289 sprintf(filename, m_generic_name.c_str(), m_image_number);
292 ss << m_directory <<
"/" << m_base_name << std::setfill(
'0') << std::setw(m_number_of_zero) << img_number <<
"." 296 m_image_number_next += m_image_step;
341 m_image_number = number;
342 m_image_number_next = number;
356 m_generic_name = generic_name;
357 m_use_generic_name =
true;
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
static void read(vpImage< unsigned char > &I, const std::string &filename)
void acquire(vpImage< unsigned char > &I)
unsigned int getWidth() const
unsigned int width
Number of columns in the image.