Krita Source Code Documentation
Loading...
Searching...
No Matches
KoColorProfile Class Referenceabstract

#include <KoColorProfile.h>

+ Inheritance diagram for KoColorProfile:

Public Member Functions

virtual KoColorProfileclone () const =0
 
virtual QString colorModelID () const
 
virtual bool compareTRC (TransferCharacteristics characteristics, float error) const =0
 
QString copyright () const
 
virtual void delinearizeFloatValue (QVector< qreal > &Value) const =0
 
virtual void delinearizeFloatValueFast (QVector< qreal > &Value) const =0
 
QString fileName () const
 
virtual QVector< KoColorimetryUtils::xyYgetColorantsxyY () const =0
 
virtual QVector< KoColorimetryUtils::XYZgetColorantsXYZ () const =0
 
virtual ColorPrimaries getColorPrimaries () const
 getColorPrimaries
 
virtual QVector< qreal > getEstimatedTRC () const =0
 
virtual TransferCharacteristics getTransferCharacteristics () const
 getTransferCharacteristics This function should be subclassed at some point so we can get the value from the lcms profile.
 
virtual KoColorimetryUtils::xyY getWhitePointxyY () const =0
 
virtual KoColorimetryUtils::XYZ getWhitePointXYZ () const =0
 
virtual bool hasColorants () const =0
 
virtual bool hasTRC () const =0
 
QString info () const
 
virtual bool isLinear () const =0
 
virtual bool isSuitableForDisplay () const =0
 
virtual bool isSuitableForInput () const =0
 
virtual bool isSuitableForOutput () const =0
 
virtual bool isSuitableForPrinting () const =0
 
virtual bool isSuitableForWorkspace () const =0
 
 KoColorProfile (const KoColorProfile &profile)
 
 KoColorProfile (const QString &fileName=QString())
 
virtual void linearizeFloatValue (QVector< qreal > &Value) const =0
 
virtual void linearizeFloatValueFast (QVector< qreal > &Value) const =0
 
virtual bool load ()
 
QString manufacturer () const
 
QString name () const
 
virtual bool operator== (const KoColorProfile &) const =0
 
virtual QByteArray rawData () const
 
virtual bool save (const QString &fileName)
 
void setFileName (const QString &filename)
 
virtual bool supportsAbsolute () const =0
 
virtual bool supportsPerceptual () const =0
 
virtual bool supportsRelative () const =0
 
virtual bool supportsSaturation () const =0
 
virtual QString type () const
 
virtual QByteArray uniqueId () const =0
 
virtual bool valid () const =0
 
virtual float version () const =0
 
virtual ~KoColorProfile ()
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 

Static Public Member Functions

static void colorantsForType (ColorPrimaries primaries, KoColorimetryUtils::xy &whitePoint, QList< KoColorimetryUtils::xy > &colorants, const bool prequantized=false)
 colorantsForPrimaries fills a QVector<float> with the xy values of the whitepoint and red, green, blue colorants for a given predefined value. Will not change the vector when the primaries are set to 'undefined'.
 
static QString getColorPrimariesName (ColorPrimaries primaries)
 getColorPrimariesName
 
static QString getTransferCharacteristicName (TransferCharacteristics curve)
 getTransferCharacteristicName
 

Public Attributes

TransferCharacteristics characteristics {TRC_UNSPECIFIED}
 
QString copyright
 
QString fileName
 
QString info
 
QString manufacturer
 
QString name
 
int primaries {-1}
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 

Protected Member Functions

void setCharacteristics (ColorPrimaries primaries, TransferCharacteristics curve)
 setCharacteristics ideally, we'd read this from the icc profile curve, but that can be tricky, instead we'll set it on profile creation.
 
void setCopyright (const QString &copyright)
 
void setInfo (const QString &info)
 
void setManufacturer (const QString &manufacturer)
 
void setName (const QString &name)
 

Private Attributes

Private *const d
 

Detailed Description

Contains information needed for color transformation.

Definition at line 15 of file KoColorProfile.cpp.

Constructor & Destructor Documentation

◆ KoColorProfile() [1/2]

KoColorProfile::KoColorProfile ( const QString & fileName = QString())
explicit
Parameters
fileNamefile name to load or save that profile

Definition at line 25 of file KoColorProfile.cpp.

25 : d(new Private)
26{
27// dbgPigment <<" Profile filename =" << fileName;
28 d->fileName = fileName;
29}
Private *const d

References d, and fileName.

◆ KoColorProfile() [2/2]

KoColorProfile::KoColorProfile ( const KoColorProfile & profile)

Definition at line 31 of file KoColorProfile.cpp.

32 : d(new Private(*profile.d))
33{
34}

◆ ~KoColorProfile()

KoColorProfile::~KoColorProfile ( )
virtual

Definition at line 36 of file KoColorProfile.cpp.

37{
38 delete d;
39}

References d.

Member Function Documentation

◆ clone()

virtual KoColorProfile * KoColorProfile::clone ( ) const
pure virtual

Create a copy of this profile. Data that shall not change during the life time of the profile shouldn't be duplicated but shared, like for instance ICC data.

Data that shall be changed like a palette or hdr information such as exposure must be duplicated while cloning.

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ colorantsForType()

void KoColorProfile::colorantsForType ( ColorPrimaries primaries,
KoColorimetryUtils::xy & whitePoint,
QList< KoColorimetryUtils::xy > & colorants,
const bool prequantized = false )
static

colorantsForPrimaries fills a QVector<float> with the xy values of the whitepoint and red, green, blue colorants for a given predefined value. Will not change the vector when the primaries are set to 'undefined'.

Parameters
primariespredefined value.
whitePointthe white point to fill.
colorantsthe vector to fill.
prequantizedwhether to get the prequantized values, these are used for precision when encoding to icc only.

Definition at line 166 of file KoColorProfile.cpp.

170{
172 switch (ColorPrimaries(primaries)) {
174 break;
176 // Unquantized.
178 whitePoint = c.white().toxy();
179 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
180 //Illuminant C
181 break;
183 // Unquantized.
185 whitePoint = c.white().toxy();
186 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
187 break;
190 whitePoint = c.white().toxy();
191 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
192 break;
194 whitePoint = {0.3127, 0.3290};
195 colorants = {{0.630, 0.340}};
196 colorants.append({0.310, 0.595});
197 colorants.append({0.155, 0.070});
198 break;
201 whitePoint = c.white().toxy();
202 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
203 //Illuminant C
204 break;
206 //prequantization courtesy of Elle Stone.
207
208 if (prequantized) {
209 whitePoint = {0.3127, 0.3290};
210 colorants = {{0.708012540607, 0.291993664388}};
211 colorants.append({0.169991652439, 0.797007778423});
212 colorants.append({0.130997824007, 0.045996550894});
213 } else {
215 whitePoint = c.white().toxy();
216 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
217 }
218 break;
221 whitePoint = c.white().toxy();
222 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
223 break;
226 whitePoint = c.white().toxy();
227 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
228 break;
231 whitePoint = c.white().toxy();
232 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
233 break;
235 whitePoint = {0.3127, 0.3290};
236 colorants = {{0.63, 0.34}};
237 colorants.append({0.295, 0.605});
238 colorants.append({0.155, 0.077});
239 break;
241
242 if (prequantized) {
243 //prequantization courtesy of Elle Stone.
244 whitePoint = {0.3457, 0.3585};
245 colorants = {{0.7347, 0.2653}};
246 colorants.append({0.1596, 0.8404});
247 colorants.append({0.0366, 0.0001});
248 } else {
249 whitePoint = {0.3457, 0.3585};
250 colorants = {{0.734699, 0.265301}};
251 colorants.append({0.159597, 0.840403});
252 colorants.append({0.036598, 0.000105});
253 }
254
255 break;
257 if (prequantized) {
258 //prequantization courtesy of Elle Stone.
259 whitePoint = {0.3127, 0.3290};
260 colorants = {{0.639996511, 0.329996864}};
261 colorants.append({0.210005295, 0.710004866});
262 colorants.append({0.149997606, 0.060003644});
263 } else {
265 whitePoint = c.white().toxy();
266 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
267 }
268 break;
270 default:
271 if (prequantized) {
272 // Prequantized colorants, courtesy of Elle Stone
273 whitePoint = {0.3127, 0.3290};
274 colorants = {{0.639998686, 0.330010138}};
275 colorants.append({0.300003784, 0.600003357});
276 colorants.append({0.150002046, 0.059997204});
277 } else {
279 whitePoint = c.white().toxy();
280 colorants = {c.red().toxy(), c.green().toxy(), c.blue().toxy()};
281 }
282 break;
283
284 }
285}
ColorPrimaries
The colorPrimaries enum Enum of colorants, follows ITU H.273 for values 0 to 255, and has extra known...
@ PRIMARIES_ITU_R_BT_2020_2_AND_2100_0
@ PRIMARIES_ITU_R_BT_470_6_SYSTEM_M
@ PRIMARIES_EBU_Tech_3213_E
@ PRIMARIES_UNSPECIFIED
@ PRIMARIES_ITU_R_BT_470_6_SYSTEM_B_G
@ PRIMARIES_SMPTE_240M
@ PRIMARIES_ITU_R_BT_601_6
@ PRIMARIES_SMPTE_RP_431_2
@ PRIMARIES_PROPHOTO
@ PRIMARIES_ADOBE_RGB_1998
@ PRIMARIES_GENERIC_FILM
@ PRIMARIES_SMPTE_EG_432_1
@ PRIMARIES_ITU_R_BT_709_5
@ PRIMARIES_SMPTE_ST_428_1
static const Colorimetry DCIP3
static const Colorimetry BT2020
static const Colorimetry PAL_M
static const Colorimetry CIEXYZ
static const Colorimetry BT709
static const Colorimetry DisplayP3
static const Colorimetry AdobeRGB
static const Colorimetry NTSC
static const Colorimetry GenericFilm

References KoColorimetryUtils::Colorimetry::AdobeRGB, KoColorimetryUtils::Colorimetry::blue(), KoColorimetryUtils::Colorimetry::BT2020, KoColorimetryUtils::Colorimetry::BT709, KoColorimetryUtils::Colorimetry::CIEXYZ, KoColorimetryUtils::Colorimetry::DCIP3, KoColorimetryUtils::Colorimetry::DisplayP3, KoColorimetryUtils::Colorimetry::GenericFilm, KoColorimetryUtils::Colorimetry::green(), KoColorimetryUtils::Colorimetry::NTSC, KoColorimetryUtils::Colorimetry::PAL, KoColorimetryUtils::Colorimetry::PAL_M, primaries, PRIMARIES_ADOBE_RGB_1998, PRIMARIES_EBU_Tech_3213_E, PRIMARIES_GENERIC_FILM, PRIMARIES_ITU_R_BT_2020_2_AND_2100_0, PRIMARIES_ITU_R_BT_470_6_SYSTEM_B_G, PRIMARIES_ITU_R_BT_470_6_SYSTEM_M, PRIMARIES_ITU_R_BT_601_6, PRIMARIES_ITU_R_BT_709_5, PRIMARIES_PROPHOTO, PRIMARIES_SMPTE_240M, PRIMARIES_SMPTE_EG_432_1, PRIMARIES_SMPTE_RP_431_2, PRIMARIES_SMPTE_ST_428_1, PRIMARIES_UNSPECIFIED, KoColorimetryUtils::Colorimetry::red(), KoColorimetryUtils::XYZ::toxy(), and KoColorimetryUtils::Colorimetry::white().

◆ colorModelID()

virtual QString KoColorProfile::colorModelID ( ) const
inlinevirtual
Returns
a string for a color model id.

Reimplemented in IccColorProfile.

Definition at line 102 of file KoColorProfile.h.

102 {
103 return QString();
104 };

◆ compareTRC()

virtual bool KoColorProfile::compareTRC ( TransferCharacteristics characteristics,
float error ) const
pure virtual

Comparing profile's TRC against the other with defined error threshold, returns true if profile TRC is matched.

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ copyright()

QString KoColorProfile::copyright ( ) const
Returns
the copyright of the profile

◆ delinearizeFloatValue()

virtual void KoColorProfile::delinearizeFloatValue ( QVector< qreal > & Value) const
pure virtual

Delinearizes first 3 values of QVector, leaving other values unchanged. Returns the same QVector if it is not possible to delinearize. Effectively undoes LinearizeFloatValue.

Implemented in IccColorProfile.

◆ delinearizeFloatValueFast()

virtual void KoColorProfile::delinearizeFloatValueFast ( QVector< qreal > & Value) const
pure virtual

Implemented in IccColorProfile.

◆ fileName()

QString KoColorProfile::fileName ( ) const
Returns
the filename of the profile (it might be empty)

◆ getColorantsxyY()

virtual QVector< KoColorimetryUtils::xyY > KoColorProfile::getColorantsxyY ( ) const
pure virtual
Returns
a qvector <KoColorimetryUtils::xyY> with the colorants in xyY

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ getColorantsXYZ()

virtual QVector< KoColorimetryUtils::XYZ > KoColorProfile::getColorantsXYZ ( ) const
pure virtual
Returns
a qvector <KoColorimetryUtils::XYZ> with the RGB colorants in XYZ

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ getColorPrimaries()

ColorPrimaries KoColorProfile::getColorPrimaries ( ) const
virtual

getColorPrimaries

Returns
colorprimaries, defaults to 'unspecified' if no match is possible.

Definition at line 80 of file KoColorProfile.cpp.

81{
82 if (d->primaries == -1) {
85
86 bool match = false;
87 if (hasColorants()) {
89 if (col.size()<3) {
91 //too few colorants.
92 d->primaries = int(primaries);
93 return (primaries);
94 }
96 colorants.append(wp);
99
104
105 for (ColorPrimaries check: primariesList) {
106 colorantsForType(check, wp2, compare);
107 if (compare.size() <3) {
108 KIS_SAFE_ASSERT_RECOVER(compare.size() < 3) { continue; }
109 //too few colorants, skip.
110 }
111 compare.append(wp2);
112 match = true;
113 for (int i=0; i<colorants.size(); i++) {
114 match = std::fabs(colorants[i].x - compare[i].x) < 0.0001
115 && std::fabs(colorants[i].y - compare[i].y) < 0.0001;
116 if (!match) {
117 break;
118 }
119 }
120 if (match) {
121 primaries = check;
122 }
123 }
124 }
125
126 d->primaries = int(primaries);
127 }
128 return ColorPrimaries(d->primaries);
129}
#define KIS_SAFE_ASSERT_RECOVER(cond)
Definition kis_assert.h:126
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
Definition kis_assert.h:129
virtual KoColorimetryUtils::xyY getWhitePointxyY() const =0
virtual bool hasColorants() const =0
static void colorantsForType(ColorPrimaries primaries, KoColorimetryUtils::xy &whitePoint, QList< KoColorimetryUtils::xy > &colorants, const bool prequantized=false)
colorantsForPrimaries fills a QVector<float> with the xy values of the whitepoint and red,...
virtual QVector< KoColorimetryUtils::xyY > getColorantsxyY() const =0

References colorantsForType(), d, getColorantsxyY(), getWhitePointxyY(), hasColorants(), KIS_SAFE_ASSERT_RECOVER, KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, primaries, PRIMARIES_ADOBE_RGB_1998, PRIMARIES_EBU_Tech_3213_E, PRIMARIES_GENERIC_FILM, PRIMARIES_ITU_R_BT_2020_2_AND_2100_0, PRIMARIES_ITU_R_BT_470_6_SYSTEM_B_G, PRIMARIES_ITU_R_BT_470_6_SYSTEM_M, PRIMARIES_ITU_R_BT_601_6, PRIMARIES_ITU_R_BT_709_5, PRIMARIES_PROPHOTO, PRIMARIES_SMPTE_240M, PRIMARIES_SMPTE_EG_432_1, PRIMARIES_SMPTE_RP_431_2, PRIMARIES_SMPTE_ST_428_1, and PRIMARIES_UNSPECIFIED.

◆ getColorPrimariesName()

QString KoColorProfile::getColorPrimariesName ( ColorPrimaries primaries)
static

getColorPrimariesName

Parameters
primaries
Returns
human friendly name of the primary.

Definition at line 131 of file KoColorProfile.cpp.

132{
133 switch (primaries) {
135 return QStringLiteral("Rec. 709");
137 return QStringLiteral("BT. 470 System M");
139 return QStringLiteral("BT. 470 System B, G");
141 return QStringLiteral("Generic Film");
143 return QStringLiteral("SMPTE 240 M");
145 return QStringLiteral("Rec. 2020");
147 return QStringLiteral("Rec. 601");
149 return QStringLiteral("Display P3");
151 return QStringLiteral("DCI P3");
153 return QStringLiteral("XYZ primaries");
155 return QStringLiteral("EBU Tech 3213 E");
157 return QStringLiteral("ProPhoto");
159 return QStringLiteral("A98");
161 break;
162 }
163 return QStringLiteral("Unspecified");
164}

References primaries, PRIMARIES_ADOBE_RGB_1998, PRIMARIES_EBU_Tech_3213_E, PRIMARIES_GENERIC_FILM, PRIMARIES_ITU_R_BT_2020_2_AND_2100_0, PRIMARIES_ITU_R_BT_470_6_SYSTEM_B_G, PRIMARIES_ITU_R_BT_470_6_SYSTEM_M, PRIMARIES_ITU_R_BT_601_6, PRIMARIES_ITU_R_BT_709_5, PRIMARIES_PROPHOTO, PRIMARIES_SMPTE_240M, PRIMARIES_SMPTE_EG_432_1, PRIMARIES_SMPTE_RP_431_2, PRIMARIES_SMPTE_ST_428_1, and PRIMARIES_UNSPECIFIED.

◆ getEstimatedTRC()

virtual QVector< qreal > KoColorProfile::getEstimatedTRC ( ) const
pure virtual
Returns
estimated gamma for RGB and Grayscale profiles

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ getTransferCharacteristicName()

QString KoColorProfile::getTransferCharacteristicName ( TransferCharacteristics curve)
static

getTransferCharacteristicName

Parameters
curvethe number
Returns
name of the characteristic

Definition at line 344 of file KoColorProfile.cpp.

345{
346 switch (curve) {
350 return QString("rec 709 trc");
352 return QString("rec 2020 12bit trc");
354 return QString("Gamma 2.2");
356 return QString("Gamma 2.8");
357 case TRC_SMPTE_240M:
358 return QString("SMPTE 240 trc");
359 case TRC_LINEAR:
360 return QString("Linear");
362 return QString("Logarithmic 100");
364 return QString("Logarithmic 100 sqrt10");
366 return QString("IEC 61966 2.4");
369 return QString("sRGB trc");
371 return QString("SMPTE ST 428");
373 return QString("Perceptual Quantizer");
375 return QString("Hybrid Log Gamma");
376 case TRC_GAMMA_1_8:
377 return QString("Gamma 1.8");
378 case TRC_GAMMA_2_4:
379 return QString("Gamma 2.4");
380 case TRC_A98:
381 return QString("Gamma A98");
382 case TRC_PROPHOTO:
383 return QString("ProPhoto trc");
384 case TRC_LAB_L:
385 return QString("Lab L* trc");
386 case TRC_UNSPECIFIED:
387 break;
388 }
389
390 return QString("Unspecified");
391}
@ TRC_IEC_61966_2_4
@ TRC_ITU_R_BT_2020_2_10bit
@ TRC_LOGARITHMIC_100
@ TRC_ITU_R_BT_470_6_SYSTEM_M
@ TRC_ITU_R_BT_470_6_SYSTEM_B_G
@ TRC_ITU_R_BT_1361
@ TRC_ITU_R_BT_2100_0_HLG
@ TRC_ITU_R_BT_2100_0_PQ
@ TRC_ITU_R_BT_601_6
@ TRC_IEC_61966_2_1
@ TRC_ITU_R_BT_709_5
@ TRC_SMPTE_ST_428_1
@ TRC_LOGARITHMIC_100_sqrt10
@ TRC_ITU_R_BT_2020_2_12bit

References TRC_A98, TRC_GAMMA_1_8, TRC_GAMMA_2_4, TRC_IEC_61966_2_1, TRC_IEC_61966_2_4, TRC_ITU_R_BT_1361, TRC_ITU_R_BT_2020_2_10bit, TRC_ITU_R_BT_2020_2_12bit, TRC_ITU_R_BT_2100_0_HLG, TRC_ITU_R_BT_2100_0_PQ, TRC_ITU_R_BT_470_6_SYSTEM_B_G, TRC_ITU_R_BT_470_6_SYSTEM_M, TRC_ITU_R_BT_601_6, TRC_ITU_R_BT_709_5, TRC_LAB_L, TRC_LINEAR, TRC_LOGARITHMIC_100, TRC_LOGARITHMIC_100_sqrt10, TRC_PROPHOTO, TRC_SMPTE_240M, TRC_SMPTE_ST_428_1, and TRC_UNSPECIFIED.

◆ getTransferCharacteristics()

TransferCharacteristics KoColorProfile::getTransferCharacteristics ( ) const
virtual

getTransferCharacteristics This function should be subclassed at some point so we can get the value from the lcms profile.

Returns
transferfunction number.

Definition at line 287 of file KoColorProfile.cpp.

288{
289 // Parse from an estimated gamma
290 const QVector<double> estimatedTRC = getEstimatedTRC();
291 const double error = 0.0001;
292 // Make sure the TRC is uniform across all channels
293 const bool isUniformTRC = (estimatedTRC[0] == estimatedTRC[1] && estimatedTRC[0] == estimatedTRC[2]);
294 if (d->characteristics == TRC_UNSPECIFIED && isUniformTRC && hasTRC()) {
295 if (isLinear()) {
296 d->characteristics = TRC_LINEAR;
297 } else if (std::fabs(estimatedTRC[0] - (461.0 / 256.0)) < error) {
298 // ICC v2 u8Fixed8Number calculation
299 // Or can be prequantized as 1.80078125, courtesy of Elle Stone
300 d->characteristics = TRC_GAMMA_1_8;
301 } else if (std::fabs(estimatedTRC[0] - (563.0 / 256.0)) < error) {
302 // Or can be prequantized as 2.19921875, courtesy of Elle Stone
303 d->characteristics = TRC_A98;
304 } else if (std::fabs(estimatedTRC[0] - 1.8) < error) {
305 d->characteristics = TRC_GAMMA_1_8;
306 } else if (std::fabs(estimatedTRC[0] - 2.2) < error) {
307 d->characteristics = TRC_ITU_R_BT_470_6_SYSTEM_M;
308 } else if (std::fabs(estimatedTRC[0] - 2.4) < error) {
309 d->characteristics = TRC_GAMMA_2_4;
310 } else if (std::fabs(estimatedTRC[0] - 2.8) < error) {
311 d->characteristics = TRC_ITU_R_BT_470_6_SYSTEM_B_G;
312 } else {
313 // Escort to curve matching if no gamma is matched
314 static constexpr std::array<TransferCharacteristics, 12> trcList = {{TRC_ITU_R_BT_709_5,
324 TRC_A98,
325 TRC_LAB_L}};
326 const auto characteristic =
327 std::find_if(trcList.begin(), trcList.end(), [&](const TransferCharacteristics &check) -> bool {
328 return compareTRC(check, static_cast<float>(error));
329 });
330 if (characteristic != trcList.end()) {
331 d->characteristics = *characteristic;
332 }
333 }
334 }
335 return d->characteristics;
336}
TransferCharacteristics
The transferCharacteristics enum Enum of transfer characteristics, follows ITU H.273 for values 0 to ...
virtual QVector< qreal > getEstimatedTRC() const =0
virtual bool isLinear() const =0
virtual bool hasTRC() const =0

References d, getEstimatedTRC(), hasTRC(), isLinear(), TRC_A98, TRC_GAMMA_1_8, TRC_GAMMA_2_4, TRC_IEC_61966_2_1, TRC_ITU_R_BT_470_6_SYSTEM_B_G, TRC_ITU_R_BT_470_6_SYSTEM_M, TRC_ITU_R_BT_709_5, TRC_LAB_L, TRC_LINEAR, TRC_LOGARITHMIC_100, TRC_LOGARITHMIC_100_sqrt10, TRC_PROPHOTO, TRC_SMPTE_240M, and TRC_UNSPECIFIED.

◆ getWhitePointxyY()

virtual KoColorimetryUtils::xyY KoColorProfile::getWhitePointxyY ( ) const
pure virtual
Returns
a KoColorimetryUtils::xyY with the whitepoint in xyY

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ getWhitePointXYZ()

virtual KoColorimetryUtils::XYZ KoColorProfile::getWhitePointXYZ ( ) const
pure virtual
Returns
a KoColorimetryUtils::XYZ with the whitepoint in XYZ

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ hasColorants()

virtual bool KoColorProfile::hasColorants ( ) const
pure virtual
Returns
if the profile has colorants.

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ hasTRC()

virtual bool KoColorProfile::hasTRC ( ) const
pure virtual
Returns
if the profile has a TRC(required for linearisation).

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ info()

QString KoColorProfile::info ( ) const
Returns
the info of this profile

◆ isLinear()

virtual bool KoColorProfile::isLinear ( ) const
pure virtual
Returns
if the profile's TRCs are linear.

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ isSuitableForDisplay()

virtual bool KoColorProfile::isSuitableForDisplay ( ) const
pure virtual
Returns
true if this profile is suitable to use for display

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ isSuitableForInput()

virtual bool KoColorProfile::isSuitableForInput ( ) const
pure virtual
Returns
true if this profile can be used to convert color from this one to a different one

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ isSuitableForOutput()

virtual bool KoColorProfile::isSuitableForOutput ( ) const
pure virtual
Returns
true if this profile can be used to convert color from a different profile to this one

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ isSuitableForPrinting()

virtual bool KoColorProfile::isSuitableForPrinting ( ) const
pure virtual
Returns
true if this profile is suitable to use for printing

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ isSuitableForWorkspace()

virtual bool KoColorProfile::isSuitableForWorkspace ( ) const
pure virtual
Returns
true if you can use this profile can be used in Krita

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ linearizeFloatValue()

virtual void KoColorProfile::linearizeFloatValue ( QVector< qreal > & Value) const
pure virtual

Linearizes first 3 values of QVector, leaving other values unchanged. Returns the same QVector if it is not possible to linearize.

Implemented in IccColorProfile.

◆ linearizeFloatValueFast()

virtual void KoColorProfile::linearizeFloatValueFast ( QVector< qreal > & Value) const
pure virtual

More imprecise versions of the above(limited to 16bit, and can't delinearize above 1.0.) Use this for filters and images.

Implemented in IccColorProfile.

◆ load()

bool KoColorProfile::load ( )
virtual

Load the profile in memory.

Returns
true if the profile has been successfully loaded

Reimplemented in IccColorProfile.

Definition at line 41 of file KoColorProfile.cpp.

42{
43 return false;
44}

◆ manufacturer()

QString KoColorProfile::manufacturer ( ) const
Returns
manufacturer of the profile

◆ name()

QString KoColorProfile::name ( ) const
Returns
the name of this profile

◆ operator==()

virtual bool KoColorProfile::operator== ( const KoColorProfile & ) const
pure virtual

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ rawData()

virtual QByteArray KoColorProfile::rawData ( ) const
inlinevirtual
Returns
an array with the raw data of the profile

Reimplemented in IccColorProfile.

Definition at line 198 of file KoColorProfile.h.

198 {
199 return QByteArray();
200 }

◆ save()

bool KoColorProfile::save ( const QString & fileName)
virtual

Override this function to save the profile.

Parameters
fileNamedestination
Returns
true if the profile has been successfully saved

Reimplemented in IccColorProfile.

Definition at line 46 of file KoColorProfile.cpp.

47{
48 Q_UNUSED(filename);
49 return false;
50}

◆ setCharacteristics()

void KoColorProfile::setCharacteristics ( ColorPrimaries primaries,
TransferCharacteristics curve )
protected

setCharacteristics ideally, we'd read this from the icc profile curve, but that can be tricky, instead we'll set it on profile creation.

Parameters
curve

Definition at line 338 of file KoColorProfile.cpp.

339{
340 d->primaries = int(primaries);
341 d->characteristics = curve;
342}

References d, and primaries.

◆ setCopyright()

void KoColorProfile::setCopyright ( const QString & copyright)
protected

Allows to set the copyright string of that profile.

Definition at line 405 of file KoColorProfile.cpp.

406{
407 d->copyright = copyright;
408}

References copyright, and d.

◆ setFileName()

void KoColorProfile::setFileName ( const QString & filename)
Parameters
filenamenew filename

Definition at line 75 of file KoColorProfile.cpp.

76{
77 d->fileName = f;
78}

References d.

◆ setInfo()

void KoColorProfile::setInfo ( const QString & info)
protected

Allows to set the information string of that profile.

Definition at line 397 of file KoColorProfile.cpp.

398{
399 d->info = info;
400}

References d, and info.

◆ setManufacturer()

void KoColorProfile::setManufacturer ( const QString & manufacturer)
protected

Allows to set the manufacturer string of that profile.

Definition at line 401 of file KoColorProfile.cpp.

402{
403 d->manufacturer = manufacturer;
404}

References d, and manufacturer.

◆ setName()

void KoColorProfile::setName ( const QString & name)
protected

Allows to define the name of this profile.

Definition at line 393 of file KoColorProfile.cpp.

394{
395 d->name = name;
396}

References d, and name.

◆ supportsAbsolute()

virtual bool KoColorProfile::supportsAbsolute ( ) const
pure virtual

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ supportsPerceptual()

virtual bool KoColorProfile::supportsPerceptual ( ) const
pure virtual
Returns
which rendering intents are supported

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ supportsRelative()

virtual bool KoColorProfile::supportsRelative ( ) const
pure virtual

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ supportsSaturation()

virtual bool KoColorProfile::supportsSaturation ( ) const
pure virtual

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ type()

virtual QString KoColorProfile::type ( ) const
inlinevirtual
Returns
the type of this profile (icc, ctlcs etc)

Reimplemented in IccColorProfile.

Definition at line 37 of file KoColorProfile.h.

37 {
38 return QString();
39 }

◆ uniqueId()

virtual QByteArray KoColorProfile::uniqueId ( ) const
pure virtual

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ valid()

virtual bool KoColorProfile::valid ( ) const
pure virtual
Returns
true if the profile is valid, false if it isn't been loaded in memory yet, or if the loaded memory is a bad profile

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ version()

virtual float KoColorProfile::version ( ) const
pure virtual

Return version

Implemented in KoDummyColorProfile, and IccColorProfile.

Member Data Documentation

◆ characteristics

TransferCharacteristics KoColorProfile::characteristics {TRC_UNSPECIFIED}

Definition at line 22 of file KoColorProfile.cpp.

◆ copyright

QString KoColorProfile::copyright

Definition at line 20 of file KoColorProfile.cpp.

◆ d

Private* const KoColorProfile::d
private

Definition at line 267 of file KoColorProfile.h.

◆ fileName

QString KoColorProfile::fileName

Definition at line 18 of file KoColorProfile.cpp.

◆ info

QString KoColorProfile::info

Definition at line 17 of file KoColorProfile.cpp.

◆ manufacturer

QString KoColorProfile::manufacturer

Definition at line 19 of file KoColorProfile.cpp.

◆ name

QString KoColorProfile::name

Definition at line 16 of file KoColorProfile.cpp.

◆ primaries

int KoColorProfile::primaries {-1}

Definition at line 21 of file KoColorProfile.cpp.

21{-1};

The documentation for this class was generated from the following files: