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

#include <kis_tonemap_adjustment.h>

+ Inheritance diagram for KisToneMapAdjustmentFactory:

Public Member Functions

KoColorTransformation * createTransformation (const KoColorSpace *colorSpace, QHash< QString, QVariant > parameters) const override
 
 KisToneMapAdjustmentFactory ()
 
QList< QPair< KoID, KoID > > supportedModels () const override
 
- Public Member Functions inherited from KoColorTransformationFactory
QString id () const
 
 KoColorTransformationFactory (const QString &id)
 
virtual ~KoColorTransformationFactory ()
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Additional Inherited Members

- Public Attributes inherited from KoColorTransformationFactory
QString id
 
- Public Attributes inherited from Private
KisCanvas2 * canvas
 
int displayedFrame
 
int intendedFrame
 

Detailed Description

Definition at line 12 of file kis_tonemap_adjustment.h.

Constructor & Destructor Documentation

◆ KisToneMapAdjustmentFactory()

KisToneMapAdjustmentFactory::KisToneMapAdjustmentFactory ( )

Definition at line 209 of file kis_tonemap_adjustment.cpp.

210 : KoColorTransformationFactory("tonemap_adjustment")
211{
212
213}

Member Function Documentation

◆ createTransformation()

KoColorTransformation * KisToneMapAdjustmentFactory::createTransformation ( const KoColorSpace * colorSpace,
QHash< QString, QVariant > parameters ) const
overridevirtual

Implements KoColorTransformationFactory.

Definition at line 224 of file kis_tonemap_adjustment.cpp.

225{
227
228 if (colorSpace->colorModelId() == XYZAColorModelID) {
229 if (parameters["CurveType"].toInt() == KoGamutMappingUtils::Reinhard) {
231 } else {
233 }
234 } else if (colorSpace->colorModelId() == LABAColorModelID) {
235 if (parameters["CurveType"].toInt() == KoGamutMappingUtils::Reinhard) {
237 } else {
239 }
240 } else {
241 dbgKrita << "Unsupported color space " << colorSpace->id() << " in KisGamutMapClipAdjustmentFactory::createTransformation";
242 return nullptr;
243 }
244
245 adj->setParameters(parameters);
246 return adj;
247}
const KoID XYZAColorModelID("XYZA", ki18n("XYZ/Alpha"))
const KoID LABAColorModelID("LABA", ki18n("L*a*b*/Alpha"))
virtual KoID colorModelId() const =0
void setParameters(const QHash< QString, QVariant > &parameters)
#define dbgKrita
Definition kis_debug.h:49
int toInt(const QString &str, bool *ok=nullptr)

References KoColorSpace::colorModelId(), dbgKrita, KoColorSpace::id, LABAColorModelID, KoGamutMappingUtils::Reinhard, KoColorTransformation::setParameters(), and XYZAColorModelID.

◆ supportedModels()

QList< QPair< KoID, KoID > > KisToneMapAdjustmentFactory::supportedModels ( ) const
overridevirtual
Returns
an empty list if the factory support all type of colorspaces models.

Implements KoColorTransformationFactory.

Definition at line 215 of file kis_tonemap_adjustment.cpp.

216{
218 // TODO: consider 16bit float.
219 l.append(QPair< KoID, KoID >(XYZAColorModelID , Float32BitsColorDepthID));
220 l.append(QPair< KoID, KoID >(LABAColorModelID , Float32BitsColorDepthID));
221 return l;
222}
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))

References Float32BitsColorDepthID, LABAColorModelID, and XYZAColorModelID.


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