77 : QObject(parent)
78{
81
82
84
86
87
89
95
97
98#ifdef Q_OS_MAC
99 iccProfileDirs.append(QDir::homePath() + "/Library/ColorSync/Profiles/");
100 iccProfileDirs.append("/System/Library/ColorSync/Profiles/");
101 iccProfileDirs.append("/Library/ColorSync/Profiles/");
102#endif
103#ifdef Q_OS_WIN
104 QString winPath = QString::fromUtf8(qgetenv("windir"));
105 winPath.replace('\\','/');
106 iccProfileDirs.append(winPath + "/System32/Spool/Drivers/Color/");
107
108#endif
109#ifdef Q_OS_LINUX
110 iccProfileDirs.append(QDir::homePath() + "./share/color/icc");
111#endif
112
114 << "ctpctdmed.icc";
115
116
117 Q_FOREACH(const QString &iccProfiledir, iccProfileDirs) {
118 QDir profileDir(iccProfiledir);
119 Q_FOREACH(
const QString &entry, profileDir.entryList(
QStringList() <<
"*.icm" <<
"*.icc" <<
"*.ICM" <<
"*.ICC", QDir::NoDotAndDotDot | QDir::Files | QDir::Readable)) {
120 if (blackList.contains(entry.toLower())) continue;
121 profileFilenames << iccProfiledir + "/" + entry;
122 }
123 }
124
125
126 if (!profileFilenames.empty()) {
127 for (QStringList::Iterator it = profileFilenames.begin(); it != profileFilenames.end(); ++it) {
128
130 Q_CHECK_PTR(profile);
131
133 if (profile->
valid()) {
134
136 } else {
137 qDebug() << "Invalid profile : " << *it;
138 delete profile;
139 }
140 }
141 }
142
143
144
147
151
155
159
163
164
165
168
170 query.hdrReferenceWhite = std::make_optional(203.0);
171
174
175 query.hdrReferenceWhite = std::make_optional(80.0);
178
186 const QString legacyRec2020PQProfileName = "High Dynamic Range UHDTV Wide Color Gamut Display (Rec. 2020) - SMPTE ST 2084 PQ EOTF";
188
191 #ifdef HAVE_LCMS24
192 #ifdef HAVE_OPENEXR
194 #endif
195 #endif
197
201
205
206#ifdef HAVE_LCMS24
207#ifdef HAVE_OPENEXR
211#endif
212#endif
213
217
218
219
220 cmsToneCurve *Gamma = cmsBuildGamma(0, 2.2);
221 cmsHPROFILE hProfile = cmsCreateGrayProfile(cmsD50_xyY(), Gamma);
222 cmsFreeToneCurve(Gamma);
225
228#ifdef HAVE_LCMS24
229#ifdef HAVE_OPENEXR
231#endif
232#endif
234
238
242#ifdef HAVE_LCMS24
243#ifdef HAVE_OPENEXR
247#endif
248#endif
249
253
254
255
259
263
267
271
272
273
276
279#ifdef HAVE_LCMS24
280#ifdef HAVE_OPENEXR
282#endif
283#endif
285
289
293
294#ifdef HAVE_LCMS24
295#ifdef HAVE_OPENEXR
299#endif
300#endif
301
305
306
307
308
309
310
314
318
322
326
327
328 registry->
addProfileAlias(
"sRGB built-in - (lcms internal)",
"sRGB built-in");
329 registry->
addProfileAlias(
"gray built-in - (lcms internal)",
"gray built-in");
330 registry->
addProfileAlias(
"Lab identity built-in - (lcms internal)",
"Lab identity built-in");
331 registry->
addProfileAlias(
"XYZ built-in - (lcms internal)",
"XYZ identity built-in");
332
333#if defined(HAVE_LCMS_FAST_FLOAT_PLUGIN)
334 cmsPlugin(cmsFastFloatExtensions());
335#endif
336}
QList< QString > QStringList
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID YCbCrAColorModelID("YCbCrA", ki18n("YCbCr/Alpha"))
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoID XYZAColorModelID("XYZA", ki18n("XYZ/Alpha"))
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"))
const KoID CMYKAColorModelID("CMYKA", ki18n("CMYK/Alpha"))
const KoID LABAColorModelID("LABA", ki18n("L*a*b*/Alpha"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
@ PRIMARIES_ITU_R_BT_2020_2_AND_2100_0
void lcms2LogErrorHandlerFunction(cmsContext, cmsUInt32Number ErrorCode, const char *Text)
static KoColorSpaceEngineRegistry * instance()
static KoHistogramProducerFactoryRegistry * instance()
static void addAssetType(const QString &type, const char *basetype, const QString &relativeName, bool priority=true)
static QStringList findAllAssets(const QString &type, const QString &filter=QString(), SearchOptions options=NoSearchOptions)
static IccColorProfile * createFromLcmsProfile(const cmsHPROFILE profile)
The KoColorProfileQuery struct.
virtual bool valid() const =0
void addProfileAlias(const QString &name, const QString &to)
static KoColorSpaceRegistry * instance()
void add(KoColorSpaceFactory *item)
void addProfileToMap(KoColorProfile *p)
void addProfile(KoColorProfile *profile)