digiKam
tonalityfilter.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 : Change tonality image filter
8  *
9  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2010 by Martin Klapetek <martin dot klapetek at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_TONALITY_FILTER_H
26 #define DIGIKAM_TONALITY_FILTER_H
27 
28 // Local includes
29 
30 #include "digikam_export.h"
31 #include "dimgthreadedfilter.h"
32 #include "digikam_globals.h"
33 
34 namespace Digikam
35 {
36 
37 class DImg;
38 
39 class DIGIKAM_EXPORT TonalityContainer
40 {
41 
42 public:
43 
44  explicit TonalityContainer()
45  : redMask (0),
46  greenMask(0),
47  blueMask (0)
48  {
49  };
50 
52  {
53  };
54 
55 public:
56 
57  int redMask;
58  int greenMask;
59  int blueMask;
60 };
61 
62 // -----------------------------------------------------------------------------------------------
63 
64 class DIGIKAM_EXPORT TonalityFilter : public DImgThreadedFilter
65 {
66  Q_OBJECT
67 
68 public:
69 
70  explicit TonalityFilter(QObject* const parent = nullptr);
71  explicit TonalityFilter(DImg* const orgImage,
72  QObject* const parent = nullptr,
73  const TonalityContainer& settings = TonalityContainer());
74  ~TonalityFilter() override;
75 
76  static QString FilterIdentifier()
77  {
78  return QLatin1String("digikam:TonalityFilter");
79  }
80 
81  static QString DisplayableName();
82 
84  {
85  return QList<int>() << 1;
86  }
87 
88  static int CurrentVersion()
89  {
90  return 1;
91  }
92 
93  QString filterIdentifier() const override
94  {
95  return FilterIdentifier();
96  }
97 
98  FilterAction filterAction() override;
99  void readParameters(const FilterAction& action) override;
100 
101 private:
102 
103  void filterImage() override;
104 
105 private:
106 
107  TonalityContainer m_settings;
108 };
109 
110 } // namespace Digikam
111 
112 #endif // DIGIKAM_TONALITY_FILTER_H
Definition: dimgthreadedfilter.h:41
Definition: dimg.h:62
Definition: filteraction.h:43
Definition: tonalityfilter.h:40
int blueMask
Definition: tonalityfilter.h:59
~TonalityContainer()
Definition: tonalityfilter.h:51
int greenMask
Definition: tonalityfilter.h:58
TonalityContainer()
Definition: tonalityfilter.h:44
int redMask
Definition: tonalityfilter.h:53
Definition: tonalityfilter.h:65
static int CurrentVersion()
Definition: tonalityfilter.h:88
static QString FilterIdentifier()
Definition: tonalityfilter.h:76
QString filterIdentifier() const override
Definition: tonalityfilter.h:93
static QList< int > SupportedVersions()
Definition: tonalityfilter.h:83
Definition: datefolderview.cpp:43