qpixmapdumper.cpp
Go to the documentation of this file.
2 #include <cstdio>
3 #include <cstring>
4 
5 QPixmapDumper::QPixmapDumper(std::string p, int c){
6  format="PNG";
7  prefix=p;
8  reset();
9  cycles=c;
10 }
11 
13  cycles=0;
14  frame=0;
15  counter=0;
16 }
17 
18 #define filename_bufsize 1024
19 
20 bool QPixmapDumper::dump(const QPixmap& pixmap){
21  bool processed=false;
22  if (!(counter%cycles)){
23  char buf[filename_bufsize];
24  sprintf(buf,"%s-%05d.%s",prefix.c_str(), frame, format.c_str());
25  QImage image=pixmap.convertToImage();
26  image.save(QString(buf), format.c_str(),0);
27  frame ++;
28  }
29  counter++;
30  return processed;
31 }
32 
33 
c
unsigned int c
Definition: gfs2stream.cpp:41
QPixmapDumper::prefix
std::string prefix
Definition: qpixmapdumper.h:11
qpixmapdumper.h
QPixmapDumper::format
std::string format
Definition: qpixmapdumper.h:12
QPixmapDumper::frame
int frame
Definition: qpixmapdumper.h:16
QPixmapDumper::reset
void reset()
Definition: qpixmapdumper.cpp:12
QPixmapDumper::counter
int counter
Definition: qpixmapdumper.h:14
QPixmapDumper::dump
bool dump(const QPixmap &pixmap)
Definition: qpixmapdumper.cpp:20
QPixmapDumper::cycles
int cycles
Definition: qpixmapdumper.h:15
filename_bufsize
#define filename_bufsize
Definition: qpixmapdumper.cpp:18
QPixmapDumper::QPixmapDumper
QPixmapDumper(std::string prefix, int cycles)
Definition: qpixmapdumper.cpp:5


openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Thu Oct 19 2023 02:25:51