qpixmapdumper.cpp
Go to the documentation of this file.
00001 #include "qpixmapdumper.h"
00002 #include <cstdio>
00003 #include <cstring>
00004 
00005 QPixmapDumper::QPixmapDumper(std::string p, int c){
00006         format="PNG";
00007         prefix=p;
00008         reset();
00009         cycles=c;
00010 }
00011 
00012 void QPixmapDumper::reset(){
00013         cycles=0;
00014         frame=0;
00015         counter=0;
00016 }
00017 
00018 #define filename_bufsize 1024
00019 
00020 bool QPixmapDumper::dump(const QPixmap& pixmap){
00021         bool processed=false;
00022         if (!(counter%cycles)){
00023                 char buf[filename_bufsize];
00024                 sprintf(buf,"%s-%05d.%s",prefix.c_str(), frame, format.c_str());
00025                 QImage image=pixmap.convertToImage();
00026                 image.save(QString(buf), format.c_str(),0);
00027                 frame ++;
00028         }
00029         counter++;
00030         return processed;
00031 }
00032 
00033 


openslam_gmapping
Author(s): Giorgio Grisetti, Cyrill Stachniss, Wolfram Burgard
autogenerated on Thu Jun 6 2019 19:25:13