78 : QObject(parent)
79{
82
83
85
87
88
90
96
98
99#ifdef Q_OS_MAC
100 iccProfileDirs.append(QDir::homePath() + "/Library/ColorSync/Profiles/");
101 iccProfileDirs.append("/System/Library/ColorSync/Profiles/");
102 iccProfileDirs.append("/Library/ColorSync/Profiles/");
103#endif
104#ifdef Q_OS_WIN
105 QString winPath = QString::fromUtf8(qgetenv("windir"));
106 winPath.replace('\\','/');
107 iccProfileDirs.append(winPath + "/System32/Spool/Drivers/Color/");
108
109#endif
110#ifdef Q_OS_LINUX
111 iccProfileDirs.append(QDir::homePath() + "./share/color/icc");
112#endif
113
115 << "ctpctdmed.icc";
116
117
118 Q_FOREACH(const QString &iccProfiledir, iccProfileDirs) {
119 QDir profileDir(iccProfiledir);
120 Q_FOREACH(
const QString &entry, profileDir.entryList(
QStringList() <<
"*.icm" <<
"*.icc" <<
"*.ICM" <<
"*.ICC", QDir::NoDotAndDotDot | QDir::Files | QDir::Readable)) {
121 if (blackList.contains(entry.toLower())) continue;
122 profileFilenames << iccProfiledir + "/" + entry;
123 }
124 }
125
126
127 if (!profileFilenames.empty()) {
128 for (QStringList::Iterator it = profileFilenames.begin(); it != profileFilenames.end(); ++it) {
129
131 Q_CHECK_PTR(profile);
132
134 if (profile->
valid()) {
135
137 } else {
138 qDebug() << "Invalid profile : " << *it;
139 delete profile;
140 }
141 }
142 }
143
144
145
148
152
156
160
164
165
166
169
172#ifdef HAVE_LCMS24
173#ifdef HAVE_OPENEXR
175#endif
176#endif
178
182
186
187#ifdef HAVE_LCMS24
188#ifdef HAVE_OPENEXR
192#endif
193#endif
194
198
199
200
201 cmsToneCurve *
Gamma = cmsBuildGamma(0, 2.2);
202 cmsHPROFILE hProfile = cmsCreateGrayProfile(cmsD50_xyY(),
Gamma);
203 cmsFreeToneCurve(
Gamma);
206
209#ifdef HAVE_LCMS24
210#ifdef HAVE_OPENEXR
212#endif
213#endif
215
219
223#ifdef HAVE_LCMS24
224#ifdef HAVE_OPENEXR
228#endif
229#endif
230
234
235
236
240
244
248
252
253
254
257
260#ifdef HAVE_LCMS24
261#ifdef HAVE_OPENEXR
263#endif
264#endif
266
270
274
275#ifdef HAVE_LCMS24
276#ifdef HAVE_OPENEXR
280#endif
281#endif
282
286
287
288
289
290
291
295
299
303
307
308
309 registry->
addProfileAlias(
"sRGB built-in - (lcms internal)",
"sRGB built-in");
310 registry->
addProfileAlias(
"gray built-in - (lcms internal)",
"gray built-in");
311 registry->
addProfileAlias(
"Lab identity built-in - (lcms internal)",
"Lab identity built-in");
312 registry->
addProfileAlias(
"XYZ built-in - (lcms internal)",
"XYZ identity built-in");
313
314#if defined(HAVE_LCMS_FAST_FLOAT_PLUGIN)
315 cmsPlugin(cmsFastFloatExtensions());
316#endif
317}
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"))
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)
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)