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< qreal > getColorantsxyY () const =0
 
virtual QVector< qreal > getColorantsXYZ () 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 QVector< qreal > getWhitePointxyY () const =0
 
virtual QVector< qreal > 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 isSuitableForOutput () const =0
 
virtual bool isSuitableForPrinting () 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, QVector< double > &colorants)
 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,
QVector< double > & colorants )
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.
colorantsthe vector to fill.

Definition at line 162 of file KoColorProfile.cpp.

163{
164 switch (ColorPrimaries(primaries)) {
166 break;
168 // Unquantized.
169 colorants = {0.310, 0.316};
170 colorants.append({0.67, 0.33});
171 colorants.append({0.21, 0.71});
172 colorants.append({0.14, 0.08});
173 //Illuminant C
174 break;
176 // Unquantized.
177 colorants = {0.3127, 0.3290};
178 colorants.append({0.64, 0.33});
179 colorants.append({0.29, 0.60});
180 colorants.append({0.1500, 0.06});
181 break;
183 colorants = {0.3127, 0.3290};
184 colorants.append({0.630, 0.340});
185 colorants.append({0.310, 0.595});
186 colorants.append({0.155, 0.070});
187 break;
189 colorants = {0.3127, 0.3290};
190 colorants.append({0.630, 0.340});
191 colorants.append({0.310, 0.595});
192 colorants.append({0.155, 0.070});
193 break;
195 colorants = {0.310, 0.316};
196 colorants.append({0.681, 0.319});
197 colorants.append({0.243, 0.692});
198 colorants.append({0.145, 0.049});
199 //Illuminant C
200 break;
202 //prequantization courtesy of Elle Stone.
203 colorants = {0.3127, 0.3290};
204 colorants.append({0.708012540607, 0.291993664388});
205 colorants.append({0.169991652439, 0.797007778423});
206 colorants.append({0.130997824007, 0.045996550894});
207 break;
209 colorants = {1.0/3, 1.0/3};
210 colorants.append({1.0, 0});
211 colorants.append({0, 1.0});
212 colorants.append({0, 0});
213 break;
215 colorants = {0.314, 0.351};
216 colorants.append({0.6800, 0.3200});
217 colorants.append({0.2650, 0.6900});
218 colorants.append({0.1500, 0.0600});
219 break;
221 colorants = {0.3127, 0.3290};
222 colorants.append({0.6800, 0.3200});
223 colorants.append({0.2650, 0.6900});
224 colorants.append({0.1500, 0.0600});
225 break;
227 colorants = {0.3127, 0.3290};
228 colorants.append({0.63, 0.34});
229 colorants.append({0.295, 0.605});
230 colorants.append({0.155, 0.077});
231 break;
233 //prequantization courtesy of Elle Stone.
234 colorants = {0.3457, 0.3585};
235 colorants.append({0.7347, 0.2653});
236 colorants.append({0.1596, 0.8404});
237 colorants.append({0.0366, 0.0001});
238 break;
240 //prequantization courtesy of Elle Stone.
241 colorants = {0.3127, 0.3290};
242 colorants.append({0.639996511, 0.329996864});
243 colorants.append({0.210005295, 0.710004866});
244 colorants.append({0.149997606, 0.060003644});
245 break;
247 default:
248 // Prequantized colorants, courtesy of Elle Stone
249 colorants = {0.3127, 0.3290};
250 colorants.append({0.639998686, 0.330010138});
251 colorants.append({0.300003784, 0.600003357});
252 colorants.append({0.150002046, 0.059997204});
253 break;
254
255 }
256}
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

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.

◆ colorModelID()

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

Reimplemented in IccColorProfile.

Definition at line 101 of file KoColorProfile.h.

101 {
102 return QString();
103 };

◆ 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< qreal > KoColorProfile::getColorantsxyY ( ) const
pure virtual
Returns
a qvector <double>(9) with the RGB colorants in xyY

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ getColorantsXYZ()

virtual QVector< qreal > KoColorProfile::getColorantsXYZ ( ) const
pure virtual
Returns
a qvector <double>(9) 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()<8) {
91 //too few colorants.
92 d->primaries = int(primaries);
93 return (primaries);
94 }
95 QVector<double> colorants = {wp[0], wp[1], col[0], col[1], col[3], col[4], col[6], col[7]};
96 QVector<double> compare;
97
102
103 for (ColorPrimaries check: primariesList) {
104 colorantsForType(check, compare);
105 if (compare.size() <8) {
106 KIS_SAFE_ASSERT_RECOVER(compare.size() < 8) { continue; }
107 //too few colorants, skip.
108 }
109 match = true;
110 for (int i=0; i<colorants.size(); i++) {
111 match = std::fabs(colorants[i] - compare[i]) < 0.00001;
112 if (!match) {
113 break;
114 }
115 }
116 if (match) {
117 primaries = check;
118 }
119 }
120 }
121
122 d->primaries = int(primaries);
123 }
124 return ColorPrimaries(d->primaries);
125}
#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
static void colorantsForType(ColorPrimaries primaries, QVector< double > &colorants)
colorantsForPrimaries fills a QVector<float> with the xy values of the whitepoint and red,...
virtual QVector< qreal > getColorantsxyY() const =0
virtual bool hasColorants() const =0
virtual QVector< qreal > getWhitePointxyY() 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 127 of file KoColorProfile.cpp.

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

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 315 of file KoColorProfile.cpp.

316{
317 switch (curve) {
321 return QString("rec 709 trc");
323 return QString("rec 2020 12bit trc");
325 return QString("Gamma 2.2");
327 return QString("Gamma 2.8");
328 case TRC_SMPTE_240M:
329 return QString("SMPTE 240 trc");
330 case TRC_LINEAR:
331 return QString("Linear");
333 return QString("Logarithmic 100");
335 return QString("Logarithmic 100 sqrt10");
337 return QString("IEC 61966 2.4");
340 return QString("sRGB trc");
342 return QString("SMPTE ST 428");
344 return QString("Perceptual Quantizer");
346 return QString("Hybrid Log Gamma");
347 case TRC_GAMMA_1_8:
348 return QString("Gamma 1.8");
349 case TRC_GAMMA_2_4:
350 return QString("Gamma 2.4");
351 case TRC_A98:
352 return QString("Gamma A98");
353 case TRC_PROPHOTO:
354 return QString("ProPhoto trc");
355 case TRC_LAB_L:
356 return QString("Lab L* trc");
357 case TRC_UNSPECIFIED:
358 break;
359 }
360
361 return QString("Unspecified");
362}
@ 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 258 of file KoColorProfile.cpp.

259{
260 // Parse from an estimated gamma
261 const QVector<double> estimatedTRC = getEstimatedTRC();
262 const double error = 0.0001;
263 // Make sure the TRC is uniform across all channels
264 const bool isUniformTRC = (estimatedTRC[0] == estimatedTRC[1] && estimatedTRC[0] == estimatedTRC[2]);
265 if (d->characteristics == TRC_UNSPECIFIED && isUniformTRC && hasTRC()) {
266 if (isLinear()) {
267 d->characteristics = TRC_LINEAR;
268 } else if (std::fabs(estimatedTRC[0] - (461.0 / 256.0)) < error) {
269 // ICC v2 u8Fixed8Number calculation
270 // Or can be prequantized as 1.80078125, courtesy of Elle Stone
271 d->characteristics = TRC_GAMMA_1_8;
272 } else if (std::fabs(estimatedTRC[0] - (563.0 / 256.0)) < error) {
273 // Or can be prequantized as 2.19921875, courtesy of Elle Stone
274 d->characteristics = TRC_A98;
275 } else if (std::fabs(estimatedTRC[0] - 1.8) < error) {
276 d->characteristics = TRC_GAMMA_1_8;
277 } else if (std::fabs(estimatedTRC[0] - 2.2) < error) {
278 d->characteristics = TRC_ITU_R_BT_470_6_SYSTEM_M;
279 } else if (std::fabs(estimatedTRC[0] - 2.4) < error) {
280 d->characteristics = TRC_GAMMA_2_4;
281 } else if (std::fabs(estimatedTRC[0] - 2.8) < error) {
282 d->characteristics = TRC_ITU_R_BT_470_6_SYSTEM_B_G;
283 } else {
284 // Escort to curve matching if no gamma is matched
285 static constexpr std::array<TransferCharacteristics, 12> trcList = {{TRC_ITU_R_BT_709_5,
295 TRC_A98,
296 TRC_LAB_L}};
297 const auto characteristic =
298 std::find_if(trcList.begin(), trcList.end(), [&](const TransferCharacteristics &check) -> bool {
299 return compareTRC(check, static_cast<float>(error));
300 });
301 if (characteristic != trcList.end()) {
302 d->characteristics = *characteristic;
303 }
304 }
305 }
306 return d->characteristics;
307}
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 QVector< qreal > KoColorProfile::getWhitePointxyY ( ) const
pure virtual
Returns
a qvector <double>(3) with the whitepoint in xyY

Implemented in KoDummyColorProfile, and IccColorProfile.

◆ getWhitePointXYZ()

virtual QVector< qreal > KoColorProfile::getWhitePointXYZ ( ) const
pure virtual
Returns
a qvector <double>(3) 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.

◆ isSuitableForOutput()

virtual bool KoColorProfile::isSuitableForOutput ( ) const
pure virtual
Returns
true if you can use 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.

◆ 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 190 of file KoColorProfile.h.

190 {
191 return QByteArray();
192 }

◆ 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 309 of file KoColorProfile.cpp.

310{
311 d->primaries = int(primaries);
312 d->characteristics = curve;
313}

References d, and primaries.

◆ setCopyright()

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

Allows to set the copyright string of that profile.

Definition at line 376 of file KoColorProfile.cpp.

377{
378 d->copyright = copyright;
379}

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 368 of file KoColorProfile.cpp.

369{
370 d->info = info;
371}

References d, and info.

◆ setManufacturer()

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

Allows to set the manufacturer string of that profile.

Definition at line 372 of file KoColorProfile.cpp.

373{
374 d->manufacturer = manufacturer;
375}

References d, and manufacturer.

◆ setName()

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

Allows to define the name of this profile.

Definition at line 364 of file KoColorProfile.cpp.

365{
366 d->name = name;
367}

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 36 of file KoColorProfile.h.

36 {
37 return QString();
38 }

◆ 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 257 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: