-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
#include "BlackWhiteOptions.h" | ||
#include "OutputProcessingParams.h" | ||
#include <QDomDocument> | ||
|
||
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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |