Krita Source Code Documentation
Loading...
Searching...
No Matches
KoSimpleColorSpaceFactory.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2002 Patrick Julien <freak@codepimps.org>
3 * SPDX-FileCopyrightText: 2005-2006 C. Boemann <cbo@boemann.dk>
4 * SPDX-FileCopyrightText: 2004, 2006-2007 Cyrille Berger <cberger@cberger.net>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 */
8
9#ifndef KOSIMPLECOLORSPACEFACTORY_H_
10#define KOSIMPLECOLORSPACEFACTORY_H_
11
14
16
18{
19
20public:
21
22 KoSimpleColorSpaceFactory(const QString& id,
23 const QString& name,
24 bool userVisible,
25 const KoID& colorModelId,
26 const KoID& colorDepthId,
27 int referenceDepth = -1,
28 int crossingCost = 1)
29 : m_id(id)
30 , m_name(name)
36 {
37 if (m_referenceDepth >= 0) {
38 // noop, already initialized!
40 m_referenceDepth = 1 * 8;
42 m_referenceDepth = 2 * 8;
44 m_referenceDepth = 2 * 8;
46 m_referenceDepth = 4 * 8;
48 m_referenceDepth = 8 * 8;
49 }
50 }
51
52
53 QString id() const override {
54 return m_id;
55 }
56
57 QString name() const override {
58 return m_name;
59 }
60
61 bool userVisible() const override {
62 return m_userVisible;
63 }
64
65 KoID colorModelId() const override {
66 return m_colorModelId;
67 }
68
69 KoID colorDepthId() const override {
70 return m_colorDepthId;
71 }
72
73 bool profileIsCompatible(const KoColorProfile* profile) const override {
74 return dynamic_cast<const KoDummyColorProfile*>(profile);
75 }
76
77 QString colorSpaceEngine() const override {
78 return "simple";
79 }
80
81 bool isHdr() const override {
82 return false;
83 }
84
85 int referenceDepth() const override {
86 return m_referenceDepth;
87 }
88
89 int crossingCost() const override {
90 return m_crossingCost;
91 }
92
96
97 QString defaultProfile() const override {
98 return QString("default");
99 }
100protected:
101 KoColorProfile* createColorProfile(const QByteArray& /*rawData*/) const override {
102 return 0;
103 }
104private:
105
106 QString m_id;
107 QString m_name;
113
114};
115
116#endif
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
KoColorProfile * createColorProfile(const QByteArray &) const override
QString defaultProfile() const override
KoSimpleColorSpaceFactory(const QString &id, const QString &name, bool userVisible, const KoID &colorModelId, const KoID &colorDepthId, int referenceDepth=-1, int crossingCost=1)
QList< KoColorConversionTransformationFactory * > colorConversionLinks() const override
bool profileIsCompatible(const KoColorProfile *profile) const override
QString colorSpaceEngine() const override