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

#include <kis_derived_resources.h>

+ Inheritance diagram for KisBrushRotationResourceConverter:

Public Member Functions

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

Constructor & Destructor Documentation

◆ KisBrushRotationResourceConverter()

KisBrushRotationResourceConverter::KisBrushRotationResourceConverter ( )

Member Function Documentation

◆ fromSource()

QVariant KisBrushRotationResourceConverter::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 261 of file kis_derived_resources.cpp.

262{
264 return (preset && preset->settings()) ? preset->settings()->paintOpAngle() : QVariant();
265}
float value(const T *src, size_t ch)

References value().

◆ toSource()

QVariant KisBrushRotationResourceConverter::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 267 of file kis_derived_resources.cpp.

268{
269 KisPaintOpPresetSP preset = sourceValue.value<KisPaintOpPresetSP>();
270 if (!preset) return sourceValue;
271
272 preset->settings()->setPaintOpAngle(value.toReal());
273 return QVariant::fromValue(preset);
274}

References value().


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