digiKam
invertfilter.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-17-07
7  * Description : An invert image threaded 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_INVERT_FILTER_H
26 #define DIGIKAM_INVERT_FILTER_H
27 
28 // Local includes
29 
30 #include "digikam_export.h"
31 #include "dimgthreadedfilter.h"
32 
33 namespace Digikam
34 {
35 
36 class DIGIKAM_EXPORT InvertFilter : public DImgThreadedFilter
37 {
38  Q_OBJECT
39 
40 public:
41 
42  explicit InvertFilter(QObject* const parent = nullptr);
43  explicit InvertFilter(DImg* const orgImage, QObject* const parent = nullptr);
44 
45  // Constructor for slave mode: execute immediately in current thread with specified master filter
46  explicit InvertFilter(DImgThreadedFilter* const parentFilter, const DImg& orgImage, DImg& destImage,
47  int progressBegin=0, int progressEnd=100);
48 
49  ~InvertFilter() override;
50 
51 
52 
53  static QString FilterIdentifier()
54  {
55  return QLatin1String("digikam:InvertFilter");
56  }
57 
58  static QString DisplayableName();
59 
61  {
62  return QList<int>() << 1;
63  }
64 
65  static int CurrentVersion()
66  {
67  return 1;
68  }
69 
70  void readParameters(const FilterAction& action) override;
71 
72  QString filterIdentifier() const override
73  {
74  return FilterIdentifier();
75  }
76 
77  FilterAction filterAction() override;
78 
79 private:
80 
81  void filterImage() override;
82 };
83 
84 } // namespace Digikam
85 
86 #endif // DIGIKAM_INVERT_FILTER_H
Definition: dimgthreadedfilter.h:41
Definition: dimg.h:62
Definition: filteraction.h:43
Definition: invertfilter.h:37
QString filterIdentifier() const override
Definition: invertfilter.h:72
static QList< int > SupportedVersions()
Definition: invertfilter.h:60
static int CurrentVersion()
Definition: invertfilter.h:65
static QString FilterIdentifier()
Definition: invertfilter.h:53
Definition: datefolderview.cpp:43