digiKam
normalizefilter.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 : normalize 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_NORMALIZE_FILTER_H
25 #define DIGIKAM_NORMALIZE_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 NormalizeFilter : public DImgThreadedFilter
39 {
40  Q_OBJECT
41 
42 public:
43 
44  explicit NormalizeFilter(QObject* const parent = nullptr);
45  NormalizeFilter(DImg* const orgImage, const DImg* const refImage, QObject* const parent = nullptr);
46  ~NormalizeFilter() override;
47 
48  static QString FilterIdentifier()
49  {
50  return QLatin1String("digikam:NormalizeFilter");
51  }
52 
54  {
55  return QList<int>() << 1;
56  }
57 
58  static int CurrentVersion()
59  {
60  return 1;
61  }
62 
63  static QString DisplayableName();
64 
65  QString filterIdentifier() const override
66  {
67  return FilterIdentifier();
68  }
69 
70  FilterAction filterAction() override;
71 
72  void readParameters(const FilterAction& action) override;
73 
74 private:
75 
76  void filterImage() override;
77  void normalizeImage();
78 
79 private:
80 
81  struct Q_DECL_HIDDEN NormalizeParam
82  {
83  unsigned short* lut;
84  double min;
85  double max;
86  };
87 
88  DImg m_refImage;
89 };
90 
91 } // namespace Digikam
92 
93 #endif // DIGIKAM_NORMALIZE_FILTER_H
Definition: dimgthreadedfilter.h:41
Definition: dimg.h:62
Definition: filteraction.h:43
Definition: normalizefilter.h:39
static int CurrentVersion()
Definition: normalizefilter.h:58
static QList< int > SupportedVersions()
Definition: normalizefilter.h:53
QString filterIdentifier() const override
Definition: normalizefilter.h:65
static QString FilterIdentifier()
Definition: normalizefilter.h:48
Definition: datefolderview.cpp:43