digiKam
sharpsettings.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2010-02-10
7  * Description : sharp settings view.
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_SHARP_SETTINGS_H
25 #define DIGIKAM_SHARP_SETTINGS_H
26 
27 // Local includes
28 
29 #include <QWidget>
30 
31 // Local includes
32 
33 #include "digikam_export.h"
34 
35 class KConfigGroup;
36 
37 namespace Digikam
38 {
39 
40 class DIGIKAM_EXPORT SharpContainer
41 {
42 
43 public:
44 
46  {
47  SimpleSharp = 0,
49  Refocus
50  };
51 
52 public:
53 
54  explicit SharpContainer()
55  : method(SimpleSharp),
56  ssRadius(0),
57  umRadius(1.0),
58  umAmount(1.0),
59  umThreshold(0.05),
60  umLumaOnly(false),
61  rfRadius(1.0),
62  rfCorrelation(0.5),
63  rfNoise(0.03),
64  rfGauss(0.0),
65  rfMatrix(5)
66  {
67  };
68 
70  {
71  };
72 
73 public:
74 
75  int method;
76 
78  int ssRadius;
79 
81  double umRadius;
82  double umAmount;
83  double umThreshold;
84  bool umLumaOnly;
85 
87  double rfRadius;
88  double rfCorrelation;
89  double rfNoise;
90  double rfGauss;
91  int rfMatrix;
92 };
93 
94 // -----------------------------------------------------------------------------------------------
95 
96 class DIGIKAM_EXPORT SharpSettings : public QWidget
97 {
98  Q_OBJECT
99 
100 public:
101 
102  explicit SharpSettings(QWidget* const parent);
103  ~SharpSettings() override;
104 
105  SharpContainer defaultSettings() const;
106  void resetToDefault();
107 
108  SharpContainer settings() const;
109  void setSettings(const SharpContainer& settings);
110 
111  void readSettings(KConfigGroup& group);
112  void writeSettings(KConfigGroup& group);
113 
114  void loadSettings();
115  void saveAsSettings();
116 
117 Q_SIGNALS:
118 
120 
121 private Q_SLOTS:
122 
123  void slotSharpMethodChanged(int);
124 
125 private:
126 
127  class Private;
128  Private* const d;
129 };
130 
131 } // namespace Digikam
132 
133 #endif // DIGIKAM_SHARP_SETTINGS_H
Definition: sharpsettings.h:41
double rfNoise
Definition: sharpsettings.h:89
double umThreshold
Definition: sharpsettings.h:83
SharpingMethods
Definition: sharpsettings.h:46
@ UnsharpMask
Definition: sharpsettings.h:48
double rfRadius
Refocus.
Definition: sharpsettings.h:87
int ssRadius
Simple sharp.
Definition: sharpsettings.h:78
double rfCorrelation
Definition: sharpsettings.h:88
int rfMatrix
Definition: sharpsettings.h:91
~SharpContainer()
Definition: sharpsettings.h:69
double umRadius
Unsharp mask.
Definition: sharpsettings.h:81
SharpContainer()
Definition: sharpsettings.h:54
bool umLumaOnly
Definition: sharpsettings.h:84
int method
Store SharpingMethods value.
Definition: sharpsettings.h:71
double rfGauss
Definition: sharpsettings.h:90
double umAmount
Definition: sharpsettings.h:82
Definition: sharpsettings.h:97
Definition: datefolderview.cpp:43