Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_image_config.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2010 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#include "kis_image_config.h"
8
9#include <ksharedconfig.h>
10
11#include <KoConfig.h>
12#include <KoColorProfile.h>
16
18#include "kis_debug.h"
19
20#include <QThread>
21#include <QApplication>
22#include <QColor>
23#include <QDir>
24
25#include "kis_global.h"
26#include <cmath>
27#include <QTemporaryFile>
28
29#ifdef Q_OS_MACOS
30#include <errno.h>
32#endif
33
35 : m_config(KSharedConfig::openConfig()->group(QString()))
36 , m_readOnly(readOnly)
37{
38 if (!readOnly) {
39 KIS_SAFE_ASSERT_RECOVER_RETURN(qApp->thread() == QThread::currentThread());
40 }
41#ifdef Q_OS_MACOS
42 // clear /var/folders/ swap path set by old broken Krita swap implementation in order to use new default swap dir.
43 QString swap = m_config.readEntry("swaplocation", "");
44 if (swap.startsWith("/var/folders/")) {
45 m_config.deleteEntry("swaplocation");
46 }
47#endif
48}
49
51{
52 if (m_readOnly) return;
53
54 if (qApp->thread() != QThread::currentThread()) {
55 dbgKrita << "KisImageConfig: requested config synchronization from nonGUI thread! Called from" << kisBacktrace();
56 return;
57 }
58
59 m_config.sync();
60}
61
62bool KisImageConfig::enableProgressReporting(bool requestDefault) const
63{
64 return !requestDefault ?
65 m_config.readEntry("enableProgressReporting", true) : true;
66}
67
69{
70 m_config.writeEntry("enableProgressReporting", value);
71}
72
73bool KisImageConfig::enablePerfLog(bool requestDefault) const
74{
75 return !requestDefault ?
76 m_config.readEntry("enablePerfLog", false) :false;
77}
78
80{
81 m_config.writeEntry("enablePerfLog", value);
82}
83
85{
86 return m_config.readEntry("transformMaskOffBoundsReadArea", 0.5);
87}
88
90{
91 int patchHeight = m_config.readEntry("updatePatchHeight", 512);
92 if (patchHeight <= 0) return 512;
93 return patchHeight;
94}
95
97{
98 m_config.writeEntry("updatePatchHeight", value);
99}
100
102{
103 int patchWidth = m_config.readEntry("updatePatchWidth", 512);
104 if (patchWidth <= 0) return 512;
105 return patchWidth;
106}
107
109{
110 m_config.writeEntry("updatePatchWidth", value);
111}
112
114{
115 return m_config.readEntry("maxCollectAlpha", 2.5);
116}
117
119{
120 return m_config.readEntry("maxMergeAlpha", 1.);
121}
122
124{
125 return m_config.readEntry("maxMergeCollectAlpha", 1.5);
126}
127
129{
133 return m_config.readEntry("schedulerBalancingRatio", 100.);
134}
135
137{
138 m_config.writeEntry("schedulerBalancingRatio", value);
139}
140
141int KisImageConfig::maxSwapSize(bool requestDefault) const
142{
143 return !requestDefault ?
144 m_config.readEntry("maxSwapSize", 4096) : 4096; // in MiB
145}
146
148{
149 m_config.writeEntry("maxSwapSize", value);
150}
151
153{
154 return m_config.readEntry("swapSlabSize", 64); // in MiB
155}
156
158{
159 m_config.writeEntry("swapSlabSize", value);
160}
161
163{
164 return m_config.readEntry("swapWindowSize", 16); // in MiB
165}
166
168{
169 m_config.writeEntry("swapWindowSize", value);
170}
171
173{
174 qreal hp = qreal(memoryHardLimitPercent()) / 100.0;
175 qreal pp = qreal(memoryPoolLimitPercent()) / 100.0;
176
177 return totalRAM() * hp * (1 - pp);
178}
179
181{
182 qreal sp = qreal(memorySoftLimitPercent()) / 100.0;
183
184 return tilesHardLimit() * sp;
185}
186
188{
189 qreal hp = qreal(memoryHardLimitPercent()) / 100.0;
190 qreal pp = qreal(memoryPoolLimitPercent()) / 100.0;
191
192 return totalRAM() * hp * pp;
193}
194
195qreal KisImageConfig::memoryHardLimitPercent(bool requestDefault) const
196{
197 return !requestDefault ?
198 m_config.readEntry("memoryHardLimitPercent", 50.) : 50.;
199}
200
202{
203 m_config.writeEntry("memoryHardLimitPercent", value);
204}
205
206qreal KisImageConfig::memorySoftLimitPercent(bool requestDefault) const
207{
208 return !requestDefault ?
209 m_config.readEntry("memorySoftLimitPercent", 2.) : 2.;
210}
211
213{
214 m_config.writeEntry("memorySoftLimitPercent", value);
215}
216
217qreal KisImageConfig::memoryPoolLimitPercent(bool requestDefault) const
218{
219 return !requestDefault ?
220 m_config.readEntry("memoryPoolLimitPercent", 0.0) : 0.0;
221}
222
224{
225 m_config.writeEntry("memoryPoolLimitPercent", value);
226}
227
228QString KisImageConfig::safelyGetWritableTempLocation(const QString &suffix, const QString &configKey, bool requestDefault) const
229{
230#ifdef Q_OS_MACOS
231 // On OSX, QDir::tempPath() gives us a folder we cannot reply upon (usually
232 // something like /var/folders/.../...) and that will have vanished when we
233 // try to create the tmp file in KisMemoryWindow::KisMemoryWindow using
234 // swapFileTemplate. thus, we just pick the home folder if swapDir does not
235 // tell us otherwise.
236
237 // the other option here would be to use a "garbled name" temp file (i.e. no name
238 // KRITA_SWAP_FILE_XXXXXX) in an obscure /var/folders place, which is not
239 // nice to the user. having a clearly named swap file in the home folder is
240 // much nicer to Krita's users.
241
242 // NOTE: QStandardPaths::AppLocalDataLocation on macos sandboxed envs
243 // does not return writable locations at all times, using QDir static methods
244 // will always return locations inside the sandbox Container
245
246 // furthermore, this is just a default and swapDir can always be configured
247 // to another location.
248
249 QString swap;
250
252 if ( bookmarkmngr->isSandboxed() ) {
253 QDir sandboxHome = QDir::home();
254 if (sandboxHome.cd("tmp")) {
255 swap = sandboxHome.path();
256 }
257 } else {
258 swap = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + '/' + suffix;
259 }
260#else
261 Q_UNUSED(suffix);
262 QString swap = QDir::tempPath();
263#endif
264 if (requestDefault) {
265 return swap;
266 }
267 const QString configuredSwap = m_config.readEntry(configKey, swap);
268 if (!configuredSwap.isEmpty()) {
269 swap = configuredSwap;
270 }
271
272 QString chosenLocation;
273 QStringList proposedSwapLocations;
274
275 proposedSwapLocations << swap;
276 proposedSwapLocations << QDir::tempPath();
277 proposedSwapLocations << QDir::homePath();
278
279 Q_FOREACH (const QString location, proposedSwapLocations) {
280 if (!QFileInfo(location).isWritable()) continue;
281
287 QTemporaryFile tempFile;
288 tempFile.setFileTemplate(location + '/' + "krita_test_swap_location");
289 if (tempFile.open() && !tempFile.fileName().isEmpty()) {
290 chosenLocation = location;
291 break;
292 }
293 }
294
295 if (chosenLocation.isEmpty()) {
296 qCritical() << "CRITICAL: no writable location for a swap file found! Tried the following paths:" << proposedSwapLocations;
297 qCritical() << "CRITICAL: hope I don't crash...";
298 chosenLocation = swap;
299 }
300
301 if (chosenLocation != swap) {
302 qWarning() << "WARNING: configured swap location is not writable, using a fall-back location" << swap << "->" << chosenLocation;
303 }
304
305 return chosenLocation;
306}
307
308
309QString KisImageConfig::swapDir(bool requestDefault)
310{
311 return safelyGetWritableTempLocation("swap", "swaplocation", requestDefault);
312}
313
314void KisImageConfig::setSwapDir(const QString &swapDir)
315{
316 m_config.writeEntry("swaplocation", swapDir);
317}
318
320{
321 return m_config.readEntry("numberOfOnionSkins", 10);
322}
323
325{
326 m_config.writeEntry("numberOfOnionSkins", value);
327}
328
330{
331 return m_config.readEntry("onionSkinTintFactor", 192);
332}
333
335{
336 m_config.writeEntry("onionSkinTintFactor", value);
337}
338
339int KisImageConfig::onionSkinOpacity(int offset, bool requestDefault) const
340{
341 int value = m_config.readEntry("onionSkinOpacity_" + QString::number(offset), -1);
342
343 if (value < 0 || requestDefault) {
344 const int num = numberOfOnionSkins();
345 if (num > 0) {
346 const qreal dx = qreal(qAbs(offset)) / num;
347 value = 0.7 * exp(-pow2(dx) / 0.5) * 255;
348 }
349 }
350
351 return value;
352}
353
355{
356 m_config.writeEntry("onionSkinOpacity_" + QString::number(offset), value);
357}
358
359bool KisImageConfig::onionSkinState(int offset) const
360{
361 bool enableByDefault = (qAbs(offset) <= 2);
362 return m_config.readEntry("onionSkinState_" + QString::number(offset), enableByDefault);
363}
364
366{
367 m_config.writeEntry("onionSkinState_" + QString::number(offset), value);
368}
369
371{
372 return m_config.readEntry("onionSkinTintColorBackward", QColor(Qt::red));
373}
374
376{
377 m_config.writeEntry("onionSkinTintColorBackward", value);
378}
379
381{
382 return m_config.readEntry("oninSkinTintColorForward", QColor(Qt::green));
383}
384
386{
387 m_config.writeEntry("oninSkinTintColorForward", value);
388}
389
390bool KisImageConfig::autoKeyEnabled(bool requestDefault) const
391{
392 return !requestDefault ?
393 m_config.readEntry("lazyFrameCreationEnabled", true) : true;
394}
395
397{
398 m_config.writeEntry("lazyFrameCreationEnabled", value);
399}
400
401bool KisImageConfig::autoKeyModeDuplicate(bool requestDefault) const
402{
403 return !requestDefault ?
404 m_config.readEntry("lazyFrameModeDuplicate", true) : true;
405}
406
408{
409 m_config.writeEntry("lazyFrameModeDuplicate", value);
410}
411
412#if defined Q_OS_LINUX
413#include <sys/sysinfo.h>
414#elif defined Q_OS_HAIKU
415#include <OS.h>
416#elif defined Q_OS_FREEBSD || defined Q_OS_NETBSD || defined Q_OS_OPENBSD
417#include <sys/sysctl.h>
418#elif defined Q_OS_WIN
419#include <windows.h>
420#elif defined Q_OS_MACOS
421#include <sys/types.h>
422#include <sys/sysctl.h>
423#endif
424
426{
427 // let's think that default memory size is 1000MiB
428 int totalMemory = 1000; // MiB
429 int error = 1;
430
431#if defined Q_OS_LINUX
432 struct sysinfo info;
433
434 error = sysinfo(&info);
435 if(!error) {
436 totalMemory = info.totalram * info.mem_unit / (1UL << 20);
437 }
438#elif defined Q_OS_HAIKU
439 system_info info;
440 error = get_system_info(&info) == B_OK ? 0 : 1;
441 if (!error) {
442 uint64_t size = (info.max_pages * B_PAGE_SIZE);
443 totalMemory = size >> 20;
444 }
445#elif defined Q_OS_FREEBSD || defined Q_OS_NETBSD || defined Q_OS_OPENBSD
446 u_long physmem;
447# if defined HW_PHYSMEM64 // NetBSD only
448 int mib[] = {CTL_HW, HW_PHYSMEM64};
449# else
450 int mib[] = {CTL_HW, HW_PHYSMEM};
451# endif
452 size_t len = sizeof(physmem);
453
454 error = sysctl(mib, 2, &physmem, &len, 0, 0);
455 if(!error) {
456 totalMemory = physmem >> 20;
457 }
458#elif defined Q_OS_WIN
459 MEMORYSTATUSEX status;
460 status.dwLength = sizeof(status);
461 error = !GlobalMemoryStatusEx(&status);
462
463 if (!error) {
464 totalMemory = status.ullTotalPhys >> 20;
465 }
466
467 // For 32 bit windows, the total memory available is at max the 2GB per process memory limit.
468# if defined ENV32BIT
469 totalMemory = qMin(totalMemory, 2000);
470# endif
471#elif defined Q_OS_MACOS
472 int mib[2] = { CTL_HW, HW_MEMSIZE };
473 u_int namelen = sizeof(mib) / sizeof(mib[0]);
474 uint64_t size;
475 size_t len = sizeof(size);
476
477 errno = 0;
478 if (sysctl(mib, namelen, &size, &len, 0, 0) >= 0) {
479 totalMemory = size >> 20;
480 error = 0;
481 }
482 else {
483 dbgKrita << "sysctl(\"hw.memsize\") raised error" << strerror(errno);
484 }
485#endif
486
487 if (error) {
488 warnKrita << "Cannot get the size of your RAM. Using 1 GiB by default.";
489 }
490
491 return totalMemory;
492}
493
495{
496 return !requestDefault ?
497 m_config.readEntry("showAdditionalOnionSkinsSettings", true) : true;
498}
499
501{
502 m_config.writeEntry("showAdditionalOnionSkinsSettings", value);
503}
504
506{
507 return m_config.readEntry("defaultFrameColorLabel", 0);
508}
509
511{
512 m_config.writeEntry("defaultFrameColorLabel", label);
513}
514
516{
518 if (!requestDefault) {
519 proofingConfig->proofingProfile = m_config.readEntry("defaultProofingProfileName", "Chemical proof");
520 proofingConfig->proofingModel = m_config.readEntry("defaultProofingProfileModel", "CMYKA");
521 proofingConfig->proofingDepth = m_config.readEntry("defaultProofingProfileDepth", "U8");
522 proofingConfig->displayIntent = KoColorConversionTransformation::Intent(m_config.readEntry("defaultProofingProfileIntent", int(INTENT_ABSOLUTE_COLORIMETRIC)));
523 proofingConfig->conversionIntent = KoColorConversionTransformation::Intent(m_config.readEntry("defaultProofingConversionIntent", int(INTENT_RELATIVE_COLORIMETRIC)));
524 proofingConfig->useBlackPointCompensationFirstTransform = m_config.readEntry("defaultProofingBlackpointCompensation", true);
525
526 proofingConfig->displayFlags.setFlag(KoColorConversionTransformation::BlackpointCompensation, m_config.readEntry("defaultProofingDisplayBlackpointCompensation", true));
527 proofingConfig->displayMode = KisProofingConfiguration::DisplayTransformState(m_config.readEntry("defaultProofingDisplayMode", int(KisProofingConfiguration::Paper)));
528 QColor def(Qt::green);
529 def = m_config.readEntry("defaultProofingGamutwarning", def);
531 col.fromQColor(def);
532 col.setOpacity(1.0);
533 proofingConfig->warningColor = col;
534 proofingConfig->setLegacyAdaptationState(m_config.readEntry("defaultProofingAdaptationState", 1.0));
535 }
536 return toQShared(proofingConfig);
537}
538
540{
541 if (*defaultProofingconfiguration() == config) return;
542
543 m_config.writeEntry("defaultProofingProfileName", config.proofingProfile);
544 m_config.writeEntry("defaultProofingProfileModel", config.proofingModel);
545 m_config.writeEntry("defaultProofingProfileDepth", config.proofingDepth);
546 m_config.writeEntry("defaultProofingConversionIntent", int(config.conversionIntent));
547 m_config.writeEntry("defaultProofingBlackpointCompensation", config.useBlackPointCompensationFirstTransform);
548 QColor c;
549 c = config.warningColor.toQColor();
550 m_config.writeEntry("defaultProofingGamutwarning", c);
551 m_config.writeEntry("defaultProofingAdaptationState", config.legacyAdaptationState());
552 m_config.writeEntry("defaultProofingDisplayBlackpointCompensation", config.displayFlags.testFlag(KoColorConversionTransformation::BlackpointCompensation));
553 m_config.writeEntry("defaultProofingProfileIntent", int(config.displayIntent));
554 m_config.writeEntry("defaultProofingDisplayMode", int(config.displayMode));
555
557}
558
559bool KisImageConfig::useLodForColorizeMask(bool requestDefault) const
560{
561 return !requestDefault ?
562 m_config.readEntry("useLodForColorizeMask", false) : false;
563}
564
566{
567 m_config.writeEntry("useLodForColorizeMask", value);
568}
569
570int KisImageConfig::maxNumberOfThreads(bool defaultValue) const
571{
572 return (defaultValue ? QThread::idealThreadCount() : m_config.readEntry("maxNumberOfThreads", QThread::idealThreadCount()));
573}
574
576{
577 if (value == QThread::idealThreadCount()) {
578 m_config.deleteEntry("maxNumberOfThreads");
579 } else {
580 m_config.writeEntry("maxNumberOfThreads", value);
581 }
582}
583
584int KisImageConfig::frameRenderingClones(bool defaultValue) const
585{
586 const int defaultClonesCount = qMax(1, maxNumberOfThreads(defaultValue) / 2);
587 return defaultValue ? defaultClonesCount : m_config.readEntry("frameRenderingClones", defaultClonesCount);
588}
589
591{
592 m_config.writeEntry("frameRenderingClones", value);
593}
594
595int KisImageConfig::frameRenderingTimeout(bool defaultValue) const
596{
597 const int defaultFrameRenderingTimeout = 30000; // 30 ms
598 return defaultValue ? defaultFrameRenderingTimeout : m_config.readEntry("frameRenderingTimeout", defaultFrameRenderingTimeout);
599}
600
602{
603 m_config.writeEntry("frameRenderingTimeout", value);
604}
605
606int KisImageConfig::fpsLimit(bool defaultValue) const
607{
608 int limit = defaultValue ? 100 : m_config.readEntry("fpsLimit", 100);
609 return limit > 0 ? limit : 1;
610}
611
613{
614 m_config.writeEntry("fpsLimit", value);
615}
616
617bool KisImageConfig::detectFpsLimit(bool defaultValue) const
618{
619 return defaultValue ? true : m_config.readEntry("detectFpsLimit", true);
620}
621
623{
624 m_config.writeEntry("detectFpsLimit", value);
625}
626
628{
629 return defaultValue ? true : m_config.readEntry("useOnDiskAnimationCacheSwapping", true);
630}
631
633{
634 m_config.writeEntry("useOnDiskAnimationCacheSwapping", value);
635}
636
637QString KisImageConfig::animationCacheDir(bool defaultValue) const
638{
639 return safelyGetWritableTempLocation("animation_cache", "animationCacheDir", defaultValue);
640}
641
643{
644 m_config.writeEntry("animationCacheDir", value);
645}
646
648{
649 return defaultValue ? true : m_config.readEntry("useAnimationCacheFrameSizeLimit", true);
650}
651
653{
654 m_config.writeEntry("useAnimationCacheFrameSizeLimit", value);
655}
656
658{
659 return defaultValue ? 2500 : m_config.readEntry("animationCacheFrameSizeLimit", 2500);
660}
661
663{
664 m_config.writeEntry("animationCacheFrameSizeLimit", value);
665}
666
668{
669 return defaultValue ? true : m_config.readEntry("useAnimationCacheRegionOfInterest", true);
670}
671
673{
674 m_config.writeEntry("useAnimationCacheRegionOfInterest", value);
675}
676
678{
679 return defaultValue ? 0.25 : m_config.readEntry("animationCacheRegionOfInterestMargin", 0.25);
680}
681
683{
684 m_config.writeEntry("animationCacheRegionOfInterestMargin", value);
685}
686
687qreal KisImageConfig::selectionOutlineOpacity(bool defaultValue) const
688{
689 return defaultValue ? 1.0 : m_config.readEntry("selectionOutlineOpacity", 1.0);
690}
691
693{
694 m_config.writeEntry("selectionOutlineOpacity", value);
695}
696
697QColor KisImageConfig::selectionOverlayMaskColor(bool defaultValue) const
698{
699 QColor def(255, 0, 0, 128);
700 return (defaultValue ? def : m_config.readEntry("selectionOverlayMaskColor", def));
701}
702
704{
705 m_config.writeEntry("selectionOverlayMaskColor", color);
706}
707
708int KisImageConfig::maxBrushSize(bool defaultValue) const
709{
710 return !defaultValue ? m_config.readEntry("maximumBrushSize", 1000) : 1000;
711}
712
714{
715 m_config.writeEntry("maximumBrushSize", value);
716}
717
719{
720 return qMin(15000, 3 * maxBrushSize());
721}
722
723bool KisImageConfig::renameMergedLayers(bool defaultValue) const
724{
725 return defaultValue ? true : m_config.readEntry("renameMergedLayers", true);
726}
727
729{
730 m_config.writeEntry("renameMergedLayers", value);
731}
732
733bool KisImageConfig::renameDuplicatedLayers(bool defaultValue) const
734{
735 return defaultValue ? true : m_config.readEntry("renameDuplicatedLayers", true);
736}
737
739{
740 m_config.writeEntry("renameDuplicatedLayers", value);
741}
742
743QString KisImageConfig::exportConfigurationXML(const QString &exportConfigId, bool defaultValue) const
744{
745 return (defaultValue ? QString() : m_config.readEntry("ExportConfiguration-" + exportConfigId, QString()));
746}
747
748bool KisImageConfig::hasExportConfiguration(const QString &exportConfigID)
749{
750 return m_config.hasKey("ExportConfiguration-" + exportConfigID);
751}
752
753KisPropertiesConfigurationSP KisImageConfig::exportConfiguration(const QString &exportConfigId, bool defaultValue) const
754{
756 const QString xmlData = exportConfigurationXML(exportConfigId, defaultValue);
757 cfg->fromXML(xmlData);
758 return cfg;
759}
760
761void KisImageConfig::setExportConfiguration(const QString &exportConfigId, KisPropertiesConfigurationSP properties)
762{
763 const QString exportConfig = properties->toXML();
764 QString configId = "ExportConfiguration-" + exportConfigId;
765 m_config.writeEntry(configId, exportConfig);
766}
767
769{
770 KConfigGroup config = KSharedConfig::openConfig()->group(QString());
771 config.deleteGroup();
772}
float value(const T *src, size_t ch)
static KisImageConfigNotifier * instance()
int numberOfOnionSkins() const
int maxMaskingBrushSize() const
void setExportConfiguration(const QString &exportConfigId, KisPropertiesConfigurationSP properties)
void setEnableProgressReporting(bool value)
void setUseAnimationCacheRegionOfInterest(bool value)
int updatePatchWidth() const
void setUpdatePatchWidth(int value)
bool useAnimationCacheFrameSizeLimit(bool defaultValue=false) const
void setAnimationCacheFrameSizeLimit(int value)
void setUpdatePatchHeight(int value)
QColor onionSkinTintColorBackward() const
qreal transformMaskOffBoundsReadArea() const
qreal maxMergeCollectAlpha() const
qreal schedulerBalancingRatio() const
void setFrameRenderingClones(int value)
QString exportConfigurationXML(const QString &exportConfigId, bool defaultValue=false) const
int animationCacheFrameSizeLimit(bool defaultValue=false) const
KisProofingConfigurationSP defaultProofingconfiguration(bool requestDefault=false)
void setMaxNumberOfThreads(int value)
bool useAnimationCacheRegionOfInterest(bool defaultValue=false) const
int frameRenderingClones(bool defaultValue=false) const
void setDetectFpsLimit(bool value)
void setFpsLimit(int value)
QString safelyGetWritableTempLocation(const QString &suffix, const QString &configKey, bool requestDefault) const
QString swapDir(bool requestDefault=false)
int maxNumberOfThreads(bool defaultValue=false) const
void setOnionSkinState(int offset, bool value)
KisImageConfig(bool readOnly)
bool autoKeyEnabled(bool requestDefault=false) const
qreal memoryPoolLimitPercent(bool requestDefault=false) const
int maxBrushSize(bool defaultValue=false) const
int onionSkinOpacity(int offset, bool requestDefault=false) const
int updatePatchHeight() const
void setEnablePerfLog(bool value)
bool detectFpsLimit(bool defaultValue=false) const
void setSwapSlabSize(int value)
bool enableProgressReporting(bool requestDefault=false) const
void setUseAnimationCacheFrameSizeLimit(bool value)
int onionSkinTintFactor() const
int fpsLimit(bool defaultValue=false) const
void setOnionSkinTintColorForward(const QColor &value)
void setSelectionOutlineOpacity(qreal value)
bool renameDuplicatedLayers(bool defaultValue=false) const
int maxSwapSize(bool requestDefault=false) const
int tilesHardLimit() const
bool onionSkinState(int offset) const
void setOnionSkinTintFactor(int value)
void setAutoKeyEnabled(bool value)
bool hasExportConfiguration(const QString &exportConfigID)
static void resetConfig()
void setUseOnDiskAnimationCacheSwapping(bool value)
void setOnionSkinOpacity(int offset, int value)
int defaultFrameColorLabel() const
qreal animationCacheRegionOfInterestMargin(bool defaultValue=false) const
qreal maxMergeAlpha() const
int swapWindowSize() const
void setFrameRenderingTimeout(int value)
void setMaxSwapSize(int value)
qreal memoryHardLimitPercent(bool requestDefault=false) const
void setUseLodForColorizeMask(bool value)
void setSchedulerBalancingRatio(qreal value)
qreal maxCollectAlpha() const
void setMemorySoftLimitPercent(qreal value)
bool showAdditionalOnionSkinsSettings(bool requestDefault=false) const
int swapSlabSize() const
void setAnimationCacheDir(const QString &value)
void setSwapDir(const QString &swapDir)
void setSelectionOverlayMaskColor(const QColor &color)
void setAutoKeyModeDuplicate(bool value)
qreal selectionOutlineOpacity(bool defaultValue=false) const
void setSwapWindowSize(int value)
void setRenameDuplicatedLayers(bool value)
static int totalRAM()
QColor onionSkinTintColorForward() const
bool renameMergedLayers(bool defaultValue=false) const
int frameRenderingTimeout(bool defaultValue=false) const
bool enablePerfLog(bool requestDefault=false) const
void setMaxBrushSize(int value)
void setDefaultFrameColorLabel(int label)
void setRenameMergedLayers(bool value)
void setNumberOfOnionSkins(int value)
int tilesSoftLimit() const
QString animationCacheDir(bool defaultValue=false) const
bool autoKeyModeDuplicate(bool requestDefault=false) const
void setDefaultProofingConfig(const KisProofingConfiguration &config)
QColor selectionOverlayMaskColor(bool defaultValue=false) const
qreal memorySoftLimitPercent(bool requestDefault=false) const
bool useLodForColorizeMask(bool requestDefault=false) const
void setMemoryHardLimitPercent(qreal value)
bool useOnDiskAnimationCacheSwapping(bool defaultValue=false) const
void setMemoryPoolLimitPercent(qreal value)
void setAnimationCacheRegionOfInterestMargin(qreal value)
void setShowAdditionalOnionSkinsSettings(bool value)
KisPropertiesConfigurationSP exportConfiguration(const QString &exportConfigId, bool defaultValue=false) const
KConfigGroup m_config
void setOnionSkinTintColorBackward(const QColor &value)
static KisMacosSecurityBookmarkManager * instance()
The KisProofingConfiguration struct Little struct that stores the proofing configuration for a given ...
DisplayTransformState displayMode
@ Paper
Whether to use Paper settings (absolute colorimetric, 0% adaptation.)
KoColorConversionTransformation::Intent displayIntent
This is the intent for the second transform.
KoColorConversionTransformation::Intent conversionIntent
This is the intent for the first transform.
bool useBlackPointCompensationFirstTransform
Whether to use BCP on the first transform. All other flags are handled by displayFlags;.
void setLegacyAdaptationState(qreal value)
KoColorConversionTransformation::ConversionFlags displayFlags
flags for the second transform.
void setOpacity(quint8 alpha)
Definition KoColor.cpp:333
void fromQColor(const QColor &c)
Convenient function for converting from a QColor.
Definition KoColor.cpp:213
void toQColor(QColor *c) const
a convenience method for the above.
Definition KoColor.cpp:198
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
QString kisBacktrace()
Definition kis_debug.cpp:51
#define dbgKrita
Definition kis_debug.h:45
#define warnKrita
Definition kis_debug.h:87
#define INTENT_ABSOLUTE_COLORIMETRIC
Definition kis_global.h:106
T pow2(const T &x)
Definition kis_global.h:166
#define INTENT_RELATIVE_COLORIMETRIC
Definition kis_global.h:104
QSharedPointer< T > toQShared(T *ptr)
static KoColorSpaceRegistry * instance()