Krita Source Code Documentation
Loading...
Searching...
No Matches
KisScreentoneBrightnessContrastFunctions.h
Go to the documentation of this file.
1/*
2 * KDE. Krita Project.
3 *
4 * SPDX-FileCopyrightText: 2020 Deif Lou <ginoba@gmail.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KISSCREENTONEBRIGHTNESCONTRASTFUNCTIONS_H
10#define KISSCREENTONEBRIGHTNESCONTRASTFUNCTIONS_H
11
12#include <QtGlobal>
13
15
17{
18public:
19 inline qreal operator()(qreal x) const
20 {
21 return x;
22 }
23};
24
26{
27public:
28 // brightness and contrast expected to be in the range [-1, 1]
29 BrightnessContrast(qreal brightness, qreal contrast);
30 qreal operator()(qreal x) const;
31private:
32 qreal m_m, m_b;
33};
34
36{
37public:
38 // threshold value expected to be in the range [0, 1]
39 Threshold(qreal threshold);
40 qreal operator()(qreal x) const;
41private:
42 const qreal m_threshold;
43 const bool m_thresholdIsOne;
44};
45
46}
47
48#endif