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;
11class KoColorSpace;
14class KoID;
15
17
18#include <QList>
19#include <QPair>
20
21#include "kritapigment_export.h"
22
32class KRITAPIGMENT_EXPORT KoColorConversionSystem
33{
34public:
36 virtual ~RegistryInterface() {}
37
38 virtual const KoColorSpace * colorSpace(const QString & colorModelId, const QString & colorDepthId, const QString &profileName) = 0;
39 virtual const KoColorSpaceFactory* colorSpaceFactory(const QString &colorModelId, const QString &colorDepthId) const = 0;
42 };
43
44public:
45 struct Node;
46 struct Vertex;
47 struct NodeKey;
49 struct Path;
60 void insertColorSpace(const KoColorSpaceFactory*);
61
62 void insertColorProfile(const KoColorProfile*);
68 KoColorConversionTransformation* createColorConverter(const KoColorSpace * srcColorSpace, const KoColorSpace * dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const;
69
87 void createColorConverters(const KoColorSpace* colorSpace, const QList< QPair<KoID, KoID> >& possibilities, KoColorConversionTransformation*& fromCS, KoColorConversionTransformation*& toCS) const;
88public:
93 QString toDot() const;
99 QString bestPathToDot(const QString& srcKey, const QString& dstKey) const;
100public:
104 bool existsPath(const QString& srcModelId, const QString& srcDepthId, const QString& srcProfileName, const QString& dstModelId, const QString& dstDepthId, const QString& dstProfileName) const;
108 bool existsGoodPath(const QString& srcModelId, const QString& srcDepthId, const QString& srcProfileName, const QString& dstModelId, const QString& dstDepthId, const QString& dstProfileName) const;
109
114 Path findBestPath(const QString& srcModelId, const QString& srcDepthId, const QString& srcProfileName, const QString& dstModelId, const QString& dstDepthId, const QString& dstProfileName) const;
115
120 Path findBestPath(const NodeKey &src, const NodeKey &dst) const;
121private:
122 QString vertexToDot(Vertex* v, const QString &options) const;
123private:
127 Node* insertEngine(const KoColorSpaceEngine* engine);
128 KoColorConversionTransformation* createTransformationFromPath(const KoColorConversionSystem::Path& path, const KoColorSpace* srcColorSpace, const KoColorSpace* dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const;
133 const KoColorSpace* defaultColorSpaceForNode(const Node* node) const;
137 Node* createNode(const QString& _modelId, const QString& _depthId, const QString& _profileName);
141 void connectToEngine(Node* _node, Node* _engine);
142 const Node* nodeFor(const KoColorSpace*) const;
146 Node* nodeFor(const NodeKey& key);
147 const Node* nodeFor(const NodeKey& key) const;
151 QList<Node*> nodesFor(const QString& _modelId, const QString& _depthId);
155 Node* nodeFor(const QString& colorModelId, const QString& colorDepthId, const QString& _profileName);
156 const Node* nodeFor(const QString& colorModelId, const QString& colorDepthId, const QString& _profileName) const;
160 Vertex* vertexBetween(Node* srcNode, Node* dstNode);
164 Vertex* createVertex(Node* srcNode, Node* dstNode);
168 Path findBestPath(const Node* srcNode, const Node* dstNode) const;
173
174private:
175 struct Private;
176 Private* const d;
177};
178
179#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