Main Page
Namespaces
Classes
Files
File List
File Members
gui
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
12
void
QPixmapDumper::reset
(){
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::reset
void reset()
Definition:
qpixmapdumper.cpp:12
QPixmapDumper::QPixmapDumper
QPixmapDumper(std::string prefix, int cycles)
Definition:
qpixmapdumper.cpp:5
QPixmapDumper::format
std::string format
Definition:
qpixmapdumper.h:12
filename_bufsize
#define filename_bufsize
Definition:
qpixmapdumper.cpp:18
QPixmapDumper::frame
int frame
Definition:
qpixmapdumper.h:16
QPixmapDumper::prefix
std::string prefix
Definition:
qpixmapdumper.h:11
QPixmapDumper::counter
int counter
Definition:
qpixmapdumper.h:14
qpixmapdumper.h
QPixmapDumper::dump
bool dump(const QPixmap &pixmap)
Definition:
qpixmapdumper.cpp:20
c
unsigned int c
Definition:
gfs2stream.cpp:41
QPixmapDumper::cycles
int cycles
Definition:
qpixmapdumper.h:15
openslam_gmapping
Author(s): Giorgio Grisetti, Cyrill Stachniss, Wolfram Burgard
autogenerated on Mon Jun 10 2019 14:04:22