Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorSpaceRegistry.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2003 Patrick Julien <freak@codepimps.org>
3 * SPDX-FileCopyrightText: 2004, 2010 Cyrille Berger <cberger@cberger.net>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#ifndef KOCOLORSPACEREGISTRY_H
9#define KOCOLORSPACEREGISTRY_H
10
11#include <QObject>
12#include <QList>
13#include <QString>
14#include "kritapigment_export.h"
15
16#include <KoGenericRegistry.h>
17#include <KoColorSpace.h>
18#include <KoColorSpaceFactory.h>
19#include <KoConfig.h>
21
22class KoColorProfile;
26
51class KRITAPIGMENT_EXPORT KoColorSpaceRegistry
52{
53public:
55
57 OnlyUserVisible = 1,
58 AllColorSpaces = 4
59 };
61 OnlyDefaultProfile = 1,
62 AllProfiles = 4
63 };
64
70
71 virtual ~KoColorSpaceRegistry();
72
73public:
78 void add(KoColorSpaceFactory* item);
79
85 void remove(KoColorSpaceFactory* item);
86
92 void addProfileToMap(KoColorProfile *p);
93
99 void addProfile(KoColorProfile* profile);
100 void addProfile(const KoColorProfile* profile); // TODO why ?
101 void removeProfile(KoColorProfile* profile);
102
107 void addProfileAlias(const QString& name, const QString& to);
108
112 QString profileAlias(const QString& name) const;
113
117 const KoColorProfile *createColorProfile(const QString & colorModelId, const QString & colorDepthId, const QByteArray& rawData);
118
126 const KoColorProfile * profileByName(const QString & name) const ;
127
128
136 const KoColorProfile *profileByUniqueId(const QByteArray &id) const;
137
138 bool profileIsCompatible(const KoColorProfile* profile, const QString &colorSpaceId);
139
148 QList<const KoColorProfile *> profilesFor(const QString& csID) const;
149 QString defaultProfileForColorSpace(const QString &colorSpaceId) const;
150
156 KoColorConversionTransformation* createColorConverter(const KoColorSpace * srcColorSpace, const KoColorSpace * dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const;
157
175 void createColorConverters(const KoColorSpace* colorSpace, const QList< QPair<KoID, KoID> >& possibilities, KoColorConversionTransformation*& fromCS, KoColorConversionTransformation*& toCS) const;
176
183 const KoColorSpace * colorSpace(const QString & colorModelId, const QString & colorDepthId, const KoColorProfile *profile);
184
190 const KoColorSpace * colorSpace(const QString & colorModelId, const QString & colorDepthId, const QString &profileName);
191
192 const KoColorSpace * colorSpace(const QString & colorModelId, const QString & colorDepthId);
193
200 QString colorSpaceId(const QString & colorModelId, const QString & colorDepthId) const;
208 QString colorSpaceId(const KoID& colorModelId, const KoID& colorDepthId) const;
209
216 KoID colorSpaceColorModelId(const QString & _colorSpaceId) const;
217
224 KoID colorSpaceColorDepthId(const QString & _colorSpaceId) const;
225
229 const KoColorSpace *alpha8();
230 const KoColorSpace *alpha16();
231#ifdef HAVE_OPENEXR
232 const KoColorSpace *alpha16f();
233#endif
234 const KoColorSpace *alpha32f();
235
242 const KoColorSpace *graya8(const QString &profile = QString());
243
250 const KoColorSpace *graya8(const KoColorProfile *profile);
251
258 const KoColorSpace *graya16(const QString &profile = QString());
259
266 const KoColorSpace *graya16(const KoColorProfile *profile);
267
268
275 const KoColorSpace * rgb8(const QString &profileName = QString());
276
282 const KoColorSpace * rgb8(const KoColorProfile * profile);
283
290 const KoColorSpace * rgb16(const QString &profileName = QString());
291
297 const KoColorSpace * rgb16(const KoColorProfile * profile);
298
305 const KoColorSpace * lab16(const QString &profileName = QString());
306
312 const KoColorSpace * lab16(const KoColorProfile * profile);
313
318 const KoColorProfile *p2020G10Profile() const;
319
323 const KoColorProfile *p2020PQProfile() const;
324
329 const KoColorProfile *p709G10Profile() const;
330
335 const KoColorProfile *p709SRGBProfile() const;
336
347 const KoColorProfile *profileFor(const QVector<double> &colorants, ColorPrimaries colorPrimaries, TransferCharacteristics transferFunction) const;
348
352 QList<KoID> colorModelsList(ColorSpaceListVisibility option) const;
353
357 QList<KoID> colorDepthList(const KoID& colorModelId, ColorSpaceListVisibility option) const;
358
362 QList<KoID> colorDepthList(const QString & colorModelId, ColorSpaceListVisibility option) const;
363
368
373 const KoColorSpace* permanentColorspace(const KoColorSpace* _colorSpace);
374
379 QList<KoID> listKeys() const;
380
381private:
382
383 friend class KisCsConversionTest;
384 friend class KisIteratorTest;
385 friend class KisIteratorNGTest;
386 friend class KisPainterTest;
387 friend class KisCrashFilterTest;
389 friend class TestKoColorSpaceSanity;
390 friend class TestColorConversionSystem;
391 friend struct FriendOfColorSpaceRegistry;
392
397
406
407private:
410 void init();
411
412private:
413 struct Private;
414 Private * const d;
415};
416
417#endif // KOCOLORSPACEREGISTRY_H
const Params2D p
ColorPrimaries
The colorPrimaries enum Enum of colorants, follows ITU H.273 for values 0 to 255, and has extra known...
TransferCharacteristics
The transferCharacteristics enum Enum of transfer characteristics, follows ITU H.273 for values 0 to ...
PythonPluginManager * instance
Definition KoID.h:30
const KoColorConversionSystem * colorConversionSystem() const
KoColorConversionCache * colorConversionCache() const
KoColorSpaceRegistry operator=(const KoColorSpaceRegistry &)
KoColorSpaceRegistry(const KoColorSpaceRegistry &)