Krita Source Code Documentation
Loading...
Searching...
No Matches
KisEffectiveCompositeOpResourceConverter Class Reference

#include <kis_derived_resources.h>

+ Inheritance diagram for KisEffectiveCompositeOpResourceConverter:

Public Member Functions

QVariant fromSource (const QVariant &value) override
 
 KisEffectiveCompositeOpResourceConverter ()
 
QVariant toSource (const QVariant &value, const QVariant &sourceValue) override
 
- Public Member Functions inherited from KoDerivedResourceConverter
int key () const
 
 KoDerivedResourceConverter (int key, int sourceKey)
 
virtual bool notifySourceChanged (const QVariant &sourceValue)
 
QVariant readFromSource (const QVariant &value)
 
int sourceKey () const
 
QVariant writeToSource (const QVariant &value, const QVariant &sourceValue, bool *changed)
 
virtual ~KoDerivedResourceConverter ()
 

Additional Inherited Members

Detailed Description

Definition at line 40 of file kis_derived_resources.h.

Constructor & Destructor Documentation

◆ KisEffectiveCompositeOpResourceConverter()

KisEffectiveCompositeOpResourceConverter::KisEffectiveCompositeOpResourceConverter ( )

Member Function Documentation

◆ fromSource()

QVariant KisEffectiveCompositeOpResourceConverter::fromSource ( const QVariant & value)
overridevirtual

Converts the value of the source resource into the space of the "derived" resource. E.g. preset -> opacity.

Implements KoDerivedResourceConverter.

Definition at line 109 of file kis_derived_resources.cpp.

110{
112 return preset ? preset->settings()->effectivePaintOpCompositeOp() : QVariant();
113}
float value(const T *src, size_t ch)

References value().

◆ toSource()

QVariant KisEffectiveCompositeOpResourceConverter::toSource ( const QVariant & value,
const QVariant & sourceValue )
overridevirtual

Converts the value of the "derived" resource into the space of the original ("source") resource. E.g. opacity -> preset.

Implements KoDerivedResourceConverter.

Definition at line 115 of file kis_derived_resources.cpp.

116{
117 Q_UNUSED(value);
118
119 // WARNING: we don't save that!
120 KisPaintOpPresetSP preset = sourceValue.value<KisPaintOpPresetSP>();
121 if (!preset) return sourceValue;
122
123 return QVariant::fromValue(preset);
124}

References value().


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