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

#include <KoColorSpaceRegistry.h>

+ Inheritance diagram for KoColorSpaceRegistry:

Public Types

enum  ColorSpaceListProfilesSelection { OnlyDefaultProfile = 1 , AllProfiles = 4 }
 
enum  ColorSpaceListVisibility { OnlyUserVisible = 1 , AllColorSpaces = 4 }
 

Public Member Functions

void add (KoColorSpaceFactory *item)
 
void addProfile (const KoColorProfile *profile)
 
void addProfile (KoColorProfile *profile)
 
void addProfileAlias (const QString &name, const QString &to)
 
void addProfileToMap (KoColorProfile *p)
 
const KoColorSpacealpha16 ()
 
const KoColorSpacealpha32f ()
 
const KoColorSpacealpha8 ()
 
KoColorConversionCachecolorConversionCache () const
 
QList< KoIDcolorDepthList (const KoID &colorModelId, ColorSpaceListVisibility option) const
 
QList< KoIDcolorDepthList (const QString &colorModelId, ColorSpaceListVisibility option) const
 
QList< KoIDcolorModelsList (ColorSpaceListVisibility option) const
 
const KoColorSpacecolorSpace (const QString &colorModelId, const QString &colorDepthId)
 
const KoColorSpacecolorSpace (const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)
 
const KoColorSpacecolorSpace (const QString &colorModelId, const QString &colorDepthId, const QString &profileName)
 
const KoColorSpacecolorSpace1 (const QString &colorSpaceId, const KoColorProfile *profile)
 
template<class LockPolicy = NormalLockPolicy>
const KoColorSpacecolorSpace1 (const QString &colorSpaceId, const QString &pName=QString())
 
KoID colorSpaceColorDepthId (const QString &_colorSpaceId) const
 
KoID colorSpaceColorModelId (const QString &_colorSpaceId) const
 
QString colorSpaceId (const KoID &colorModelId, const KoID &colorDepthId) const
 
QString colorSpaceId (const QString &colorModelId, const QString &colorDepthId) const
 
QString colorSpaceIdImpl (const QString &colorModelId, const QString &colorDepthId) const
 
KoColorConversionTransformationcreateColorConverter (const KoColorSpace *srcColorSpace, const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const
 
void createColorConverters (const KoColorSpace *colorSpace, const QList< QPair< KoID, KoID > > &possibilities, KoColorConversionTransformation *&fromCS, KoColorConversionTransformation *&toCS) const
 
const KoColorProfilecreateColorProfile (const QString &colorModelId, const QString &colorDepthId, const QByteArray &rawData)
 
QString defaultProfileForColorSpace (const QString &colorSpaceId) const
 
QString defaultProfileForCsIdImpl (const QString &csID)
 
const KoColorSpacegetCachedColorSpaceImpl (const QString &csId, const QString &profileName) const
 
const KoColorSpacegraya16 (const KoColorProfile *profile)
 
const KoColorSpacegraya16 (const QString &profile=QString())
 
const KoColorSpacegraya8 (const KoColorProfile *profile)
 
const KoColorSpacegraya8 (const QString &profile=QString())
 
QString idsToCacheName (const QString &csId, const QString &profileName) const
 
 KoColorSpaceRegistry ()
 
const KoColorSpacelab16 (const KoColorProfile *profile)
 
const KoColorSpacelab16 (const QString &profileName=QString())
 
const KoColorSpacelazyCreateColorSpaceImpl (const QString &csID, const KoColorProfile *profile)
 
QList< KoIDlistKeys () const
 
const KoColorProfilep2020G10Profile () const
 
const KoColorProfilep2020PQProfile () const
 
const KoColorProfilep709G10Profile () const
 
const KoColorProfilep709SRGBProfile () const
 
const KoColorSpacepermanentColorspace (const KoColorSpace *_colorSpace)
 
 Private (KoColorSpaceRegistry *_q)
 
QString profileAlias (const QString &name) const
 
const KoColorProfileprofileByName (const QString &name) const
 
const KoColorProfileprofileByUniqueId (const QByteArray &id) const
 
const KoColorProfileprofileFor (const QVector< double > &colorants, ColorPrimaries colorPrimaries, TransferCharacteristics transferFunction) const
 profileFor tries to find the profile that matches these characteristics, if no such profile is found, it attempts to generate one.
 
const KoColorProfileprofileForCsIdWithFallbackImpl (const QString &csID, const QString &profileName)
 
bool profileIsCompatible (const KoColorProfile *profile, const QString &colorSpaceId)
 
QList< const KoColorProfile * > profilesFor (const QString &csID) const
 
void remove (KoColorSpaceFactory *item)
 
void removeProfile (KoColorProfile *profile)
 
const KoColorSpacergb16 (const KoColorProfile *profile)
 
const KoColorSpacergb16 (const QString &profileName=QString())
 
const KoColorSpacergb8 (const KoColorProfile *profile)
 
const KoColorSpacergb8 (const QString &profileName=QString())
 
virtual ~KoColorSpaceRegistry ()
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Static Public Member Functions

static KoColorSpaceRegistryinstance ()
 

Public Attributes

const KoColorSpacealphaCs {nullptr}
 
const KoColorSpacealphaF32Cs {nullptr}
 
const KoColorSpacealphaU16Cs {nullptr}
 
KoColorConversionCachecolorConversionCache {nullptr}
 
KoColorConversionSystemcolorConversionSystem {nullptr}
 
KoGenericRegistry< KoColorSpaceFactory * > colorSpaceFactoryRegistry
 
QScopedPointer< ConversionSystemInterface > conversionSystemInterface
 
QHash< QString, const KoColorSpace * > csMap
 
const KoColorSpacelab16sLAB {nullptr}
 
KoColorProfileStorage profileStorage
 
KoColorSpaceRegistryq {nullptr}
 
QReadWriteLock registrylock
 
const KoColorSpacergbU8sRGB {nullptr}
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Private Member Functions

QList< const KoColorSpace * > allColorSpaces (ColorSpaceListVisibility visibility, ColorSpaceListProfilesSelection pSelection)
 
const KoColorConversionSystemcolorConversionSystem () const
 
void init ()
 
 KoColorSpaceRegistry (const KoColorSpaceRegistry &)
 
KoColorSpaceRegistry operator= (const KoColorSpaceRegistry &)
 

Private Attributes

Private *const d
 

Friends

struct FriendOfColorSpaceRegistry
 
class KisCrashFilterTest
 
class KisCsConversionTest
 
class KisIteratorNGTest
 
class KisIteratorTest
 
class KisPainterTest
 
class KoColorSpacesBenchmark
 
class TestColorConversionSystem
 
class TestKoColorSpaceSanity
 

Detailed Description

The registry for colorspaces and profiles. This class contains:

  • a registry of colorspace instantiated with specific profiles.
  • a registry of singleton colorspace factories.
  • a registry of icc profiles

Locking policy details:

Basically, we have two levels of locks in the registry: 1) (outer level) is Private::registrylock, which controls the structures of the color space registry itself 2) (inner level) is KoColorProfileStorage::Private::lock controls the structures related to profiles.

The locks can be taken individually, but if you are going to take both of them, you should always follow the order 1) registry; 2) profiles. Otherwise you'll get a deadlock.

To avoid recursive deadlocks, all the dependent classes (KoColorConversionSystem and KoColorSpaceFactory) now do not use the direct links to the registry. Instead, they use special private interfaces that skip recursive locking and ensure we take a lock twice.

Definition at line 41 of file KoColorSpaceRegistry.cpp.

Member Enumeration Documentation

◆ ColorSpaceListProfilesSelection

Enumerator
OnlyDefaultProfile 

Only add the default profile.

AllProfiles 

Add all profiles.

Definition at line 60 of file KoColorSpaceRegistry.h.

60 {
62 AllProfiles = 4
63 };
@ AllProfiles
Add all profiles.
@ OnlyDefaultProfile
Only add the default profile.

◆ ColorSpaceListVisibility

Enumerator
OnlyUserVisible 

Only user visible color space.

AllColorSpaces 

All color space even those not visible to the user.

Definition at line 56 of file KoColorSpaceRegistry.h.

56 {
57 OnlyUserVisible = 1,
59 };
@ AllColorSpaces
All color space even those not visible to the user.
@ OnlyUserVisible
Only user visible color space.

Constructor & Destructor Documentation

◆ KoColorSpaceRegistry() [1/2]

KoColorSpaceRegistry::KoColorSpaceRegistry ( )

Definition at line 199 of file KoColorSpaceRegistry.cpp.

199 : d(new Private(this))
200{
201 d->colorConversionSystem = nullptr;
202 d->colorConversionCache = nullptr;
203}

References d.

◆ ~KoColorSpaceRegistry()

KoColorSpaceRegistry::~KoColorSpaceRegistry ( )
virtual

Definition at line 205 of file KoColorSpaceRegistry.cpp.

206{
207 delete d->colorConversionSystem;
208 d->colorConversionSystem = nullptr;
209
210 Q_FOREACH (const KoColorSpace * cs, d->csMap) {
211 cs->d->deletability = OwnedByRegistryRegistryDeletes;
212 delete cs;
213 }
214 d->csMap.clear();
215
216 // deleting colorspaces calls a function in the cache
217 delete d->colorConversionCache;
218 d->colorConversionCache = nullptr;
219
220 // Delete the colorspace factories
221 Q_FOREACH(KoColorSpaceFactory *f, d->colorSpaceFactoryRegistry.values()) {
222 d->colorSpaceFactoryRegistry.remove(f->id());
223 delete f;
224 }
225 Q_FOREACH(KoColorSpaceFactory *f, d->colorSpaceFactoryRegistry.doubleEntries()) {
226 delete f;
227 }
228
229 delete d;
230}
@ OwnedByRegistryRegistryDeletes
Private *const d

References KoColorSpace::d, d, and OwnedByRegistryRegistryDeletes.

◆ KoColorSpaceRegistry() [2/2]

KoColorSpaceRegistry::KoColorSpaceRegistry ( const KoColorSpaceRegistry & )
private

Member Function Documentation

◆ add()

void KoColorSpaceRegistry::add ( KoColorSpaceFactory * item)

add a color space to the registry

Parameters
itemthe color space factory to add

Definition at line 232 of file KoColorSpaceRegistry.cpp.

233{
234 QWriteLocker l(&d->registrylock);
235 d->colorSpaceFactoryRegistry.add(item);
236 d->colorConversionSystem->insertColorSpace(item);
237}

References d.

◆ addProfile() [1/2]

void KoColorSpaceRegistry::addProfile ( const KoColorProfile * profile)

Definition at line 323 of file KoColorSpaceRegistry.cpp.

324{
325 addProfile(profile->clone());
326}
virtual KoColorProfile * clone() const =0
void addProfile(KoColorProfile *profile)

References addProfile(), and KoColorProfile::clone().

◆ addProfile() [2/2]

void KoColorSpaceRegistry::addProfile ( KoColorProfile * profile)

register the profile with the color space registry

Parameters
profilethe new profile to be registered so it can be combined with colorspaces.

Definition at line 312 of file KoColorSpaceRegistry.cpp.

313{
314 if (!p->valid()) return;
315
316 QWriteLocker locker(&d->registrylock);
317 if (p->valid()) {
319 d->colorConversionSystem->insertColorProfile(p);
320 }
321}
const Params2D p
void addProfileToMap(KoColorProfile *p)

References addProfileToMap(), d, and p.

◆ addProfileAlias()

void KoColorSpaceRegistry::addProfileAlias ( const QString & name,
const QString & to )

Create an alias to a profile with a different name. Then profileByName will return the profile to when passed name as a parameter.

Definition at line 258 of file KoColorSpaceRegistry.cpp.

259{
260 d->profileStorage.addProfileAlias(name, to);
261}

References d.

◆ addProfileToMap()

void KoColorSpaceRegistry::addProfileToMap ( KoColorProfile * p)

Add a profile to the profile map but do not add it to the color conversion system yet.

Parameters
profilethe new profile to be registered.

Definition at line 307 of file KoColorSpaceRegistry.cpp.

308{
309 d->profileStorage.addProfile(p);
310}

References d, and p.

◆ allColorSpaces()

QList< const KoColorSpace * > KoColorSpaceRegistry::allColorSpaces ( ColorSpaceListVisibility visibility,
ColorSpaceListProfilesSelection pSelection )
private
Returns
a list with an instance of all color space with their default profile.

Definition at line 876 of file KoColorSpaceRegistry.cpp.

877{
878 QList<const KoColorSpace*> colorSpaces;
879
880 // TODO: thread-unsafe code: the factories might change right after the lock in released
881 // HINT: used in a unittest only!
882
883 d->registrylock.lockForRead();
884 QList<KoColorSpaceFactory*> factories = d->colorSpaceFactoryRegistry.values();
885 d->registrylock.unlock();
886
887 Q_FOREACH (KoColorSpaceFactory* factory, factories) {
888 // Don't test with ycbcr for now, since we don't have a default profile for it.
889 if (factory->colorModelId().id().startsWith("Y")) continue;
890 if (visibility == AllColorSpaces || factory->userVisible()) {
891 if (pSelection == OnlyDefaultProfile) {
892 const KoColorSpace *cs = d->colorSpace1(factory->id());
893 if (cs) {
894 colorSpaces.append(cs);
895 }
896 else {
897 warnPigment << "Could not create colorspace for id" << factory->id() << "since there is no working default profile";
898 }
899 } else {
901 Q_FOREACH (const KoColorProfile * profile, profiles) {
902 const KoColorSpace *cs = d->colorSpace1(factory->id(), profile);
903 if (cs) {
904 colorSpaces.append(cs);
905 }
906 else {
907 warnPigment << "Could not create colorspace for id" << factory->id() << "and profile" << profile->name();
908 }
909 }
910 }
911 }
912 }
913
914 return colorSpaces;
915}
#define warnPigment
QString id() const
Definition KoID.cpp:63
virtual KoID colorModelId() const =0
virtual QString id() const =0
virtual bool userVisible() const =0
static KoColorSpaceRegistry * instance()
QList< const KoColorProfile * > profilesFor(const QString &csID) const

References AllColorSpaces, KoColorSpaceFactory::colorModelId(), d, KoID::id(), KoColorSpaceFactory::id(), instance(), KoColorProfile::name, OnlyDefaultProfile, profilesFor(), KoColorSpaceFactory::userVisible(), and warnPigment.

◆ alpha16()

const KoColorSpace * KoColorSpaceRegistry::alpha16 ( )

Definition at line 543 of file KoColorSpaceRegistry.cpp.

544{
545 if (!d->alphaU16Cs) {
546 d->alphaU16Cs = d->colorSpace1(KoAlphaU16ColorSpace::colorSpaceId());
547 }
548 Q_ASSERT(d->alphaU16Cs);
549 return d->alphaU16Cs;
550}
static QString colorSpaceId()

References KoAlphaColorSpaceImpl< _CSTrait >::colorSpaceId(), and d.

◆ alpha32f()

const KoColorSpace * KoColorSpaceRegistry::alpha32f ( )

Definition at line 563 of file KoColorSpaceRegistry.cpp.

564{
565 if (!d->alphaF32Cs) {
566 d->alphaF32Cs = d->colorSpace1(KoAlphaF32ColorSpace::colorSpaceId());
567 }
568 Q_ASSERT(d->alphaF32Cs);
569 return d->alphaF32Cs;
570}

References KoAlphaColorSpaceImpl< _CSTrait >::colorSpaceId(), and d.

◆ alpha8()

const KoColorSpace * KoColorSpaceRegistry::alpha8 ( )

Convenience methods to get the often used alpha colorspaces

Definition at line 534 of file KoColorSpaceRegistry.cpp.

535{
536 if (!d->alphaCs) {
537 d->alphaCs = d->colorSpace1(KoAlphaColorSpace::colorSpaceId());
538 }
539 Q_ASSERT(d->alphaCs);
540 return d->alphaCs;
541}

References KoAlphaColorSpaceImpl< _CSTrait >::colorSpaceId(), and d.

◆ colorConversionCache()

KoColorConversionCache * KoColorSpaceRegistry::colorConversionCache ( ) const
Returns
the cache of color conversion transformation to be use by KoColorSpace

◆ colorConversionSystem()

const KoColorConversionSystem * KoColorSpaceRegistry::colorConversionSystem ( ) const
private
Returns
the color conversion system use by the registry and the color spaces to create color conversion transformation.

WARNING: conversion system is guarded by the registry locks, don't use it anywhere other than unittests!

◆ colorDepthList() [1/2]

QList< KoID > KoColorSpaceRegistry::colorDepthList ( const KoID & colorModelId,
ColorSpaceListVisibility option ) const
Returns
the list of available color models for the given colorModelId

Definition at line 741 of file KoColorSpaceRegistry.cpp.

742{
743 return colorDepthList(colorModelId.id(), option);
744}
QList< KoID > colorDepthList(const KoID &colorModelId, ColorSpaceListVisibility option) const

References colorDepthList(), and KoID::id().

◆ colorDepthList() [2/2]

QList< KoID > KoColorSpaceRegistry::colorDepthList ( const QString & colorModelId,
ColorSpaceListVisibility option ) const
Returns
the list of available color models for the given colorModelId

Definition at line 747 of file KoColorSpaceRegistry.cpp.

748{
749 QReadLocker l(&d->registrylock);
750
751 QList<KoID> ids;
752 QList<KoColorSpaceFactory*> factories = d->colorSpaceFactoryRegistry.values();
753 Q_FOREACH (KoColorSpaceFactory* factory, factories) {
754 if (!ids.contains(KoID(factory->colorDepthId()))
755 && factory->colorModelId().id() == colorModelId
756 && (option == AllColorSpaces || factory->userVisible())) {
757 ids << factory->colorDepthId();
758 }
759 }
761
767
768 return r;
769}
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID Float64BitsColorDepthID("F64", ki18n("64-bit float/channel"))
const KoID Float16BitsColorDepthID("F16", ki18n("16-bit float/channel"))
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const KoID Integer16BitsColorDepthID("U16", ki18n("16-bit integer/channel"))
Definition KoID.h:30
virtual KoID colorDepthId() const =0

References AllColorSpaces, KoColorSpaceFactory::colorDepthId(), KoColorSpaceFactory::colorModelId(), d, Float16BitsColorDepthID, Float32BitsColorDepthID, Float64BitsColorDepthID, KoID::id(), Integer16BitsColorDepthID, Integer8BitsColorDepthID, and KoColorSpaceFactory::userVisible().

◆ colorModelsList()

QList< KoID > KoColorSpaceRegistry::colorModelsList ( ColorSpaceListVisibility option) const
Returns
the list of available color models

Definition at line 727 of file KoColorSpaceRegistry.cpp.

728{
729 QReadLocker l(&d->registrylock);
730
731 QList<KoID> ids;
732 QList<KoColorSpaceFactory*> factories = d->colorSpaceFactoryRegistry.values();
733 Q_FOREACH (KoColorSpaceFactory* factory, factories) {
734 if (!ids.contains(factory->colorModelId())
735 && (option == AllColorSpaces || factory->userVisible())) {
736 ids << factory->colorModelId();
737 }
738 }
739 return ids;
740}

References AllColorSpaces, KoColorSpaceFactory::colorModelId(), d, and KoColorSpaceFactory::userVisible().

◆ colorSpace() [1/3]

const KoColorSpace * KoColorSpaceRegistry::colorSpace ( const QString & colorModelId,
const QString & colorDepthId )

Definition at line 294 of file KoColorSpaceRegistry.cpp.

295{
296 return d->colorSpace1(colorSpaceId(colorModelId, colorDepthId));
297}
QString colorSpaceId(const QString &colorModelId, const QString &colorDepthId) const

References colorSpaceId(), and d.

◆ colorSpace() [2/3]

const KoColorSpace * KoColorSpaceRegistry::colorSpace ( const QString & colorModelId,
const QString & colorDepthId,
const KoColorProfile * profile )

Return a colorspace that works with the parameter profile.

Parameters
colorSpaceIdthe ID string of the colorspace that you want to have returned
profilethe profile be combined with the colorspace
Returns
the wanted colorspace, or 0 when the cs and profile can not be combined.

Definition at line 284 of file KoColorSpaceRegistry.cpp.

285{
286 return d->colorSpace1(colorSpaceId(colorModelId, colorDepthId), profile);
287}

References colorSpaceId(), and d.

◆ colorSpace() [3/3]

const KoColorSpace * KoColorSpaceRegistry::colorSpace ( const QString & colorModelId,
const QString & colorDepthId,
const QString & profileName )

Return a colorspace that works with the parameter profile.

Parameters
profileNamethe name of the KoColorProfile to be combined with the colorspace
Returns
the wanted colorspace, or 0 when the cs and profile can not be combined.

Definition at line 289 of file KoColorSpaceRegistry.cpp.

290{
291 return d->colorSpace1(colorSpaceId(colorModelId, colorDepthId), profileName);
292}

References colorSpaceId(), and d.

◆ colorSpace1() [1/2]

const KoColorSpace * KoColorSpaceRegistry::colorSpace1 ( const QString & colorSpaceId,
const KoColorProfile * profile )

Return a colorspace that works with the parameter profile.

Parameters
colorSpaceIdthe ID string of the colorspace that you want to have returned
profilethe profile be combined with the colorspace
Returns
the wanted colorspace, or 0 when the cs and profile can not be combined.

◆ colorSpace1() [2/2]

template<class LockPolicy = NormalLockPolicy>
const KoColorSpace * KoColorSpaceRegistry::colorSpace1 ( const QString & colorSpaceId,
const QString & pName = QString() )

Return a colorspace that works with the parameter profile.

Parameters
profileNamethe name of the KoColorProfile to be combined with the colorspace
Returns
the wanted colorspace, or 0 when the cs and profile can not be combined.

◆ colorSpaceColorDepthId()

KoID KoColorSpaceRegistry::colorSpaceColorDepthId ( const QString & _colorSpaceId) const
Returns
the identifier of the color depth for the given color space id.

This function is a compatibility function used to get the color space from all kra files.

Definition at line 804 of file KoColorSpaceRegistry.cpp.

805{
806 QReadLocker l(&d->registrylock);
807
808 KoColorSpaceFactory* factory = d->colorSpaceFactoryRegistry.get(_colorSpaceId);
809 if (factory) {
810 return factory->colorDepthId();
811 } else {
812 return KoID();
813 }
814}

References KoColorSpaceFactory::colorDepthId(), and d.

◆ colorSpaceColorModelId()

KoID KoColorSpaceRegistry::colorSpaceColorModelId ( const QString & _colorSpaceId) const
Returns
the identifier of the color model for the given color space id.

This function is a compatibility function used to get the color space from all kra files.

Definition at line 792 of file KoColorSpaceRegistry.cpp.

793{
794 QReadLocker l(&d->registrylock);
795
796 KoColorSpaceFactory* factory = d->colorSpaceFactoryRegistry.get(_colorSpaceId);
797 if (factory) {
798 return factory->colorModelId();
799 } else {
800 return KoID();
801 }
802}

References KoColorSpaceFactory::colorModelId(), and d.

◆ colorSpaceId() [1/2]

QString KoColorSpaceRegistry::colorSpaceId ( const KoID & colorModelId,
const KoID & colorDepthId ) const

It's a convenient function that behave like the above. Return the id of the colorspace that have the defined colorModelId with colorDepthId.

Parameters
colorModelIdid of the color model
colorDepthIdid of the color depth
Returns
the id of the wanted colorspace, or "" if no colorspace correspond to those ids

Definition at line 787 of file KoColorSpaceRegistry.cpp.

788{
789 return colorSpaceId(colorModelId.id(), colorDepthId.id());
790}

References colorSpaceId(), and KoID::id().

◆ colorSpaceId() [2/2]

QString KoColorSpaceRegistry::colorSpaceId ( const QString & colorModelId,
const QString & colorDepthId ) const

Return the id of the colorspace that have the defined colorModelId with colorDepthId.

Parameters
colorModelIdid of the color model
colorDepthIdid of the color depth
Returns
the id of the wanted colorspace, or "" if no colorspace correspond to those ids

Definition at line 781 of file KoColorSpaceRegistry.cpp.

782{
783 QReadLocker l(&d->registrylock);
784 return d->colorSpaceIdImpl(colorModelId, colorDepthId);
785}

References d.

◆ colorSpaceIdImpl()

QString KoColorSpaceRegistry::colorSpaceIdImpl ( const QString & colorModelId,
const QString & colorDepthId ) const

◆ createColorConverter()

KoColorConversionTransformation * KoColorSpaceRegistry::createColorConverter ( const KoColorSpace * srcColorSpace,
const KoColorSpace * dstColorSpace,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags ) const

This function is called by the color space to create a color conversion between two color space. This function search in the graph of transformations the best possible path between the two color space.

Definition at line 356 of file KoColorSpaceRegistry.cpp.

357{
358 QWriteLocker l(&d->registrylock);
359 return d->colorConversionSystem->createColorConverter(srcColorSpace, dstColorSpace, renderingIntent, conversionFlags);
360}

References d.

◆ createColorConverters()

void KoColorSpaceRegistry::createColorConverters ( const KoColorSpace * colorSpace,
const QList< QPair< KoID, KoID > > & possibilities,
KoColorConversionTransformation *& fromCS,
KoColorConversionTransformation *& toCS ) const

This function creates two transformations, one from the color space and one to the color space. The destination color space is picked from a list of color space, such as the conversion between the two color space is of the best quality.

The typical use case of this function is for KoColorTransformationFactory which doesn't support all color spaces, so unsupported color space have to find an acceptable conversion in order to use that KoColorTransformationFactory.

Parameters
colorSpacethe source color space
possibilitiesa list of color space among which we need to find the best conversion
fromCSthe conversion from the source color space will be affected to this variable
toCSthe revert conversion to the source color space will be affected to this variable

Definition at line 362 of file KoColorSpaceRegistry.cpp.

363{
364 QWriteLocker l(&d->registrylock);
365 d->colorConversionSystem->createColorConverters(colorSpace, possibilities, fromCS, toCS);
366}
const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)

References colorSpace(), and d.

◆ createColorProfile()

const KoColorProfile * KoColorSpaceRegistry::createColorProfile ( const QString & colorModelId,
const QString & colorDepthId,
const QByteArray & rawData )

create a profile of the specified type.

Definition at line 867 of file KoColorSpaceRegistry.cpp.

868{
869 QWriteLocker l(&d->registrylock);
870 KoColorSpaceFactory* factory_ = d->colorSpaceFactoryRegistry.get(d->colorSpaceIdImpl(colorModelId, colorDepthId));
871
872 Private::ProfileRegistrationInterface interface(d);
873 return factory_->colorProfile(rawData, &interface);
874}
const KoColorProfile * colorProfile(const QByteArray &rawData, ProfileRegistrationInterface *registrationInterface) const

References KoColorSpaceFactory::colorProfile(), and d.

◆ defaultProfileForColorSpace()

QString KoColorSpaceRegistry::defaultProfileForColorSpace ( const QString & colorSpaceId) const

Definition at line 350 of file KoColorSpaceRegistry.cpp.

351{
352 QReadLocker l(&d->registrylock);
353 return d->defaultProfileForCsIdImpl(colorSpaceId);
354}

References colorSpaceId(), and d.

◆ defaultProfileForCsIdImpl()

QString KoColorSpaceRegistry::defaultProfileForCsIdImpl ( const QString & csID)

◆ getCachedColorSpaceImpl()

const KoColorSpace * KoColorSpaceRegistry::getCachedColorSpaceImpl ( const QString & csId,
const QString & profileName ) const

The function checks if a colorspace with a certain id and profile name can be found in the cache NOTE: the function doesn't take any lock but it needs to be called inside a d->registryLock locked either in read or write.

Parameters
csIdThe colorspace id
profileNameThe colorspace profile name
Return values
KoColorSpaceThe matching colorspace
0Null pointer if not match

◆ graya16() [1/2]

const KoColorSpace * KoColorSpaceRegistry::graya16 ( const KoColorProfile * profile)

Convenience method to get a GRAYA 16 bit colorspace. If a profile is not specified, the default profile defined in the GRAY colorspace will be used

Parameters
theprofile
Returns
an 8 bit graya colorspace with the default profile or 0.

Definition at line 608 of file KoColorSpaceRegistry.cpp.

609{
610 if (!profile) {
611 return graya16();
612 }
613 else {
615 }
616}
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoColorSpace * graya16(const QString &profile=QString())

References colorSpace(), graya16(), GrayAColorModelID, KoID::id(), instance(), and Integer16BitsColorDepthID.

◆ graya16() [2/2]

const KoColorSpace * KoColorSpaceRegistry::graya16 ( const QString & profile = QString())

Convenience method to get a GRAYA 16 bit colorspace. If a profile is not specified, the default profile defined in the GRAY colorspace will be used

Parameters
theprofile
Returns
an 8 bit graya colorspace with the default profile or 0.

Definition at line 596 of file KoColorSpaceRegistry.cpp.

597{
598 if (profile.isEmpty()) {
599 KoColorSpaceFactory* factory = d->colorSpaceFactoryRegistry.get(GrayAColorModelID.id());
601 }
602 else {
604 }
605
606}
virtual QString defaultProfile() const =0

References colorSpace(), d, KoColorSpaceFactory::defaultProfile(), GrayAColorModelID, KoID::id(), instance(), and Integer16BitsColorDepthID.

◆ graya8() [1/2]

const KoColorSpace * KoColorSpaceRegistry::graya8 ( const KoColorProfile * profile)

Convenience method to get a GRAYA 8 bit colorspace. If a profile is not specified, the default profile defined in the GRAY colorspace will be used

Parameters
profilethe profile
Returns
an 8 bit graya colorspace with the default profile or 0.

Definition at line 585 of file KoColorSpaceRegistry.cpp.

586{
587 if (!profile) {
588 return graya8();
589 }
590 else {
592 }
593
594}
const KoColorSpace * graya8(const QString &profile=QString())

References colorSpace(), graya8(), GrayAColorModelID, KoID::id(), instance(), and Integer8BitsColorDepthID.

◆ graya8() [2/2]

const KoColorSpace * KoColorSpaceRegistry::graya8 ( const QString & profile = QString())

Convenience method to get a GRAYA 8 bit colorspace. If a profile is not specified, the default profile defined in the GRAY colorspace will be used

Parameters
profilethe profile name
Returns
an 8 bit graya colorspace with the default profile or 0.

Definition at line 572 of file KoColorSpaceRegistry.cpp.

573{
574
575 if (profile.isEmpty()) {
576 KoColorSpaceFactory* factory = d->colorSpaceFactoryRegistry.get(GrayAColorModelID.id());
578 }
579 else {
581 }
582
583}

References colorSpace(), d, KoColorSpaceFactory::defaultProfile(), GrayAColorModelID, KoID::id(), instance(), and Integer8BitsColorDepthID.

◆ idsToCacheName()

QString KoColorSpaceRegistry::idsToCacheName ( const QString & csId,
const QString & profileName ) const

◆ init()

void KoColorSpaceRegistry::init ( )
private

Definition at line 146 of file KoColorSpaceRegistry.cpp.

147{
148 d->rgbU8sRGB = 0;
149 d->lab16sLAB = 0;
150 d->alphaCs = 0;
151 d->alphaU16Cs = 0;
152#ifdef HAVE_OPENEXR
153 d->alphaF16Cs = 0;
154#endif
155 d->alphaF32Cs = 0;
156
157 d->conversionSystemInterface.reset(new Private::ConversionSystemInterface(this));
158 d->colorConversionSystem = new KoColorConversionSystem(d->conversionSystemInterface.data());
159 d->colorConversionCache = new KoColorConversionCache;
160
162
164
165 // Create the built-in colorspaces
166 QList<KoColorSpaceFactory *> localFactories;
167 localFactories
170 #ifdef HAVE_OPENEXR
171 << new KoAlphaF16ColorSpaceFactory()
172 #endif
177
178 Q_FOREACH (KoColorSpaceFactory *factory, localFactories) {
179 add(factory);
180 }
181
183 config.blacklist = "ColorSpacePluginsDisabled";
184 config.group = "krita";
185 KoPluginLoader::instance()->load("Krita/ColorSpace", config);
186
187 KoPluginLoader::PluginsConfig configExtensions;
188 configExtensions.blacklist = "ColorSpaceExtensionsPluginsDisabled";
189 configExtensions.group = "krita";
190 KoPluginLoader::instance()->load("Krita/ColorSpaceExtension", configExtensions);
191
192
193 dbgPigment << "Loaded the following colorspaces:";
194 Q_FOREACH (const KoID& id, listKeys()) {
195 dbgPigment << "\t" << id.id() << "," << id.name();
196 }
197}
#define dbgPigment
KoAlphaColorSpaceFactoryImpl< AlphaU16Traits > KoAlphaU16ColorSpaceFactory
KoAlphaColorSpaceFactoryImpl< AlphaU8Traits > KoAlphaColorSpaceFactory
KoAlphaColorSpaceFactoryImpl< AlphaF32Traits > KoAlphaF32ColorSpaceFactory
static KoColorSpaceEngineRegistry * instance()
void load(const QString &serviceType, const PluginsConfig &config=PluginsConfig(), QObject *owner=0, bool cache=true)
static KoPluginLoader * instance()
void add(KoColorSpaceFactory *item)
QList< KoID > listKeys() const
const char * blacklist
This contains the variable name for the list of plugins (by library name) that will not be loaded.

References add(), KoGenericRegistry< T >::add(), addProfile(), KoPluginLoader::PluginsConfig::blacklist, d, dbgPigment, KoPluginLoader::PluginsConfig::group, KoPluginLoader::instance(), KoColorSpaceEngineRegistry::instance(), listKeys(), and KoPluginLoader::load().

◆ instance()

KoColorSpaceRegistry * KoColorSpaceRegistry::instance ( )
static

Return an instance of the KoColorSpaceRegistry Creates an instance if that has never happened before and returns the singleton instance.

Definition at line 137 of file KoColorSpaceRegistry.cpp.

138{
139 if (!s_instance.exists()) {
140 s_instance->init();
141 }
142 return s_instance;
143}

References init().

◆ lab16() [1/2]

const KoColorSpace * KoColorSpaceRegistry::lab16 ( const KoColorProfile * profile)

Convenience method to get an Lab 16bit colorspace with the given profile.

Parameters
profilean Lab profile
Returns
the wanted colorspace, or 0 if the color space and profile can not be combined.

Definition at line 664 of file KoColorSpaceRegistry.cpp.

665{
666 if (profile == 0) {
667 if (!d->lab16sLAB) {
668 d->lab16sLAB = d->colorSpace1(KoLabColorSpace::colorSpaceId());
669 }
670 Q_ASSERT(d->lab16sLAB);
671 return d->lab16sLAB;
672 }
673 return d->colorSpace1(KoLabColorSpace::colorSpaceId(), profile);
674}
static QString colorSpaceId()

References KoLabColorSpace::colorSpaceId(), and d.

◆ lab16() [2/2]

const KoColorSpace * KoColorSpaceRegistry::lab16 ( const QString & profileName = QString())

Convenience method to get an Lab 16bit colorspace. If a profile is not specified, an Lab profile with a D50 whitepoint will be used.

Parameters
profileNamethe name of an Lab color profile
Returns
the wanted colorspace, or 0 if the color space and profile can not be combined.

Definition at line 653 of file KoColorSpaceRegistry.cpp.

654{
655 if (profileName.isEmpty()) {
656 if (!d->lab16sLAB) {
657 d->lab16sLAB = d->colorSpace1(KoLabColorSpace::colorSpaceId());
658 }
659 return d->lab16sLAB;
660 }
661 return d->colorSpace1(KoLabColorSpace::colorSpaceId(), profileName);
662}

References KoLabColorSpace::colorSpaceId(), and d.

◆ lazyCreateColorSpaceImpl()

const KoColorSpace * KoColorSpaceRegistry::lazyCreateColorSpaceImpl ( const QString & csID,
const KoColorProfile * profile )

◆ listKeys()

QList< KoID > KoColorSpaceRegistry::listKeys ( ) const

This function return a list of all the keys in KoID format by using the name() method on the objects stored in the registry.

Definition at line 840 of file KoColorSpaceRegistry.cpp.

841{
842 QReadLocker l(&d->registrylock);
843 QList<KoID> answer;
844 Q_FOREACH (const QString& key, d->colorSpaceFactoryRegistry.keys()) {
845 answer.append(KoID(key, d->colorSpaceFactoryRegistry.get(key)->name()));
846 }
847
848 return answer;
849}

References d.

◆ operator=()

KoColorSpaceRegistry KoColorSpaceRegistry::operator= ( const KoColorSpaceRegistry & )
private

◆ p2020G10Profile()

const KoColorProfile * KoColorSpaceRegistry::p2020G10Profile ( ) const

Convenience method to get a standard profile for Rec.2020 linear light color space

Definition at line 676 of file KoColorSpaceRegistry.cpp.

677{
678 return profileByName("Rec2020-elle-V4-g10.icc");
679}
const KoColorProfile * profileByName(const QString &name) const

References profileByName().

◆ p2020PQProfile()

const KoColorProfile * KoColorSpaceRegistry::p2020PQProfile ( ) const

Convenience method to get a standard profile for Rec.2020 PQ color space

Definition at line 681 of file KoColorSpaceRegistry.cpp.

682{
683 return profileByName("High Dynamic Range UHDTV Wide Color Gamut Display (Rec. 2020) - SMPTE ST 2084 PQ EOTF");
684}

References profileByName().

◆ p709G10Profile()

const KoColorProfile * KoColorSpaceRegistry::p709G10Profile ( ) const

Convenience method to get a standard profile for Rec. 709 linear light color space

Definition at line 686 of file KoColorSpaceRegistry.cpp.

687{
688 return profileByName("sRGB-elle-V2-g10.icc");
689}

References profileByName().

◆ p709SRGBProfile()

const KoColorProfile * KoColorSpaceRegistry::p709SRGBProfile ( ) const

Convenience method to get a standard profile for Rec. 709 sRGB-tone- response-curve profile

Definition at line 691 of file KoColorSpaceRegistry.cpp.

692{
693 return profileByName("sRGB-elle-V2-srgbtrc.icc");
694}

References profileByName().

◆ permanentColorspace()

const KoColorSpace * KoColorSpaceRegistry::permanentColorspace ( const KoColorSpace * _colorSpace)
Returns
a permanent colorspace owned by the registry, of the same type and profile as the one given in argument

Definition at line 826 of file KoColorSpaceRegistry.cpp.

827{
828 if (_colorSpace->d->deletability != NotOwnedByRegistry) {
829 return _colorSpace;
830 } else if (*_colorSpace == *d->alphaCs) {
831 return d->alphaCs;
832 } else {
833 const KoColorSpace* cs = d->colorSpace1(_colorSpace->id(), _colorSpace->profile());
834 Q_ASSERT(cs);
835 Q_ASSERT(*cs == *_colorSpace);
836 return cs;
837 }
838}
@ NotOwnedByRegistry
virtual const KoColorProfile * profile() const =0

References KoColorSpace::d, d, KoColorSpace::id, NotOwnedByRegistry, and KoColorSpace::profile().

◆ Private()

KoColorSpaceRegistry::Private ( KoColorSpaceRegistry * _q)
inline

Definition at line 49 of file KoColorSpaceRegistry.cpp.

49: q(_q) {}
KoColorSpaceRegistry * q

◆ profileAlias()

QString KoColorSpaceRegistry::profileAlias ( const QString & name) const
Returns
the profile alias, or name if not aliased

Definition at line 263 of file KoColorSpaceRegistry.cpp.

264{
265 return d->profileStorage.profileAlias(name);
266}

References d.

◆ profileByName()

const KoColorProfile * KoColorSpaceRegistry::profileByName ( const QString & name) const

Return a profile by its given name, or 0 if none registered.

Returns
a profile by its given name, or 0 if none registered.
Parameters
namethe product name as set on the profile.
See also
addProfile()
KoColorProfile::productName()

Definition at line 268 of file KoColorSpaceRegistry.cpp.

269{
270 return d->profileStorage.profileByName(name);
271}

References d.

◆ profileByUniqueId()

const KoColorProfile * KoColorSpaceRegistry::profileByUniqueId ( const QByteArray & id) const

Returns a profile by its unique id stored/calculated in the header. The first call to this function might take long, because the map is created on the first use only (atm used by SVG only)

Parameters
idunique ProfileID of the profile (MD5 sum of its header)
Returns
the profile or 0 if not found

Definition at line 273 of file KoColorSpaceRegistry.cpp.

274{
275 return d->profileStorage.profileByUniqueId(id);
276}

References d.

◆ profileFor()

const KoColorProfile * KoColorSpaceRegistry::profileFor ( const QVector< double > & colorants,
ColorPrimaries colorPrimaries,
TransferCharacteristics transferFunction ) const

profileFor tries to find the profile that matches these characteristics, if no such profile is found, it attempts to generate one.

Parameters
colorantsa double of xy (for xyY) values, this expects the first two as the white point, then the red, green and blue. If there's only a whitepoint and primaries type is undefined, a grayscale profile will be returned.
colorPrimariesthe color primaries type as defined in KoColorProfile.
transferFunctionthe transfer function, as defined in KoColorProfile.
Returns
a profile that matches these characteristics.

Definition at line 696 of file KoColorSpaceRegistry.cpp.

697{
698 if (colorPrimaries == PRIMARIES_ITU_R_BT_709_5) {
699 if (transferFunction == TRC_IEC_61966_2_1) {
700 return p709SRGBProfile();
701 } else if (transferFunction == TRC_LINEAR) {
702 return p709G10Profile();
703 }
704 }
705
706 if (colorPrimaries == PRIMARIES_ITU_R_BT_2020_2_AND_2100_0) {
707 if (transferFunction == TRC_ITU_R_BT_2100_0_PQ) {
708 return p2020PQProfile();
709 } else if (transferFunction == TRC_LINEAR) {
710 return p2020G10Profile();
711 }
712 }
713
714 QList<const KoColorProfile*> list = d->profileStorage.profilesFor(colorants, colorPrimaries, transferFunction);
715 if (!list.empty()) {
716 return list.first();
717 }
718
720 if (engine) {
721 return engine->getProfile(colorants, colorPrimaries, transferFunction);
722 }
723
724 return nullptr;
725}
@ PRIMARIES_ITU_R_BT_2020_2_AND_2100_0
@ PRIMARIES_ITU_R_BT_709_5
@ TRC_ITU_R_BT_2100_0_PQ
@ TRC_IEC_61966_2_1
T get(const QString &id) const
virtual const KoColorProfile * getProfile(const QVector< double > &colorants, ColorPrimaries colorPrimaries, TransferCharacteristics transferFunction)=0
getProfile This tries to generate a profile with the given characteristics and add it to the registry...
const KoColorProfile * p709G10Profile() const
const KoColorProfile * p709SRGBProfile() const
const KoColorProfile * p2020PQProfile() const
const KoColorProfile * p2020G10Profile() const

References d, KoGenericRegistry< T >::get(), KoColorSpaceEngine::getProfile(), KoColorSpaceEngineRegistry::instance(), p2020G10Profile(), p2020PQProfile(), p709G10Profile(), p709SRGBProfile(), PRIMARIES_ITU_R_BT_2020_2_AND_2100_0, PRIMARIES_ITU_R_BT_709_5, TRC_IEC_61966_2_1, TRC_ITU_R_BT_2100_0_PQ, and TRC_LINEAR.

◆ profileForCsIdWithFallbackImpl()

const KoColorProfile * KoColorSpaceRegistry::profileForCsIdWithFallbackImpl ( const QString & csID,
const QString & profileName )

◆ profileIsCompatible()

bool KoColorSpaceRegistry::profileIsCompatible ( const KoColorProfile * profile,
const QString & colorSpaceId )

Definition at line 299 of file KoColorSpaceRegistry.cpp.

300{
301 QReadLocker l(&d->registrylock);
302 KoColorSpaceFactory *csf = d->colorSpaceFactoryRegistry.value(colorSpaceId);
303
304 return csf ? csf->profileIsCompatible(profile) : false;
305}
virtual bool profileIsCompatible(const KoColorProfile *profile) const =0

References colorSpaceId(), d, and KoColorSpaceFactory::profileIsCompatible().

◆ profilesFor()

QList< const KoColorProfile * > KoColorSpaceRegistry::profilesFor ( const QString & csID) const

Return the list of profiles for a colorspace with the argument id. Profiles will not work with any color space, you can query which profiles that are registered with this registry can be used in combination with the argument factory.

Parameters
colorSpaceIdthe colorspace-id with which all the returned profiles will work.
Returns
a list of profiles for the factory

Definition at line 278 of file KoColorSpaceRegistry.cpp.

279{
280 QReadLocker l(&d->registrylock);
281 return d->profileStorage.profilesFor(d->colorSpaceFactoryRegistry.value(csID));
282}

References d.

◆ remove()

void KoColorSpaceRegistry::remove ( KoColorSpaceFactory * item)

Remove a color space factory from the registry. Note that it is the responsibility of the caller to ensure that the colorspaces are not used anymore.

Definition at line 239 of file KoColorSpaceRegistry.cpp.

240{
241 QWriteLocker l(&d->registrylock);
242
243 QList<QString> toremove;
244 Q_FOREACH (const KoColorSpace * cs, d->csMap) {
245 if (cs->id() == item->id()) {
246 toremove.push_back(d->idsToCacheName(cs->id(), cs->profile()->name()));
247 cs->d->deletability = OwnedByRegistryRegistryDeletes;
248 }
249 }
250
251 Q_FOREACH (const QString& id, toremove) {
252 d->csMap.remove(id);
253 // TODO: should not it delete the color space when removing it from the map ?
254 }
255 d->colorSpaceFactoryRegistry.remove(item->id());
256}

References KoColorSpace::d, d, KoColorSpace::id, KoColorSpaceFactory::id(), KoColorProfile::name, OwnedByRegistryRegistryDeletes, and KoColorSpace::profile().

◆ removeProfile()

void KoColorSpaceRegistry::removeProfile ( KoColorProfile * profile)

Definition at line 328 of file KoColorSpaceRegistry.cpp.

329{
330 d->profileStorage.removeProfile(profile);
331 // FIXME: how about removing it from conversion system?
332}

References d.

◆ rgb16() [1/2]

const KoColorSpace * KoColorSpaceRegistry::rgb16 ( const KoColorProfile * profile)

Convenience method to get an RGBA 16bit colorspace with the given profile.

Parameters
profilean RGB profile
Returns
the wanted colorspace, or 0 if the color space and profile can not be combined.

Definition at line 648 of file KoColorSpaceRegistry.cpp.

649{
650 return d->colorSpace1(KoRgbU16ColorSpace::colorSpaceId(), profile);
651}
static QString colorSpaceId()

References KoRgbU16ColorSpace::colorSpaceId(), and d.

◆ rgb16() [2/2]

const KoColorSpace * KoColorSpaceRegistry::rgb16 ( const QString & profileName = QString())

Convenience method to get an RGBA 16bit colorspace. If a profile is not specified, an sRGB profile will be used.

Parameters
profileNamethe name of an RGB color profile
Returns
the wanted colorspace, or 0 if the color space and profile can not be combined.

Definition at line 643 of file KoColorSpaceRegistry.cpp.

644{
645 return d->colorSpace1(KoRgbU16ColorSpace::colorSpaceId(), profileName);
646}

References KoRgbU16ColorSpace::colorSpaceId(), and d.

◆ rgb8() [1/2]

const KoColorSpace * KoColorSpaceRegistry::rgb8 ( const KoColorProfile * profile)

Convenience method to get an RGBA 8bit colorspace with the given profile.

Parameters
profilean RGB profile
Returns
the wanted colorspace, or 0 if the color space and profile can not be combined.

Definition at line 631 of file KoColorSpaceRegistry.cpp.

632{
633 if (profile == 0) {
634 if (!d->rgbU8sRGB) {
635 d->rgbU8sRGB = d->colorSpace1(KoRgbU8ColorSpace::colorSpaceId());
636 }
637 Q_ASSERT(d->rgbU8sRGB);
638 return d->rgbU8sRGB;
639 }
640 return d->colorSpace1(KoRgbU8ColorSpace::colorSpaceId(), profile);
641}
static QString colorSpaceId()

References KoRgbU8ColorSpace::colorSpaceId(), and d.

◆ rgb8() [2/2]

const KoColorSpace * KoColorSpaceRegistry::rgb8 ( const QString & profileName = QString())

Convenience method to get an RGBA 8bit colorspace. If a profile is not specified, an sRGB profile will be used.

Parameters
profileNamethe name of an RGB color profile
Returns
the wanted colorspace, or 0 if the color space and profile can not be combined.

Definition at line 619 of file KoColorSpaceRegistry.cpp.

620{
621 if (profileName.isEmpty()) {
622 if (!d->rgbU8sRGB) {
623 d->rgbU8sRGB = d->colorSpace1(KoRgbU8ColorSpace::colorSpaceId());
624 }
625 Q_ASSERT(d->rgbU8sRGB);
626 return d->rgbU8sRGB;
627 }
628 return d->colorSpace1(KoRgbU8ColorSpace::colorSpaceId(), profileName);
629}

References KoRgbU8ColorSpace::colorSpaceId(), and d.

Friends And Related Symbol Documentation

◆ FriendOfColorSpaceRegistry

friend struct FriendOfColorSpaceRegistry
friend

Definition at line 391 of file KoColorSpaceRegistry.h.

◆ KisCrashFilterTest

friend class KisCrashFilterTest
friend

Definition at line 387 of file KoColorSpaceRegistry.h.

◆ KisCsConversionTest

friend class KisCsConversionTest
friend

Definition at line 383 of file KoColorSpaceRegistry.h.

◆ KisIteratorNGTest

friend class KisIteratorNGTest
friend

Definition at line 385 of file KoColorSpaceRegistry.h.

◆ KisIteratorTest

friend class KisIteratorTest
friend

Definition at line 384 of file KoColorSpaceRegistry.h.

◆ KisPainterTest

friend class KisPainterTest
friend

Definition at line 386 of file KoColorSpaceRegistry.h.

◆ KoColorSpacesBenchmark

friend class KoColorSpacesBenchmark
friend

Definition at line 388 of file KoColorSpaceRegistry.h.

◆ TestColorConversionSystem

friend class TestColorConversionSystem
friend

Definition at line 390 of file KoColorSpaceRegistry.h.

◆ TestKoColorSpaceSanity

friend class TestKoColorSpaceSanity
friend

Definition at line 389 of file KoColorSpaceRegistry.h.

Member Data Documentation

◆ alphaCs

const KoColorSpace* KoColorSpaceRegistry::alphaCs {nullptr}

Definition at line 61 of file KoColorSpaceRegistry.cpp.

61{nullptr};

◆ alphaF32Cs

const KoColorSpace* KoColorSpaceRegistry::alphaF32Cs {nullptr}

Definition at line 66 of file KoColorSpaceRegistry.cpp.

66{nullptr};

◆ alphaU16Cs

const KoColorSpace* KoColorSpaceRegistry::alphaU16Cs {nullptr}

Definition at line 62 of file KoColorSpaceRegistry.cpp.

62{nullptr};

◆ colorConversionCache

KoColorConversionCache * KoColorSpaceRegistry::colorConversionCache {nullptr}

Definition at line 58 of file KoColorSpaceRegistry.cpp.

58{nullptr};

◆ colorConversionSystem

const KoColorConversionSystem * KoColorSpaceRegistry::colorConversionSystem {nullptr}

Definition at line 57 of file KoColorSpaceRegistry.cpp.

57{nullptr};

◆ colorSpaceFactoryRegistry

KoGenericRegistry<KoColorSpaceFactory *> KoColorSpaceRegistry::colorSpaceFactoryRegistry

Definition at line 53 of file KoColorSpaceRegistry.cpp.

◆ conversionSystemInterface

QScopedPointer<ConversionSystemInterface> KoColorSpaceRegistry::conversionSystemInterface

Definition at line 56 of file KoColorSpaceRegistry.cpp.

◆ csMap

QHash<QString, const KoColorSpace *> KoColorSpaceRegistry::csMap

Definition at line 55 of file KoColorSpaceRegistry.cpp.

◆ d

Private* const KoColorSpaceRegistry::d
private

Definition at line 414 of file KoColorSpaceRegistry.h.

◆ lab16sLAB

const KoColorSpace* KoColorSpaceRegistry::lab16sLAB {nullptr}

Definition at line 60 of file KoColorSpaceRegistry.cpp.

60{nullptr};

◆ profileStorage

KoColorProfileStorage KoColorSpaceRegistry::profileStorage

Definition at line 54 of file KoColorSpaceRegistry.cpp.

◆ q

KoColorSpaceRegistry* KoColorSpaceRegistry::q {nullptr}

Definition at line 51 of file KoColorSpaceRegistry.cpp.

51{nullptr};

◆ registrylock

QReadWriteLock KoColorSpaceRegistry::registrylock

Definition at line 67 of file KoColorSpaceRegistry.cpp.

◆ rgbU8sRGB

const KoColorSpace* KoColorSpaceRegistry::rgbU8sRGB {nullptr}

Definition at line 59 of file KoColorSpaceRegistry.cpp.

59{nullptr};

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