Krita Source Code Documentation
Loading...
Searching...
No Matches
KisCurveOptionDataCommon.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2022 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KISCURVEOPTIONDATACOMMON_H
7#define KISCURVEOPTIONDATACOMMON_H
8
9#include <boost/operators.hpp>
10
11#include "kis_assert.h"
12#include "kis_paintop_option.h"
13#include "KisDynamicSensorIds.h"
14#include "kritapaintop_export.h"
15
17
18
19struct PAINTOP_EXPORT KisCurveOptionDataCommon : boost::equality_comparable<KisCurveOptionDataCommon>
20{
21 static constexpr bool supports_prefix = true;
22
23 KisCurveOptionDataCommon(const QString &prefix,
24 const KoID &id,
25 bool isCheckable,
26 bool isChecked,
27 qreal minValue,
28 qreal maxValue,
29 KisSensorPackInterface *sensorInterface);
30
32 bool isCheckable,
33 bool isChecked,
34 qreal minValue,
35 qreal maxValue,
36 KisSensorPackInterface *sensorInterface);
37
38 inline friend bool operator==(const KisCurveOptionDataCommon &lhs, const KisCurveOptionDataCommon &rhs) {
39 return lhs.id == rhs.id &&
40 lhs.prefix == rhs.prefix &&
41 lhs.isCheckable == rhs.isCheckable &&
42 lhs.isChecked == rhs.isChecked &&
43 lhs.useCurve == rhs.useCurve &&
44 lhs.useSameCurve == rhs.useSameCurve &&
45 lhs.curveMode == rhs.curveMode &&
46 lhs.commonCurve == rhs.commonCurve &&
47 lhs.strengthValue == rhs.strengthValue &&
50 lhs.sensorData->compare(rhs.sensorData.constData());
51 }
52
54 QString prefix;
55 bool isCheckable = true;
56 qreal strengthMinValue = 0.0;
57 qreal strengthMaxValue = 1.0;
58
59 bool isChecked = true;
60 bool useCurve = true;
61 bool useSameCurve = true;
62
63 int curveMode = 0; // TODO: to enum!
64 QString commonCurve = DEFAULT_CURVE_STRING;
65 qreal strengthValue = 1.0;
66
67 QSharedDataPointer<KisSensorPackInterface> sensorData;
68
69 std::vector<const KisSensorData *> sensors() const;
70 std::vector<KisSensorData*> sensors();
71
72 bool read(const KisPropertiesConfiguration *setting);
73 void write(KisPropertiesConfiguration *setting) const;
74
77
80
81private:
82 bool readPrefixed(const KisPropertiesConfiguration *setting);
83 void writePrefixed(KisPropertiesConfiguration *setting) const;
84};
85
86#endif // KISCURVEOPTIONDATACOMMON_H
Definition KoID.h:30
const QString DEFAULT_CURVE_STRING
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)
QSharedDataPointer< KisSensorPackInterface > sensorData
friend bool operator==(const KisCurveOptionDataCommon &lhs, const KisCurveOptionDataCommon &rhs)
std::function< void(KisCurveOptionDataCommon *, const KisPropertiesConfiguration *)> ValueFixUpReadCallback
ValueFixUpReadCallback valueFixUpReadCallback
std::function< void(qreal, KisPropertiesConfiguration *)> ValueFixUpWriteCallback
ValueFixUpWriteCallback valueFixUpWriteCallback