Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorConversionTransformationFactory.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2007 Cyrille Berger <cberger@cberger.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
8
9#include <QString>
10
11#include "KoColorProfile.h"
12#include "KoColorSpace.h"
13#include "DebugPigment.h"
15
17 QString srcModelId;
18 QString srcDepthId;
19 QString dstModelId;
20 QString dstDepthId;
21 QString srcProfile;
22 QString dstProfile;
23};
24
25KoColorConversionTransformationFactory::KoColorConversionTransformationFactory(const QString &_srcModelId, const QString &_srcDepthId, const QString &_srcProfile, const QString &_dstModelId, const QString &_dstDepthId, const QString &_dstProfile) : 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}
34
39
41{
42 return ((srcCS->colorModelId().id() == d->srcModelId)
43 && (srcCS->colorDepthId().id() == d->srcDepthId)
44 && (d->srcProfile == "" || srcCS->profile()->name() == d->srcProfile));
45}
46
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}
54
56{
57 return d->srcModelId;
58}
60{
61 return d->srcDepthId;
62}
63
65{
66 return d->srcProfile;
67}
68
70{
71 return d->dstModelId;
72}
74{
75 return d->dstDepthId;
76}
77
79{
80 return d->dstProfile;
81}
82
#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
KoColorConversionTransformationFactory(const QString &_srcModelId, const QString &_srcDepthId, const QString &_srcProfile, const QString &_dstModelId, const QString &_dstDepthId, const QString &_dstProfile)
static KoColorSpaceRegistry * instance()
QString profileAlias(const QString &name) const