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

#include <KoColorConversionTransformationFactory.h>

+ Inheritance diagram for KoColorConversionTransformationFactory:

Public Member Functions

QString dstColorDepthId () const
 
QString dstColorModelId () const
 
QString dstProfile () const
 
 KoColorConversionTransformationFactory (const QString &_srcModelId, const QString &_srcDepthId, const QString &_srcProfile, const QString &_dstModelId, const QString &_dstDepthId, const QString &_dstProfile)
 
QString srcColorDepthId () const
 
QString srcColorModelId () const
 
QString srcProfile () const
 
 ~KoColorConversionTransformationFactory () override
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 
- Public Member Functions inherited from KoColorConversionTransformationAbstractFactory
virtual KoColorProofingConversionTransformationcreateColorProofingTransformation (const KoColorSpace *srcColorSpace, const KoColorSpace *dstColorSpace, const KoColorSpace *proofingSpace, KoColorProofingConversionTransformation::Intent renderingIntent, KoColorProofingConversionTransformation::Intent proofingIntent, bool bpcFirstTransform, quint8 *gamutWarning, KoColorConversionTransformation::ConversionFlags displayConversionFlags) const
 
virtual KoColorConversionTransformationcreateColorTransformation (const KoColorSpace *srcColorSpace, const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const =0
 
 KoColorConversionTransformationAbstractFactory ()
 
virtual ~KoColorConversionTransformationAbstractFactory ()
 

Public Attributes

QString dstDepthId
 
QString dstModelId
 
QString dstProfile
 
QString srcDepthId
 
QString srcModelId
 
QString srcProfile
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Protected Member Functions

bool canBeDestination (const KoColorSpace *dstCS) const
 
bool canBeSource (const KoColorSpace *srcCS) const
 

Private Attributes

Private *const d
 

Detailed Description

Factory to create a color transformation between two colorspaces.

Definition at line 16 of file KoColorConversionTransformationFactory.cpp.

Constructor & Destructor Documentation

◆ KoColorConversionTransformationFactory()

KoColorConversionTransformationFactory::KoColorConversionTransformationFactory ( const QString & _srcModelId,
const QString & _srcDepthId,
const QString & _srcProfile,
const QString & _dstModelId,
const QString & _dstDepthId,
const QString & _dstProfile )

Create a color conversion transformation factory, that can create KoColorConversionTransformation object between a source colorspace and a destination colorspace.

Parameters
_srcModelIdid for the source color model
_srcDepthIdid for the source depth
_dstModelIdid for the destination color model
_dstDepthIdid for the destination depth
_srcProfilename of the source profile, or empty if any profile
_dstProfilename of the destination profile, or empty if any profile

Definition at line 25 of file KoColorConversionTransformationFactory.cpp.

25 : d(new Private)
26{
27 d->srcModelId = _srcModelId;
28 d->srcDepthId = _srcDepthId;
29 d->dstModelId = _dstModelId;
30 d->dstDepthId = _dstDepthId;
31 d->srcProfile = KoColorSpaceRegistry::instance()->profileAlias(_srcProfile);
32 d->dstProfile = KoColorSpaceRegistry::instance()->profileAlias(_dstProfile);
33}
static KoColorSpaceRegistry * instance()
QString profileAlias(const QString &name) const

References d, KoColorSpaceRegistry::instance(), and KoColorSpaceRegistry::profileAlias().

◆ ~KoColorConversionTransformationFactory()

KoColorConversionTransformationFactory::~KoColorConversionTransformationFactory ( )
override

Definition at line 35 of file KoColorConversionTransformationFactory.cpp.

36{
37 delete d;
38}

References d.

Member Function Documentation

◆ canBeDestination()

bool KoColorConversionTransformationFactory::canBeDestination ( const KoColorSpace * dstCS) const
protected
Parameters
dstCSdestination color space
Returns
true if the color space given as argument can be used as a destination colorspace

Definition at line 47 of file KoColorConversionTransformationFactory.cpp.

48{
49 dbgPigment << dstCS->colorModelId().id() << " " << d->dstModelId << " " << dstCS->colorDepthId().id() << " " << d->dstDepthId << " " << d->dstProfile << " " << (dstCS->profile() ? dstCS->profile()->name() : "noprofile") << " " << d->dstProfile;
50 return ((dstCS->colorModelId().id() == d->dstModelId)
51 && (dstCS->colorDepthId().id() == d->dstDepthId)
52 && (d->dstProfile == "" || dstCS->profile()->name() == d->dstProfile));
53}
#define dbgPigment
virtual KoID colorModelId() const =0
virtual KoID colorDepthId() const =0
virtual const KoColorProfile * profile() const =0
QString id() const
Definition KoID.cpp:63

References KoColorSpace::colorDepthId(), KoColorSpace::colorModelId(), d, dbgPigment, KoID::id(), KoColorProfile::name, and KoColorSpace::profile().

◆ canBeSource()

bool KoColorConversionTransformationFactory::canBeSource ( const KoColorSpace * srcCS) const
protected
Parameters
srcCSsource color space
Returns
true if the color space given as argument can be used as a source colorspace

Definition at line 40 of file KoColorConversionTransformationFactory.cpp.

41{
42 return ((srcCS->colorModelId().id() == d->srcModelId)
43 && (srcCS->colorDepthId().id() == d->srcDepthId)
44 && (d->srcProfile == "" || srcCS->profile()->name() == d->srcProfile));
45}

References KoColorSpace::colorDepthId(), KoColorSpace::colorModelId(), d, KoID::id(), KoColorProfile::name, and KoColorSpace::profile().

◆ dstColorDepthId()

QString KoColorConversionTransformationFactory::dstColorDepthId ( ) const
Returns
the id of the destination color depth

Definition at line 73 of file KoColorConversionTransformationFactory.cpp.

74{
75 return d->dstDepthId;
76}

References d.

◆ dstColorModelId()

QString KoColorConversionTransformationFactory::dstColorModelId ( ) const
Returns
the id of the destination color model

Definition at line 69 of file KoColorConversionTransformationFactory.cpp.

70{
71 return d->dstModelId;
72}

References d.

◆ dstProfile()

QString KoColorConversionTransformationFactory::dstProfile ( ) const
Returns
the name of the destination profile (note that an empty name means all profiles can be used)

◆ srcColorDepthId()

QString KoColorConversionTransformationFactory::srcColorDepthId ( ) const
Returns
the id of the source color depth

Definition at line 59 of file KoColorConversionTransformationFactory.cpp.

60{
61 return d->srcDepthId;
62}

References d.

◆ srcColorModelId()

QString KoColorConversionTransformationFactory::srcColorModelId ( ) const
Returns
the id of the source color model

Definition at line 55 of file KoColorConversionTransformationFactory.cpp.

56{
57 return d->srcModelId;
58}

References d.

◆ srcProfile()

QString KoColorConversionTransformationFactory::srcProfile ( ) const
Returns
the name of the source profile (note that an empty name means all profiles can be used)

Member Data Documentation

◆ d

Private* const KoColorConversionTransformationFactory::d
private

Definition at line 77 of file KoColorConversionTransformationFactory.h.

◆ dstDepthId

QString KoColorConversionTransformationFactory::dstDepthId

Definition at line 20 of file KoColorConversionTransformationFactory.cpp.

◆ dstModelId

QString KoColorConversionTransformationFactory::dstModelId

Definition at line 19 of file KoColorConversionTransformationFactory.cpp.

◆ dstProfile

QString KoColorConversionTransformationFactory::dstProfile

Definition at line 22 of file KoColorConversionTransformationFactory.cpp.

◆ srcDepthId

QString KoColorConversionTransformationFactory::srcDepthId

Definition at line 18 of file KoColorConversionTransformationFactory.cpp.

◆ srcModelId

QString KoColorConversionTransformationFactory::srcModelId

Definition at line 17 of file KoColorConversionTransformationFactory.cpp.

◆ srcProfile

QString KoColorConversionTransformationFactory::srcProfile

Definition at line 21 of file KoColorConversionTransformationFactory.cpp.


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