From 3d3d1e99a70276f12ac752cf26e4fbdb4c292651 Mon Sep 17 00:00:00 2001 From: Alex <4lex49@zoho.com> Date: Sat, 2 Dec 2017 22:12:20 +0300 Subject: [PATCH] ~ added missing files --- filters/output/OutputProcessingParams.cpp | 63 +++++++++++++++++++++++ filters/output/OutputProcessingParams.h | 42 +++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 filters/output/OutputProcessingParams.cpp create mode 100644 filters/output/OutputProcessingParams.h diff --git a/filters/output/OutputProcessingParams.cpp b/filters/output/OutputProcessingParams.cpp new file mode 100644 index 000000000..ddbe11a18 --- /dev/null +++ b/filters/output/OutputProcessingParams.cpp @@ -0,0 +1,63 @@ + +#include "BlackWhiteOptions.h" +#include "OutputProcessingParams.h" +#include + +namespace output { + + OutputProcessingParams::OutputProcessingParams() + : whiteOnBlackMode(false), + autoZonesFound(false), + whiteOnBlackAutoDetected(false) { + } + + OutputProcessingParams::OutputProcessingParams(QDomElement const& el) + : whiteOnBlackMode(el.attribute("whiteOnBlackMode") == "1"), + autoZonesFound(el.attribute("autoZonesFound") == "1"), + whiteOnBlackAutoDetected(el.attribute("whiteOnBlackAutoDetected") == "1") { + } + + QDomElement OutputProcessingParams::toXml(QDomDocument& doc, QString const& name) const { + QDomElement el(doc.createElement(name)); + el.setAttribute("whiteOnBlackMode", whiteOnBlackMode ? "1" : "0"); + el.setAttribute("autoZonesFound", autoZonesFound ? "1" : "0"); + el.setAttribute("whiteOnBlackAutoDetected", whiteOnBlackAutoDetected ? "1" : "0"); + + return el; + } + + bool OutputProcessingParams::operator==(OutputProcessingParams const& other) const { + return (whiteOnBlackMode == other.whiteOnBlackMode) + && (autoZonesFound == other.autoZonesFound) + && (whiteOnBlackAutoDetected == other.whiteOnBlackAutoDetected); + } + + bool OutputProcessingParams::operator!=(OutputProcessingParams const& other) const { + return !(*this == other); + } + + bool output::OutputProcessingParams::isAutoZonesFound() const { + return autoZonesFound; + } + + void output::OutputProcessingParams::setAutoZonesFound(bool autoZonesFound) { + OutputProcessingParams::autoZonesFound = autoZonesFound; + } + + bool output::OutputProcessingParams::isWhiteOnBlackAutoDetected() const { + return whiteOnBlackAutoDetected; + } + + void output::OutputProcessingParams::setWhiteOnBlackAutoDetected(bool whiteOnBlackAutoDetected) { + OutputProcessingParams::whiteOnBlackAutoDetected = whiteOnBlackAutoDetected; + } + + bool output::OutputProcessingParams::isWhiteOnBlackMode() const { + return whiteOnBlackMode; + } + + void output::OutputProcessingParams::setWhiteOnBlackMode(bool whiteOnBlackMode) { + OutputProcessingParams::whiteOnBlackMode = whiteOnBlackMode; + } + +} \ No newline at end of file diff --git a/filters/output/OutputProcessingParams.h b/filters/output/OutputProcessingParams.h new file mode 100644 index 000000000..b731b2d4f --- /dev/null +++ b/filters/output/OutputProcessingParams.h @@ -0,0 +1,42 @@ + +#ifndef SCANTAILOR_OUTPUTPROCESSINGPARAMS_H +#define SCANTAILOR_OUTPUTPROCESSINGPARAMS_H + +class QString; +class QDomDocument; +class QDomElement; + +namespace output { + class OutputProcessingParams { + public: + OutputProcessingParams(); + + explicit OutputProcessingParams(QDomElement const& el); + + QDomElement toXml(QDomDocument& doc, QString const& name) const; + + bool operator==(OutputProcessingParams const& other) const; + + bool operator!=(OutputProcessingParams const& other) const; + + bool isWhiteOnBlackAutoDetected() const; + + void setWhiteOnBlackAutoDetected(bool whiteOnBlackAutoDetected); + + bool isAutoZonesFound() const; + + void setAutoZonesFound(bool autoZonesFound); + + bool isWhiteOnBlackMode() const; + + void setWhiteOnBlackMode(bool whiteOnBlackMode); + + private: + bool whiteOnBlackMode; + bool autoZonesFound; + bool whiteOnBlackAutoDetected; + }; +} + + +#endif //SCANTAILOR_OUTPUTPROCESSINGPARAMS_H