digiKam
lensdistortionfilter.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 : lens distortion algorithm.
8  *
9  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2001-2003 by David Hodson <hodsond@acm.org>
11  * Copyright (C) 2010 by Martin Klapetek <martin dot klapetek at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_LENS_DISTORTION_FILTER_H
27 #define DIGIKAM_LENS_DISTORTION_FILTER_H
28 
29 // Local includes
30 
31 #include "dimgthreadedfilter.h"
32 #include "digikam_export.h"
33 
34 namespace Digikam
35 {
36 
37 class DIGIKAM_EXPORT LensDistortionFilter : public DImgThreadedFilter
38 {
39  Q_OBJECT
40 
41 public:
42 
43  explicit LensDistortionFilter(QObject* const parent = nullptr);
44  explicit LensDistortionFilter(DImg* const orgImage, QObject* const parent = nullptr, double main=0.0,
45  double edge=0.0, double rescale=0.0, double brighten=0.0,
46  int center_x=0, int center_y=0);
47 
48  ~LensDistortionFilter() override;
49 
50  static QString FilterIdentifier()
51  {
52  return QLatin1String("digikam:LensDistortionFilter");
53  }
54 
55  static QString DisplayableName();
56 
58  {
59  return QList<int>() << 1;
60  }
61 
62  static int CurrentVersion()
63  {
64  return 1;
65  }
66 
67  QString filterIdentifier() const override
68  {
69  return FilterIdentifier();
70  }
71 
72  FilterAction filterAction() override;
73  void readParameters(const FilterAction& action) override;
74 
75 private:
76 
77  void filterImage() override;
78 
79 private:
80 
81  int m_centre_x;
82  int m_centre_y;
83 
84  double m_main;
85  double m_edge;
86  double m_rescale;
87  double m_brighten;
88 };
89 
90 } // namespace Digikam
91 
92 #endif // DIGIKAM_LENS_DISTORTION_FILTER_H
int main(int argc, char *argv[])
Definition: main.cpp:98
Definition: dimgthreadedfilter.h:41
Definition: dimg.h:62
Definition: filteraction.h:43
Definition: lensdistortionfilter.h:38
static int CurrentVersion()
Definition: lensdistortionfilter.h:62
QString filterIdentifier() const override
Definition: lensdistortionfilter.h:67
static QString FilterIdentifier()
Definition: lensdistortionfilter.h:50
static QList< int > SupportedVersions()
Definition: lensdistortionfilter.h:57
Definition: datefolderview.cpp:43