forked from 4lex4/scantailor-advanced
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefaultParams.h
252 lines (162 loc) · 6.8 KB
/
DefaultParams.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
#ifndef SCANTAILOR_DEFAULTPARAMSPROFILE_H
#define SCANTAILOR_DEFAULTPARAMSPROFILE_H
#include <filters/output/ColorParams.h>
#include <filters/output/DepthPerception.h>
#include <filters/output/DespeckleLevel.h>
#include <filters/output/DewarpingOptions.h>
#include <filters/output/PictureShapeOptions.h>
#include <filters/page_layout/Alignment.h>
#include <filters/page_split/LayoutType.h>
#include <QtCore/QRectF>
#include "AutoManualMode.h"
#include "Dpi.h"
#include "Margins.h"
#include "OrthogonalRotation.h"
#include "Units.h"
class DefaultParams {
public:
class FixOrientationParams {
public:
FixOrientationParams() = default;
explicit FixOrientationParams(const OrthogonalRotation& imageRotation);
explicit FixOrientationParams(const QDomElement& el);
QDomElement toXml(QDomDocument& doc, const QString& name) const;
const OrthogonalRotation& getImageRotation() const;
void setImageRotation(const OrthogonalRotation& imageRotation);
private:
OrthogonalRotation m_imageRotation;
};
class DeskewParams {
public:
DeskewParams();
explicit DeskewParams(double deskewAngleDeg, AutoManualMode mode);
explicit DeskewParams(const QDomElement& el);
QDomElement toXml(QDomDocument& doc, const QString& name) const;
double getDeskewAngleDeg() const;
void setDeskewAngleDeg(double deskewAngleDeg);
AutoManualMode getMode() const;
void setMode(AutoManualMode mode);
private:
double m_deskewAngleDeg;
AutoManualMode m_mode;
};
class PageSplitParams {
public:
PageSplitParams();
explicit PageSplitParams(page_split::LayoutType layoutType);
explicit PageSplitParams(const QDomElement& el);
QDomElement toXml(QDomDocument& doc, const QString& name) const;
page_split::LayoutType getLayoutType() const;
void setLayoutType(page_split::LayoutType layoutType);
private:
page_split::LayoutType m_layoutType;
};
class SelectContentParams {
public:
SelectContentParams();
SelectContentParams(const QSizeF& pageRectSize,
bool contentDetectEnabled,
AutoManualMode pageDetectMode,
bool fineTuneCorners);
explicit SelectContentParams(const QDomElement& el);
QDomElement toXml(QDomDocument& doc, const QString& name) const;
const QSizeF& getPageRectSize() const;
void setPageRectSize(const QSizeF& pageRectSize);
bool isContentDetectEnabled() const;
void setContentDetectEnabled(bool contentDetectEnabled);
bool isFineTuneCorners() const;
void setFineTuneCorners(bool fineTuneCorners);
AutoManualMode getPageDetectMode() const;
void setPageDetectMode(AutoManualMode pageDetectMode);
private:
QSizeF m_pageRectSize;
bool m_contentDetectEnabled;
AutoManualMode m_pageDetectMode;
bool m_fineTuneCorners;
};
class PageLayoutParams {
public:
PageLayoutParams();
PageLayoutParams(const Margins& hardMargins, const page_layout::Alignment& alignment, bool autoMargins);
explicit PageLayoutParams(const QDomElement& el);
QDomElement toXml(QDomDocument& doc, const QString& name) const;
const Margins& getHardMargins() const;
void setHardMargins(const Margins& hardMargins);
const page_layout::Alignment& getAlignment() const;
void setAlignment(const page_layout::Alignment& alignment);
bool isAutoMargins() const;
void setAutoMargins(bool autoMargins);
private:
Margins m_hardMargins;
page_layout::Alignment m_alignment;
bool m_autoMargins;
};
class OutputParams {
public:
OutputParams();
OutputParams(const Dpi& dpi,
const output::ColorParams& colorParams,
const output::SplittingOptions& splittingOptions,
const output::PictureShapeOptions& pictureShapeOptions,
const output::DepthPerception& depthPerception,
const output::DewarpingOptions& dewarpingOptions,
double despeckleLevel);
explicit OutputParams(const QDomElement& el);
QDomElement toXml(QDomDocument& doc, const QString& name) const;
const Dpi& getDpi() const;
void setDpi(const Dpi& dpi);
const output::ColorParams& getColorParams() const;
void setColorParams(const output::ColorParams& colorParams);
const output::SplittingOptions& getSplittingOptions() const;
void setSplittingOptions(const output::SplittingOptions& splittingOptions);
const output::PictureShapeOptions& getPictureShapeOptions() const;
void setPictureShapeOptions(const output::PictureShapeOptions& pictureShapeOptions);
const output::DepthPerception& getDepthPerception() const;
void setDepthPerception(const output::DepthPerception& depthPerception);
const output::DewarpingOptions& getDewarpingOptions() const;
void setDewarpingOptions(const output::DewarpingOptions& dewarpingOptions);
double getDespeckleLevel() const;
void setDespeckleLevel(double despeckleLevel);
private:
Dpi m_dpi;
output::ColorParams m_colorParams;
output::SplittingOptions m_splittingOptions;
output::PictureShapeOptions m_pictureShapeOptions;
output::DepthPerception m_depthPerception;
output::DewarpingOptions m_dewarpingOptions;
double m_despeckleLevel;
};
public:
DefaultParams();
DefaultParams(const FixOrientationParams& fixOrientationParams,
const DeskewParams& deskewParams,
const PageSplitParams& pageSplitParams,
const SelectContentParams& selectContentParams,
const PageLayoutParams& pageLayoutParams,
const OutputParams& outputParams);
explicit DefaultParams(const QDomElement& el);
QDomElement toXml(QDomDocument& doc, const QString& name) const;
const FixOrientationParams& getFixOrientationParams() const;
void setFixOrientationParams(const FixOrientationParams& fixOrientationParams);
const DeskewParams& getDeskewParams() const;
void setDeskewParams(const DeskewParams& deskewParams);
const PageSplitParams& getPageSplitParams() const;
void setPageSplitParams(const PageSplitParams& pageSplitParams);
const SelectContentParams& getSelectContentParams() const;
void setSelectContentParams(const SelectContentParams& selectContentParams);
const PageLayoutParams& getPageLayoutParams() const;
void setPageLayoutParams(const PageLayoutParams& pageLayoutParams);
const OutputParams& getOutputParams() const;
void setOutputParams(const OutputParams& outputParams);
Units getUnits() const;
void setUnits(Units units);
private:
FixOrientationParams m_fixOrientationParams;
DeskewParams m_deskewParams;
PageSplitParams m_pageSplitParams;
SelectContentParams m_selectContentParams;
PageLayoutParams m_pageLayoutParams;
OutputParams m_outputParams;
Units m_units;
};
#endif // SCANTAILOR_DEFAULTPARAMSPROFILE_H