Changeset View
Changeset View
Standalone View
Standalone View
libs/libkis/Krita.cpp
Show All 23 Lines | |||||
24 | #include <kconfiggroup.h> | 24 | #include <kconfiggroup.h> | ||
25 | 25 | | |||
26 | #include <KoColorSpaceRegistry.h> | 26 | #include <KoColorSpaceRegistry.h> | ||
27 | #include <KoColorProfile.h> | 27 | #include <KoColorProfile.h> | ||
28 | #include <KoColorSpace.h> | 28 | #include <KoColorSpace.h> | ||
29 | #include <KoDockRegistry.h> | 29 | #include <KoDockRegistry.h> | ||
30 | #include <KoColorSpaceEngine.h> | 30 | #include <KoColorSpaceEngine.h> | ||
31 | #include <KoColorModelStandardIds.h> | 31 | #include <KoColorModelStandardIds.h> | ||
32 | #include <KoID.h> | ||||
32 | 33 | | |||
33 | #include <kactioncollection.h> | 34 | #include <kactioncollection.h> | ||
34 | #include <KisPart.h> | 35 | #include <KisPart.h> | ||
35 | #include <KisMainWindow.h> | 36 | #include <KisMainWindow.h> | ||
36 | #include <KisDocument.h> | 37 | #include <KisDocument.h> | ||
37 | #include <kis_image.h> | 38 | #include <kis_image.h> | ||
38 | #include <kis_action.h> | 39 | #include <kis_action.h> | ||
39 | #include <kis_script_manager.h> | 40 | #include <kis_script_manager.h> | ||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Line(s) | 166 | { | |||
169 | filter->setName(name); | 170 | filter->setName(name); | ||
170 | KisFilterSP f = KisFilterRegistry::instance()->value(name); | 171 | KisFilterSP f = KisFilterRegistry::instance()->value(name); | ||
171 | KisFilterConfigurationSP fc = f->defaultConfiguration(); | 172 | KisFilterConfigurationSP fc = f->defaultConfiguration(); | ||
172 | InfoObject *info = new InfoObject(fc); | 173 | InfoObject *info = new InfoObject(fc); | ||
173 | filter->setConfiguration(info); | 174 | filter->setConfiguration(info); | ||
174 | return filter; | 175 | return filter; | ||
175 | } | 176 | } | ||
176 | 177 | | |||
178 | QStringList Krita::colorModels() const | ||||
179 | { | ||||
180 | QSet<QString> colorModelsIds; | ||||
181 | QList<KoID> ids = KoColorSpaceRegistry::instance()->colorModelsList(KoColorSpaceRegistry::AllColorSpaces); | ||||
182 | Q_FOREACH(KoID id, ids) { | ||||
183 | colorModelsIds << id.id(); | ||||
184 | } | ||||
185 | return colorModelsIds.toList();; | ||||
186 | } | ||||
187 | | ||||
188 | QStringList Krita::colorDepths(const QString &colorModel) const | ||||
189 | { | ||||
190 | QSet<QString> colorDepthsIds; | ||||
191 | QList<KoID> ids = KoColorSpaceRegistry::instance()->colorDepthList(colorModel, KoColorSpaceRegistry::AllColorSpaces); | ||||
192 | Q_FOREACH(KoID id, ids) { | ||||
193 | colorDepthsIds << id.id(); | ||||
194 | } | ||||
195 | return colorDepthsIds.toList();; | ||||
196 | } | ||||
197 | | ||||
177 | QStringList Krita::profiles(const QString &colorModel, const QString &colorDepth) const | 198 | QStringList Krita::profiles(const QString &colorModel, const QString &colorDepth) const | ||
178 | { | 199 | { | ||
179 | QSet<QString> profileNames; | 200 | QSet<QString> profileNames; | ||
180 | QString id = KoColorSpaceRegistry::instance()->colorSpaceId(colorModel, colorDepth); | 201 | QString id = KoColorSpaceRegistry::instance()->colorSpaceId(colorModel, colorDepth); | ||
181 | QList<const KoColorProfile *> profiles = KoColorSpaceRegistry::instance()->profilesFor(id); | 202 | QList<const KoColorProfile *> profiles = KoColorSpaceRegistry::instance()->profilesFor(id); | ||
182 | Q_FOREACH(const KoColorProfile *profile, profiles) { | 203 | Q_FOREACH(const KoColorProfile *profile, profiles) { | ||
183 | profileNames << profile->name(); | 204 | profileNames << profile->name(); | ||
184 | } | 205 | } | ||
▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Line(s) | 383 | { | |||
369 | else if (v.canConvert< QObject* >()) | 390 | else if (v.canConvert< QObject* >()) | ||
370 | { | 391 | { | ||
371 | QObject* obj = qvariant_cast< QObject* >(v); | 392 | QObject* obj = qvariant_cast< QObject* >(v); | ||
372 | return obj; | 393 | return obj; | ||
373 | } | 394 | } | ||
374 | else | 395 | else | ||
375 | return 0; | 396 | return 0; | ||
376 | } | 397 | } | ||
377 | |