qpixmapdumper.cpp
Go to the documentation of this file.
1 #include "qpixmapdumper.h"
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 
QPixmapDumper(std::string prefix, int cycles)
std::string format
Definition: qpixmapdumper.h:12
#define filename_bufsize
std::string prefix
Definition: qpixmapdumper.h:11
bool dump(const QPixmap &pixmap)
unsigned int c
Definition: gfs2stream.cpp:41


openslam_gmapping
Author(s): Giorgio Grisetti, Cyrill Stachniss, Wolfram Burgard
autogenerated on Mon Jun 10 2019 14:04:22