digiKam
Loading...
Searching...
No Matches
antivignettingfilter.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 : 2005-05-25
7 * Description : Antivignetting threaded image filter.
8 *
9 * SPDX-FileCopyrightText: 2005-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2010 by Martin Klapetek <martin dot klapetek at gmail dot com>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18// Local includes
19
20#include "dimgthreadedfilter.h"
21#include "digikam_export.h"
22
23namespace Digikam
24{
25
26class DIGIKAM_EXPORT AntiVignettingContainer
27{
28
29public:
30
33
34public:
35
36 bool addvignetting = true;
37
38 double density = 2.0;
39 double power = 1.0;
40 double innerradius = 1.0;
41 double outerradius = 1.0;
42 double xshift = 0.0;
43 double yshift = 0.0;
44};
45
46// -----------------------------------------------------------------------------------------------
47
48class DIGIKAM_EXPORT AntiVignettingFilter : public DImgThreadedFilter
49{
50 Q_OBJECT
51
52public:
53
54 explicit AntiVignettingFilter(QObject* const parent = nullptr);
55 explicit AntiVignettingFilter(DImg* const orgImage, QObject* const parent = nullptr,
57
58 ~AntiVignettingFilter() override;
59
60 static QString FilterIdentifier()
61 {
62 return QLatin1String("digikam:AntiVignettingFilter");
63 }
64
65 static QString DisplayableName();
66
67 static QList<int> SupportedVersions()
68 {
69 return QList<int>() << 1;
70 }
71
72 static int CurrentVersion()
73 {
74 return 1;
75 }
76
77 void readParameters(const FilterAction& action) override;
78
79 QString filterIdentifier() const override
80 {
81 return FilterIdentifier();
82 }
83
84 FilterAction filterAction() override;
85
86private:
87
88 void filterImage() override;
89
90 double hypothenuse(double x, double y);
91 uchar clamp8bits(double x);
92 unsigned short clamp16bits(double x);
93 double attenuation(double r1, double r2, double distcenter);
94 double real_attenuation(double r1, double r2, double distcenter);
95
96private:
97
98 AntiVignettingContainer m_settings;
99};
100
101} // namespace Digikam
Definition antivignettingfilter.h:27
Definition antivignettingfilter.h:49
static QString FilterIdentifier()
Definition antivignettingfilter.h:60
static QList< int > SupportedVersions()
Definition antivignettingfilter.h:67
static int CurrentVersion()
Definition antivignettingfilter.h:72
QString filterIdentifier() const override
Definition antivignettingfilter.h:79
Definition dimgthreadedfilter.h:31
Definition dimg.h:52
Definition filteraction.h:33
Definition datefolderview.cpp:34