Skip to content

Commit

Permalink
~ added missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
4lex4 committed Dec 2, 2017
1 parent 1215522 commit 3d3d1e9
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
63 changes: 63 additions & 0 deletions filters/output/OutputProcessingParams.cpp
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;
}

}
42 changes: 42 additions & 0 deletions filters/output/OutputProcessingParams.h
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

0 comments on commit 3d3d1e9

Please sign in to comment.