digiKam
infraredfilter.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 : Infrared threaded image filter.
8  *
9  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx 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_INFRARED_FILTER_H
27 #define DIGIKAM_INFRARED_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 InfraredContainer
38 {
39 
40 public:
41 
42  explicit InfraredContainer()
43  : sensibility(200),
44  redGain (0.4),
45  greenGain (2.1),
46  blueGain (-0.8)
47  {
48  };
49 
51  {
52  };
53 
54 public:
55 
58 
59  double redGain;
60  double greenGain;
61  double blueGain;
62 };
63 
64 // ---------------------------------------------------------------------------
65 
66 class DIGIKAM_EXPORT InfraredFilter : public DImgThreadedFilter
67 {
68  Q_OBJECT
69 
70 public:
71 
72  explicit InfraredFilter(QObject* const parent = nullptr);
73  explicit InfraredFilter(DImg* const orgImage,
74  QObject* const parent = nullptr,
75  const InfraredContainer& settings = InfraredContainer());
76  ~InfraredFilter() override;
77 
78  static QString FilterIdentifier()
79  {
80  return QLatin1String("digikam:InfraredFilter");
81  }
82 
83  static QString DisplayableName();
84 
86  {
87  return QList<int>() << 1;
88  }
89 
90  static int CurrentVersion()
91  {
92  return 1;
93  }
94 
95  QString filterIdentifier() const override
96  {
97  return FilterIdentifier();
98  }
99 
100  FilterAction filterAction() override;
101  void readParameters(const FilterAction& action) override;
102 
103 private:
104 
105  void filterImage() override;
106 
107  inline int intMult8(uint a, uint b);
108  inline int intMult16(uint a, uint b);
109 
110 private:
111 
112  InfraredContainer m_settings;
113 };
114 
115 } // namespace Digikam
116 
117 #endif // DIGIKAM_INFRARED_FILTER_H
Definition: dimgthreadedfilter.h:41
Definition: dimg.h:62
Definition: filteraction.h:43
Definition: infraredfilter.h:38
~InfraredContainer()
Definition: infraredfilter.h:50
double blueGain
Definition: infraredfilter.h:61
int sensibility
Sensibility: 200..2600 ISO.
Definition: infraredfilter.h:52
double redGain
Definition: infraredfilter.h:59
double greenGain
Definition: infraredfilter.h:60
InfraredContainer()
Definition: infraredfilter.h:42
Definition: infraredfilter.h:67
static QString FilterIdentifier()
Definition: infraredfilter.h:78
QString filterIdentifier() const override
Definition: infraredfilter.h:95
static int CurrentVersion()
Definition: infraredfilter.h:90
static QList< int > SupportedVersions()
Definition: infraredfilter.h:85
Definition: datefolderview.cpp:43