digiKam
autolevelsfilter.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-24-01
7  * Description : auto levels image filter.
8  *
9  * Copyright (C) 2005-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_AUTO_LEVELS_FILTER_H
25 #define DIGIKAM_AUTO_LEVELS_FILTER_H
26 
27 // Local includes
28 
29 #include "digikam_export.h"
30 #include "dimgthreadedfilter.h"
31 #include "digikam_globals.h"
32 
33 namespace Digikam
34 {
35 
36 class DImg;
37 
38 class DIGIKAM_EXPORT AutoLevelsFilter : public DImgThreadedFilter
39 {
40  Q_OBJECT
41 
42 public:
43 
44  explicit AutoLevelsFilter(QObject* const parent = nullptr);
45  AutoLevelsFilter(DImg* const orgImage,
46  const DImg* const refImage,
47  QObject* const parent = nullptr);
48  ~AutoLevelsFilter() override;
49 
50  static QString FilterIdentifier()
51  {
52  return QLatin1String("digikam:AutoLevelsFilter");
53  }
54 
56  {
57  return QList<int>() << 1;
58  }
59 
60  static int CurrentVersion()
61  {
62  return 1;
63  }
64 
65  static QString DisplayableName();
66 
67  QString filterIdentifier() const override
68  {
69  return FilterIdentifier();
70  }
71 
72  FilterAction filterAction() override;
73 
74  void readParameters(const FilterAction& action) override;
75 
76 private:
77 
78  void filterImage() override;
79  void autoLevelsCorrectionImage();
80 
81 private:
82 
83  DImg m_refImage;
84 };
85 
86 } // namespace Digikam
87 
88 #endif // DIGIKAM_AUTO_LEVELS_FILTER_H
Definition: autolevelsfilter.h:39
QString filterIdentifier() const override
Definition: autolevelsfilter.h:67
static int CurrentVersion()
Definition: autolevelsfilter.h:60
static QString FilterIdentifier()
Definition: autolevelsfilter.h:50
static QList< int > SupportedVersions()
Definition: autolevelsfilter.h:55
Definition: dimgthreadedfilter.h:41
Definition: dimg.h:62
Definition: filteraction.h:43
Definition: datefolderview.cpp:43