digiKam
unsharpmaskfilter.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-17-07
7  * Description : A Unsharp Mask threaded image filter.
8  *
9  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009 by Matthias Welwarsky <matze at welwarsky dot de>
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_UNSHARP_MASK_FILTER_H
27 #define DIGIKAM_UNSHARP_MASK_FILTER_H
28 
29 // Local includes
30 
31 #include "digikam_export.h"
32 #include "dimgthreadedfilter.h"
33 #include "digikam_globals.h"
34 
35 namespace Digikam
36 {
37 
38 class DIGIKAM_EXPORT UnsharpMaskFilter : public DImgThreadedFilter
39 {
40  Q_OBJECT
41 
42 public:
43 
44  explicit UnsharpMaskFilter(QObject* const parent = nullptr);
45  explicit UnsharpMaskFilter(DImg* const orgImage,
46  QObject* const parent = nullptr,
47  double radius = 1.0,
48  double amount = 1.0,
49  double threshold = 0.05,
50  bool luma=false);
51 
52  ~UnsharpMaskFilter() override;
53 
54  static QString FilterIdentifier()
55  {
56  return QLatin1String("digikam:UnsharpMaskFilter");
57  }
58 
59  static QString DisplayableName();
60 
62  {
63  return QList<int>() << 1;
64  }
65 
66  static int CurrentVersion()
67  {
68  return 1;
69  }
70 
71  QString filterIdentifier() const override
72  {
73  return FilterIdentifier();
74  }
75 
76  FilterAction filterAction() override;
77  void readParameters(const FilterAction& action) override;
78 
79 private:
80 
81  void filterImage() override;
82  void unsharpMaskMultithreaded(uint start, uint stop, uint y);
83 
84 private:
85 
86  double m_radius;
87  double m_amount;
88  double m_threshold;
89  bool m_luma;
90 };
91 
92 } // namespace Digikam
93 
94 #endif // DIGIKAM_UNSHARP_MASK_FILTER_H
Definition: dimgthreadedfilter.h:41
Definition: dimg.h:62
Definition: filteraction.h:43
Definition: unsharpmaskfilter.h:39
QString filterIdentifier() const override
Definition: unsharpmaskfilter.h:71
static QString FilterIdentifier()
Definition: unsharpmaskfilter.h:54
static int CurrentVersion()
Definition: unsharpmaskfilter.h:66
static QList< int > SupportedVersions()
Definition: unsharpmaskfilter.h:61
qreal luma(const QColor &color)
Definition: thememanager_p.cpp:90
Definition: datefolderview.cpp:43