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

#include <kis_derived_resources.h>

+ Inheritance diagram for KisLodAvailabilityResourceConverter:

Public Member Functions

QVariant fromSource (const QVariant &value) override
 
 KisLodAvailabilityResourceConverter ()
 
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 112 of file kis_derived_resources.h.

Constructor & Destructor Documentation

◆ KisLodAvailabilityResourceConverter()

KisLodAvailabilityResourceConverter::KisLodAvailabilityResourceConverter ( )

Member Function Documentation

◆ fromSource()

QVariant KisLodAvailabilityResourceConverter::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 314 of file kis_derived_resources.cpp.

315{
317 return preset ? KisPaintOpSettings::isLodUserAllowed(preset->settings()) : QVariant();
318}
float value(const T *src, size_t ch)
static bool isLodUserAllowed(const KisPropertiesConfigurationSP config)

References KisPaintOpSettings::isLodUserAllowed(), and value().

◆ toSource()

QVariant KisLodAvailabilityResourceConverter::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 320 of file kis_derived_resources.cpp.

321{
322 KisPaintOpPresetSP preset = sourceValue.value<KisPaintOpPresetSP>();
323 if (!preset) return sourceValue;
324
325 KisPaintOpSettings::setLodUserAllowed(preset->settings().data(), value.toBool());
326 return QVariant::fromValue(preset);
327}
static void setLodUserAllowed(KisPropertiesConfigurationSP config, bool value)

References KisPaintOpSettings::setLodUserAllowed(), and value().


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