64 return d->manufacturer;
82 if (
d->primaries == -1) {
107 if (compare.size() <3) {
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;
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");
163 return QStringLiteral(
"Unspecified");
169 const bool prequantized)
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});
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});
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});
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});
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});
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});
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});
291 const double error = 0.0001;
293 const bool isUniformTRC = (estimatedTRC[0] == estimatedTRC[1] && estimatedTRC[0] == estimatedTRC[2]);
297 }
else if (std::fabs(estimatedTRC[0] - (461.0 / 256.0)) < error) {
301 }
else if (std::fabs(estimatedTRC[0] - (563.0 / 256.0)) < error) {
304 }
else if (std::fabs(estimatedTRC[0] - 1.8) < error) {
306 }
else if (std::fabs(estimatedTRC[0] - 2.2) < error) {
308 }
else if (std::fabs(estimatedTRC[0] - 2.4) < error) {
310 }
else if (std::fabs(estimatedTRC[0] - 2.8) < error) {
314 static constexpr std::array<TransferCharacteristics, 12> trcList = {{
TRC_ITU_R_BT_709_5,
326 const auto characteristic =
328 return compareTRC(check, static_cast<float>(error));
330 if (characteristic != trcList.end()) {
331 d->characteristics = *characteristic;
335 return d->characteristics;
341 d->characteristics = 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");
358 return QString(
"SMPTE 240 trc");
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");
377 return QString(
"Gamma 1.8");
379 return QString(
"Gamma 2.4");
381 return QString(
"Gamma A98");
383 return QString(
"ProPhoto trc");
385 return QString(
"Lab L* trc");
390 return QString(
"Unspecified");
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_ITU_R_BT_470_6_SYSTEM_B_G
@ PRIMARIES_ITU_R_BT_601_6
@ PRIMARIES_SMPTE_RP_431_2
@ PRIMARIES_ADOBE_RGB_1998
@ PRIMARIES_SMPTE_EG_432_1
@ PRIMARIES_ITU_R_BT_709_5
@ PRIMARIES_SMPTE_ST_428_1
TransferCharacteristics
The transferCharacteristics enum Enum of transfer characteristics, follows ITU H.273 for values 0 to ...
@ TRC_ITU_R_BT_2020_2_10bit
@ TRC_ITU_R_BT_470_6_SYSTEM_M
@ TRC_ITU_R_BT_470_6_SYSTEM_B_G
@ TRC_ITU_R_BT_2100_0_HLG
@ TRC_LOGARITHMIC_100_sqrt10
@ TRC_ITU_R_BT_2020_2_12bit
static const Colorimetry DCIP3
static const Colorimetry BT2020
static const Colorimetry PAL_M
static const Colorimetry PAL
static const Colorimetry CIEXYZ
static const Colorimetry BT709
static const Colorimetry DisplayP3
static const Colorimetry AdobeRGB
static const Colorimetry NTSC
const XYZ & white() const
static const Colorimetry GenericFilm
const XYZ & green() const
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
void setFileName(const QString &filename)
void setCopyright(const QString ©right)
static QString getTransferCharacteristicName(TransferCharacteristics curve)
getTransferCharacteristicName
static QString getColorPrimariesName(ColorPrimaries primaries)
getColorPrimariesName
virtual KoColorimetryUtils::xyY getWhitePointxyY() const =0
virtual bool save(const QString &fileName)
virtual ColorPrimaries getColorPrimaries() const
getColorPrimaries
void setName(const QString &name)
virtual QVector< qreal > getEstimatedTRC() 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 bool isLinear() const =0
void setManufacturer(const QString &manufacturer)
KoColorProfile(const QString &fileName=QString())
virtual QVector< KoColorimetryUtils::xyY > getColorantsxyY() const =0
virtual bool hasTRC() const =0
virtual TransferCharacteristics getTransferCharacteristics() const
getTransferCharacteristics This function should be subclassed at some point so we can get the value f...
void setCharacteristics(ColorPrimaries primaries, TransferCharacteristics curve)
setCharacteristics ideally, we'd read this from the icc profile curve, but that can be tricky,...
virtual ~KoColorProfile()
void setInfo(const QString &info)