1 /* 2 Scan Tailor - Interactive post-processing tool for scanned pages. 3 Copyright (C) Joseph Artsimovich <joseph.artsimovich@gmail.com> 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef OUTPUT_DEWARPING_MODE_H_ 20 #define OUTPUT_DEWARPING_MODE_H_ 21 22 #include <QString> 23 #include <QtXml/QDomElement> 24 25 namespace output { 26 enum DewarpingMode { OFF, AUTO, MANUAL, MARGINAL }; 27 28 class DewarpingOptions { 29 public: 30 explicit DewarpingOptions(DewarpingMode mode = OFF, bool needPostDeskew = true); 31 32 explicit DewarpingOptions(const QDomElement& el); 33 34 QDomElement toXml(QDomDocument& doc, const QString& name) const; 35 36 bool operator==(const DewarpingOptions& other) const; 37 38 bool operator!=(const DewarpingOptions& other) const; 39 40 DewarpingMode dewarpingMode() const; 41 42 void setDewarpingMode(DewarpingMode m_mode); 43 44 bool needPostDeskew() const; 45 46 void setPostDeskew(bool postDeskew); 47 48 static DewarpingMode parseDewarpingMode(const QString& str); 49 50 static QString formatDewarpingMode(DewarpingMode mode); 51 52 private: 53 DewarpingMode m_mode; 54 bool m_needPostDeskew; 55 }; 56 } // namespace output 57 #endif 58