digiKam
Loading...
Searching...
No Matches
levelsfilter.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 : Levels image filter
8 *
9 * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2010 by Martin Klapetek <martin dot klapetek at gmail dot com>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18// Local includes
19
20#include "digikam_export.h"
21#include "dimgthreadedfilter.h"
22#include "digikam_globals.h"
23
24namespace Digikam
25{
26
27class DImg;
28
29class DIGIKAM_EXPORT LevelsContainer
30{
31
32public:
33
34 LevelsContainer() = default;
35 ~LevelsContainer() = default;
36
37public:
38
39 int lInput[5] = { 0 };
40 int hInput[5] = { 65535 };
41 int lOutput[5] = { 0 };
42 int hOutput[5] = { 65535 };
43
44 double gamma[5] = { 1.0 };
45};
46
47// --------------------------------------------------------------------------------
48
49class DIGIKAM_EXPORT LevelsFilter : public DImgThreadedFilter
50{
51 Q_OBJECT
52
53public:
54
55 explicit LevelsFilter(QObject* const parent = nullptr);
56 explicit LevelsFilter(DImg* const orgImage,
57 QObject* const parent = nullptr,
58 const LevelsContainer& settings = LevelsContainer());
59 explicit LevelsFilter(const LevelsContainer& settings,
60 DImgThreadedFilter* const master,
61 const DImg& orgImage,
62 DImg& destImage,
63 int progressBegin = 0,
64 int progressEnd = 100);
65 ~LevelsFilter() override;
66
67 static QString FilterIdentifier()
68 {
69 return QLatin1String("digikam:LevelsFilter");
70 }
71
72 static QString DisplayableName();
73
74 static QList<int> SupportedVersions()
75 {
76 return QList<int>() << 1;
77 }
78
79 static int CurrentVersion()
80 {
81 return 1;
82 }
83
84 QString filterIdentifier() const override
85 {
86 return FilterIdentifier();
87 }
88
89 FilterAction filterAction() override;
90 void readParameters(const FilterAction& action) override;
91
92private:
93
94 void filterImage() override;
95
96private:
97
98 LevelsContainer m_settings;
99};
100
101} // namespace Digikam
Definition dimgthreadedfilter.h:31
Definition dimg.h:52
Definition filteraction.h:33
Definition levelsfilter.h:30
Definition levelsfilter.h:50
static int CurrentVersion()
Definition levelsfilter.h:79
static QString FilterIdentifier()
Definition levelsfilter.h:67
QString filterIdentifier() const override
Definition levelsfilter.h:84
static QList< int > SupportedVersions()
Definition levelsfilter.h:74
Definition datefolderview.cpp:34