Krita Source Code Documentation
Loading...
Searching...
No Matches
RgbF32ColorSpace.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006 Cyrille Berger <cberger@cberger.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef KORGBF32COLORSPACE_H_
8#define KORGBF32COLORSPACE_H_
9
10#include "LcmsColorSpace.h"
12
13struct KoRgbF32Traits;
14
15class RgbF32ColorSpace : public LcmsColorSpace<KoRgbF32Traits>
16{
17public:
18 RgbF32ColorSpace(const QString &name, KoColorProfile *p);
19
20 bool willDegrade(ColorSpaceIndependence independence) const override;
21
22 KoID colorModelId() const override
23 {
24 return RGBAColorModelID;
25 }
26
27 KoID colorDepthId() const override
28 {
30 }
31
32 virtual KoColorSpace *clone() const;
33
34 void colorToXML(const quint8 *pixel, QDomDocument &doc, QDomElement &colorElt) const override;
35
36 void colorFromXML(quint8* pixel, const QDomElement& elt) const override;
37 void toHSY(const QVector<double> &channelValues, qreal *hue, qreal *sat, qreal *luma) const override;
38 QVector <double> fromHSY(qreal *hue, qreal *sat, qreal *luma) const override;
39 void toYUV(const QVector<double> &channelValues, qreal *y, qreal *u, qreal *v) const override;
40 QVector <double> fromYUV(qreal *y, qreal *u, qreal *v) const override;
41
42 static QString colorSpaceId()
43 {
44 return QStringLiteral("RGBAF32");
45 }
46
47 bool hasHighDynamicRange() const override
48 {
49 return true;
50 }
51
52 void fillGrayBrushWithColorAndLightnessOverlay(quint8 *dst, const QRgb *brush, quint8 *brushColor, qint32 nPixels) const override;
53 void fillGrayBrushWithColorAndLightnessWithStrength(quint8* dst, const QRgb* brush, quint8* brushColor, qreal strength, qint32 nPixels) const override;
54 void modulateLightnessByGrayBrush(quint8 *dst, const QRgb *brush, qreal strength, qint32 nPixels) const override;
55};
56
58{
59public:
61 : LcmsColorSpaceFactory(TYPE_RGBA_FLT, cmsSigRgbData)
62 {
63 }
64
65 QString id() const override
66 {
68 }
69
70 QString name() const override
71 {
72 return QString("%1 (%2)").arg(RGBAColorModelID.name()).arg(Float32BitsColorDepthID.name());
73 }
74
75 bool userVisible() const override
76 {
77 return true;
78 }
79
80 KoID colorModelId() const override
81 {
82 return RGBAColorModelID;
83 }
84
85 KoID colorDepthId() const override
86 {
88 }
89
90 int referenceDepth() const override
91 {
92 return 32;
93 }
94
96 {
97 return new RgbF32ColorSpace(name(), p->clone());
98 }
99
100 QString defaultProfile() const override
101 {
102 return "sRGB-elle-V2-g10.icc";
103 }
104
105 bool isHdr() const override
106 {
107 return true;
108 }
109
111
112};
113
114#endif
const Params2D p
qreal v
qreal u
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
ColorSpaceIndependence
Definition KoID.h:30
QString name() const
Definition KoID.cpp:68
int referenceDepth() const override
QList< KoColorConversionTransformationFactory * > colorConversionLinksFromProfile(const KoColorProfile *profile) const override
colorConversionLinksFromProfile Sometimes, we need to generate special color conversion links based o...
QString id() const override
bool userVisible() const override
KoID colorModelId() const override
QString name() const override
bool isHdr() const override
KoID colorDepthId() const override
KoColorSpace * createColorSpace(const KoColorProfile *p) const override
QString defaultProfile() const override
static QString colorSpaceId()
QVector< double > fromHSY(qreal *hue, qreal *sat, qreal *luma) const override
virtual KoColorSpace * clone() const
void modulateLightnessByGrayBrush(quint8 *dst, const QRgb *brush, qreal strength, qint32 nPixels) const override
void toHSY(const QVector< double > &channelValues, qreal *hue, qreal *sat, qreal *luma) const override
KoID colorDepthId() const override
void colorFromXML(quint8 *pixel, const QDomElement &elt) const override
RgbF32ColorSpace(const QString &name, KoColorProfile *p)
KoID colorModelId() const override
void fillGrayBrushWithColorAndLightnessWithStrength(quint8 *dst, const QRgb *brush, quint8 *brushColor, qreal strength, qint32 nPixels) const override
bool hasHighDynamicRange() const override
void fillGrayBrushWithColorAndLightnessOverlay(quint8 *dst, const QRgb *brush, quint8 *brushColor, qint32 nPixels) const override
void colorToXML(const quint8 *pixel, QDomDocument &doc, QDomElement &colorElt) const override
void toYUV(const QVector< double > &channelValues, qreal *y, qreal *u, qreal *v) const override
bool willDegrade(ColorSpaceIndependence independence) const override
QVector< double > fromYUV(qreal *y, qreal *u, qreal *v) const override
unsigned int QRgb