Engauge Digitizer  2
ExportImageForRegression.cpp
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #include "ExportImageForRegression.h"
8 #include <QFile>
9 #include <QMessageBox>
10 #include <QObject>
11 #include <QPixmap>
12 #include <QString>
13 #include <QTextStream>
14 
16  m_width (pixmap.width ()),
17  m_height (pixmap.height ())
18 {
19 }
20 
21 void ExportImageForRegression::fileExport (const QString &filename) const
22 {
23  QFile file (filename);
24  if (!file.open (QIODevice::WriteOnly)) {
25  QMessageBox::critical (0,
26  QObject::tr ("Export Image"),
27  QObject::tr ("Cannot export file"));
28  } else {
29 
30  QTextStream str (&file);
31 
32  str << m_width << "x" << m_height << "\n";
33 
34  file.close ();
35  }
36 }
ExportImageForRegression(const QPixmap &pixmap)
Single constructor.
void fileExport(const QString &filename) const
Export to the specified file. This is called when the Transformation has not been defined...