Commit 8934e670 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Added an snapshot slot with numSamples parameter.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15935 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cd1674f6
......@@ -1330,7 +1330,7 @@ void Core::snapshotCounterStart(const int _counter, unsigned int _viewerId ){
}
void Core::snapshot( unsigned int _viewerId, int _width, int _height, bool _alpha, bool _hideCoordsys ){
void Core::snapshot( unsigned int _viewerId, int _width, int _height, bool _alpha, bool _hideCoordsys, int _numSamples ){
if ( OpenFlipper::Options::gui() ) {
......@@ -1338,7 +1338,7 @@ void Core::snapshot( unsigned int _viewerId, int _width, int _height, bool _alph
emit log(LOGERR,tr("Unable to create snapshot for viewer ") + QString::number(_viewerId) );
return;
}
coreWidget_->examiner_widgets_[_viewerId]->snapshot(_width, _height, _alpha, _hideCoordsys);
coreWidget_->examiner_widgets_[_viewerId]->snapshot(_width, _height, _alpha, _hideCoordsys, _numSamples);
}
}
......@@ -1507,6 +1507,18 @@ void Core::setDescriptions(){
" in snap.png in the current directory. For every snapshot"
" a counter is added to the filename."), QStringList(QString("viewerId;width;height;alpha;hideCoordsys").split(";")),
QStringList(QString("Id of viewer (default is 0);Width of image;Height of image;Transparent background;Hide coordsys node").split(";")));
emit setSlotDescription("snapshot(uint,int,int,bool,bool,int)", tr("Make a snapshot of the viewer with id viewerId."
" Pass 0 as viewerId parameter to capture the current viewer. "
" The captured image will have the specified dimensions. "
" If 0 is passed as either width or height parameter, the value will "
" automatically be set to hold the right aspect ratio, respectively. "
" If 0 is passed for both width and height values, the viewport's current "
" dimension is used. Set alpha to true if you want the background to be transparent. "
" The fifth parameter is used to hide the coordinate system in the upper right corner of the screen. "
" If no filename was set using snapshotBaseFileName() the snapshot is stored"
" in snap.png in the current directory. For every snapshot"
" a counter is added to the filename."), QStringList(QString("viewerId;width;height;alpha;hideCoordsys;numSamples").split(";")),
QStringList(QString("Id of viewer (default is 0);Width of image;Height of image;Transparent background;Hide coordsys node;Number of samples per pixel").split(";")));
emit setSlotDescription("resizeViewer(int,int)", tr("Resize the viewer"),
QString(tr("width,height")).split(","),
QString(tr("new width for the viewer,new height for the viewer")).split(","));
......
......@@ -690,7 +690,7 @@ public slots:
the current snapshot counter. The \a back buffer will be saved.
The id of the current viewer is 0 (default).
*/
void snapshot(unsigned int _viewerId = 0, int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false);
void snapshot(unsigned int _viewerId = 0, int _width = 0, int _height = 0, bool _alpha = false, bool _hideCoordsys = false, int _numSamples = 1);
/// Take a snapshot from the whole app
void applicationSnapshot();
......
......@@ -2210,5 +2210,5 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
}
emit log(LOGOUT,"================================================================================");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment