digiKam
curvesfilter.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 : 2010-25-02
7  * Description : Curves image filter
8  *
9  * Copyright (C) 2010-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_CURVES_FILTER_H
26 #define DIGIKAM_CURVES_FILTER_H
27 
28 // Qt includes
29 
30 #include <QPolygon>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 #include "dimgthreadedfilter.h"
36 #include "digikam_globals.h"
37 #include "imagecurves.h"
38 
39 namespace Digikam
40 {
41 
42 class DImg;
43 
44 class DIGIKAM_EXPORT CurvesFilter : public DImgThreadedFilter
45 {
46  Q_OBJECT
47 
48 public:
49 
50  explicit CurvesFilter(QObject* const parent = nullptr);
51  explicit CurvesFilter(DImg* const orgImage,
52  QObject* const parent = nullptr,
53  const CurvesContainer& settings = CurvesContainer());
54  explicit CurvesFilter(const CurvesContainer& settings,
55  DImgThreadedFilter* const master,
56  const DImg& orgImage,
57  DImg& destImage,
58  int progressBegin = 0,
59  int progressEnd = 100);
60  ~CurvesFilter() override;
61 
62  static QString FilterIdentifier()
63  {
64  return QLatin1String("digikam:CurvesFilter");
65  }
66 
67  static QString DisplayableName();
68 
70  {
71  return QList<int>() << 1;
72  }
73 
74  static int CurrentVersion()
75  {
76  return 1;
77  }
78 
79  QString filterIdentifier() const override
80  {
81  return FilterIdentifier();
82  }
83 
84  FilterAction filterAction() override;
85  void readParameters(const FilterAction& action) override;
86 
87 private:
88 
89  void filterImage() override;
90 
91 private:
92 
93  CurvesContainer m_settings;
94 };
95 
96 } // namespace Digikam
97 
98 #endif // DIGIKAM_CURVES_FILTER_H
Definition: curvescontainer.h:44
Definition: curvesfilter.h:45
static QString FilterIdentifier()
Definition: curvesfilter.h:62
static QList< int > SupportedVersions()
Definition: curvesfilter.h:69
QString filterIdentifier() const override
Definition: curvesfilter.h:79
static int CurrentVersion()
Definition: curvesfilter.h:74
Definition: dimgthreadedfilter.h:41
Definition: dimg.h:62
Definition: filteraction.h:43
Definition: datefolderview.cpp:43