Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorConversionSystem.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2007-2008 Cyrille Berger <cberger@cberger.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef _KO_COLOR_CONVERSION_SYSTEM_H_
8#define _KO_COLOR_CONVERSION_SYSTEM_H_
9
10class KoColorProfile;
12class KoColorSpace;
15class KoID;
16
18
19#include <QList>
20#include <QPair>
21
22#include "kritapigment_export.h"
23
33class KRITAPIGMENT_EXPORT KoColorConversionSystem
34{
35public:
37 virtual ~RegistryInterface() {}
38
39 virtual const KoColorSpace * colorSpace(const QString & colorModelId, const QString & colorDepthId, const QString &profileName) = 0;
40 virtual const KoColorSpaceFactory* colorSpaceFactory(const QString &colorModelId, const QString &colorDepthId) const = 0;
43 };
44
45public:
46 struct Node;
47 struct Vertex;
48 struct NodeKey;
50 struct Path;
57
70 void insertColorSpace(const KoColorSpaceFactory *csf);
71
84 void insertColorProfile(const KoColorProfile *profile);
85
100 QList<KoColorProfileQuery> requiredConnectionProfilesFor(const KoColorSpaceFactory* csf);
101
116 QList<KoColorProfileQuery> requiredConnectionProfilesFor(const KoColorProfile* profile);
117
123 KoColorConversionTransformation* createColorConverter(const KoColorSpace * srcColorSpace, const KoColorSpace * dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const;
124
142 void createColorConverters(const KoColorSpace* colorSpace, const QList< QPair<KoID, KoID> >& possibilities, KoColorConversionTransformation*& fromCS, KoColorConversionTransformation*& toCS) const;
143public:
148 QString toDot() const;
154 QString bestPathToDot(const QString& srcKey, const QString& dstKey) const;
155public:
159 bool existsPath(const QString& srcModelId, const QString& srcDepthId, const QString& srcProfileName, const QString& dstModelId, const QString& dstDepthId, const QString& dstProfileName) const;
163 bool existsGoodPath(const QString& srcModelId, const QString& srcDepthId, const QString& srcProfileName, const QString& dstModelId, const QString& dstDepthId, const QString& dstProfileName) const;
164
169 Path findBestPath(const QString& srcModelId, const QString& srcDepthId, const QString& srcProfileName, const QString& dstModelId, const QString& dstDepthId, const QString& dstProfileName) const;
170
175 Path findBestPath(const NodeKey &src, const NodeKey &dst) const;
176private:
177 QString vertexToDot(Vertex* v, const QString &options) const;
178private:
182 Node* insertEngine(const KoColorSpaceEngine* engine);
183 KoColorConversionTransformation* createTransformationFromPath(const KoColorConversionSystem::Path& path, const KoColorSpace* srcColorSpace, const KoColorSpace* dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const;
188 const KoColorSpace* defaultColorSpaceForNode(const Node* node) const;
192 Node* createNode(const QString& _modelId, const QString& _depthId, const QString& _profileName);
196 void connectToEngine(Node* _node, Node* _engine);
197 const Node* nodeFor(const KoColorSpace*) const;
201 Node* nodeFor(const NodeKey& key);
202 const Node* nodeFor(const NodeKey& key) const;
206 QList<Node*> nodesFor(const QString& _modelId, const QString& _depthId);
210 Node* nodeFor(const QString& colorModelId, const QString& colorDepthId, const QString& _profileName);
211 const Node* nodeFor(const QString& colorModelId, const QString& colorDepthId, const QString& _profileName) const;
215 Vertex* vertexBetween(Node* srcNode, Node* dstNode);
219 Vertex* createVertex(Node* srcNode, Node* dstNode);
223 Path findBestPath(const Node* srcNode, const Node* dstNode) const;
228
229private:
230 struct Private;
231 Private* const d;
232};
233
234#endif
qreal v
uint qHash(const KoInputDevice &key)
unsigned int uint
void deletePaths(QList< KoColorConversionSystem::Path * > paths) const
Definition KoID.h:30
virtual const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const QString &profileName)=0
virtual QList< const KoColorProfile * > profilesFor(const KoColorSpaceFactory *csf) const =0
virtual QList< const KoColorSpaceFactory * > colorSpacesFor(const KoColorProfile *profile) const =0
virtual const KoColorSpaceFactory * colorSpaceFactory(const QString &colorModelId, const QString &colorDepthId) const =0
The KoColorProfileQuery struct.