Krita Source Code Documentation
Loading...
Searching...
No Matches
KisCurveOptionDataCommon Struct Reference

#include <KisCurveOptionDataCommon.h>

+ Inheritance diagram for KisCurveOptionDataCommon:

Public Types

using ValueFixUpReadCallback = std::function<void (KisCurveOptionDataCommon *, const KisPropertiesConfiguration *)>
 
using ValueFixUpWriteCallback = std::function<void (qreal, KisPropertiesConfiguration *)>
 

Public Member Functions

 KisCurveOptionDataCommon (const KoID &id, bool isCheckable, bool isChecked, qreal minValue, qreal maxValue, KisSensorPackInterface *sensorInterface)
 
 KisCurveOptionDataCommon (const QString &prefix, const KoID &id, bool isCheckable, bool isChecked, qreal minValue, qreal maxValue, KisSensorPackInterface *sensorInterface)
 
bool read (const KisPropertiesConfiguration *setting)
 
std::vector< KisSensorData * > sensors ()
 
std::vector< const KisSensorData * > sensors () const
 
void write (KisPropertiesConfiguration *setting) const
 

Public Attributes

QString commonCurve = DEFAULT_CURVE_STRING
 
int curveMode = 0
 
KoID id
 
bool isCheckable = true
 
bool isChecked = true
 
QString prefix
 
QSharedDataPointer< KisSensorPackInterfacesensorData
 
qreal strengthMaxValue = 1.0
 
qreal strengthMinValue = 0.0
 
qreal strengthValue = 1.0
 
bool useCurve = true
 
bool useSameCurve = true
 
ValueFixUpReadCallback valueFixUpReadCallback
 
ValueFixUpWriteCallback valueFixUpWriteCallback
 

Static Public Attributes

static constexpr bool supports_prefix = true
 

Private Member Functions

bool readPrefixed (const KisPropertiesConfiguration *setting)
 
void writePrefixed (KisPropertiesConfiguration *setting) const
 

Friends

bool operator== (const KisCurveOptionDataCommon &lhs, const KisCurveOptionDataCommon &rhs)
 

Detailed Description

Definition at line 19 of file KisCurveOptionDataCommon.h.

Member Typedef Documentation

◆ ValueFixUpReadCallback

◆ ValueFixUpWriteCallback

Constructor & Destructor Documentation

◆ KisCurveOptionDataCommon() [1/2]

KisCurveOptionDataCommon::KisCurveOptionDataCommon ( const QString & prefix,
const KoID & id,
bool isCheckable,
bool isChecked,
qreal minValue,
qreal maxValue,
KisSensorPackInterface * sensorInterface )

Definition at line 9 of file KisCurveOptionDataCommon.cpp.

10 : id(_id),
11 prefix(_prefix),
12 isCheckable(_isCheckable),
13 strengthMinValue(_minValue),
14 strengthMaxValue(_maxValue),
15 isChecked(_isChecked),
16 strengthValue(_maxValue),
17 sensorData(sensorInterface)
18{
19}
QSharedDataPointer< KisSensorPackInterface > sensorData

◆ KisCurveOptionDataCommon() [2/2]

KisCurveOptionDataCommon::KisCurveOptionDataCommon ( const KoID & id,
bool isCheckable,
bool isChecked,
qreal minValue,
qreal maxValue,
KisSensorPackInterface * sensorInterface )

Definition at line 21 of file KisCurveOptionDataCommon.cpp.

22 : KisCurveOptionDataCommon("", _id, _isCheckable, _isChecked, _minValue, _maxValue, sensorInterface)
23{
24}
KisCurveOptionDataCommon(const QString &prefix, const KoID &id, bool isCheckable, bool isChecked, qreal minValue, qreal maxValue, KisSensorPackInterface *sensorInterface)

Member Function Documentation

◆ read()

bool KisCurveOptionDataCommon::read ( const KisPropertiesConfiguration * setting)

Definition at line 37 of file KisCurveOptionDataCommon.cpp.

38{
39 if (!setting) return false;
40
41 if (prefix.isEmpty()) {
42 return readPrefixed(setting);
43 } else {
44 KisPropertiesConfiguration prefixedSetting;
45 setting->getPrefixedProperties(prefix, &prefixedSetting);
46 return readPrefixed(&prefixedSetting);
47 }
48}
bool readPrefixed(const KisPropertiesConfiguration *setting)
void getPrefixedProperties(const QString &prefix, KisPropertiesConfiguration *config) const

References KisPropertiesConfiguration::getPrefixedProperties(), prefix, and readPrefixed().

◆ readPrefixed()

bool KisCurveOptionDataCommon::readPrefixed ( const KisPropertiesConfiguration * setting)
private

Definition at line 61 of file KisCurveOptionDataCommon.cpp.

62{
63 return sensorData->read(*this, setting);
64}

References sensorData.

◆ sensors() [1/2]

std::vector< KisSensorData * > KisCurveOptionDataCommon::sensors ( )

Definition at line 32 of file KisCurveOptionDataCommon.cpp.

33{
34 return sensorData->sensors();
35}

References sensorData, and sensors().

◆ sensors() [2/2]

std::vector< const KisSensorData * > KisCurveOptionDataCommon::sensors ( ) const

Definition at line 27 of file KisCurveOptionDataCommon.cpp.

28{
29 return sensorData->constSensors();
30}

References sensorData.

◆ write()

void KisCurveOptionDataCommon::write ( KisPropertiesConfiguration * setting) const

Definition at line 50 of file KisCurveOptionDataCommon.cpp.

51{
52 if (prefix.isEmpty()) {
53 writePrefixed(setting);
54 } else {
55 KisPropertiesConfiguration prefixedSetting;
56 writePrefixed(&prefixedSetting);
57 setting->setPrefixedProperties(prefix, &prefixedSetting);
58 }
59}
void writePrefixed(KisPropertiesConfiguration *setting) const
void setPrefixedProperties(const QString &prefix, const KisPropertiesConfiguration *config)

References prefix, KisPropertiesConfiguration::setPrefixedProperties(), and writePrefixed().

◆ writePrefixed()

void KisCurveOptionDataCommon::writePrefixed ( KisPropertiesConfiguration * setting) const
private

Definition at line 66 of file KisCurveOptionDataCommon.cpp.

67{
68 sensorData->write(*this, setting);
69}

References sensorData.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const KisCurveOptionDataCommon & lhs,
const KisCurveOptionDataCommon & rhs )
friend

Definition at line 38 of file KisCurveOptionDataCommon.h.

38 {
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 }

Member Data Documentation

◆ commonCurve

QString KisCurveOptionDataCommon::commonCurve = DEFAULT_CURVE_STRING

Definition at line 64 of file KisCurveOptionDataCommon.h.

◆ curveMode

int KisCurveOptionDataCommon::curveMode = 0

Definition at line 63 of file KisCurveOptionDataCommon.h.

◆ id

KoID KisCurveOptionDataCommon::id

Definition at line 53 of file KisCurveOptionDataCommon.h.

◆ isCheckable

bool KisCurveOptionDataCommon::isCheckable = true

Definition at line 55 of file KisCurveOptionDataCommon.h.

◆ isChecked

bool KisCurveOptionDataCommon::isChecked = true

Definition at line 59 of file KisCurveOptionDataCommon.h.

◆ prefix

QString KisCurveOptionDataCommon::prefix

Definition at line 54 of file KisCurveOptionDataCommon.h.

◆ sensorData

QSharedDataPointer<KisSensorPackInterface> KisCurveOptionDataCommon::sensorData

Definition at line 67 of file KisCurveOptionDataCommon.h.

◆ strengthMaxValue

qreal KisCurveOptionDataCommon::strengthMaxValue = 1.0

Definition at line 57 of file KisCurveOptionDataCommon.h.

◆ strengthMinValue

qreal KisCurveOptionDataCommon::strengthMinValue = 0.0

Definition at line 56 of file KisCurveOptionDataCommon.h.

◆ strengthValue

qreal KisCurveOptionDataCommon::strengthValue = 1.0

Definition at line 65 of file KisCurveOptionDataCommon.h.

◆ supports_prefix

constexpr bool KisCurveOptionDataCommon::supports_prefix = true
staticconstexpr

Definition at line 21 of file KisCurveOptionDataCommon.h.

◆ useCurve

bool KisCurveOptionDataCommon::useCurve = true

Definition at line 60 of file KisCurveOptionDataCommon.h.

◆ useSameCurve

bool KisCurveOptionDataCommon::useSameCurve = true

Definition at line 61 of file KisCurveOptionDataCommon.h.

◆ valueFixUpReadCallback

ValueFixUpReadCallback KisCurveOptionDataCommon::valueFixUpReadCallback

Definition at line 76 of file KisCurveOptionDataCommon.h.

◆ valueFixUpWriteCallback

ValueFixUpWriteCallback KisCurveOptionDataCommon::valueFixUpWriteCallback

Definition at line 79 of file KisCurveOptionDataCommon.h.


The documentation for this struct was generated from the following files: