1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515 | /* ============================================================
*
* This file is a part of digiKam project
* https://www.digikam.org
*
* Date : 2010-03-10
* Description : Film Grain settings view.
*
* SPDX-FileCopyrightText: 2010-2026 by Gilles Caulier <caulier dot gilles at gmail dot com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* ============================================================ */
#include "filmgrainsettings.h"
// Qt includes
#include <QGridLayout>
#include <QLabel>
#include <QString>
#include <QFile>
#include <QTextStream>
#include <QCheckBox>
#include <QUrl>
#include <QApplication>
#include <QStyle>
#include <QStandardPaths>
#include <QIcon>
// KDE includes
#include <kconfiggroup.h>
#include <klocalizedstring.h>
// Local includes
#include "dexpanderbox.h"
#include "dnuminput.h"
#include "digikam_debug.h"
namespace Digikam
{
class Q_DECL_HIDDEN FilmGrainSettings::Private
{
public:
Private() = default;
const QString configGrainSizeEntry = QLatin1String("GrainSizeEntry");
const QString configPhotoDistributionEntry = QLatin1String("PhotoDistributionEntry");
const QString configAddLumNoiseEntry = QLatin1String("AddLumNoiseEntry");
const QString configIntensityLumAdjustmentEntry = QLatin1String("IntensityLumAdjustment");
const QString configShadowsLumAdjustmentEntry = QLatin1String("ShadowsLumAdjustment");
const QString configMidtonesLumAdjustmentEntry = QLatin1String("MidtonesLumAdjustment");
const QString configHighlightsLumAdjustmentEntry = QLatin1String("HighlightsLumAdjustment");
const QString configAddChromaBlueNoiseEntry = QLatin1String("AddChromaBlueNoiseEntry");
const QString configIntensityChromaBlueAdjustmentEntry = QLatin1String("IntensityChromaBlueAdjustment");
const QString configShadowsChromaBlueAdjustmentEntry = QLatin1String("ShadowsChromaBlueAdjustment");
const QString configMidtonesChromaBlueAdjustmentEntry = QLatin1String("MidtonesChromaBlueAdjustment");
const QString configHighlightsChromaBlueAdjustmentEntry = QLatin1String("HighlightsChromaBlueAdjustment");
const QString configAddChromaRedNoiseEntry = QLatin1String("AddChromaRedNoiseEntry");
const QString configIntensityChromaRedAdjustmentEntry = QLatin1String("IntensityChromaRedAdjustment");
const QString configShadowsChromaRedAdjustmentEntry = QLatin1String("ShadowsChromaRedAdjustment");
const QString configMidtonesChromaRedAdjustmentEntry = QLatin1String("MidtonesChromaRedAdjustment");
const QString configHighlightsChromaRedAdjustmentEntry = QLatin1String("HighlightsChromaRedAdjustment");
QLabel* sizeLabel = nullptr;
QLabel* label1 = nullptr;
QLabel* label2 = nullptr;
QLabel* label3 = nullptr;
QLabel* label4 = nullptr;
QLabel* label5 = nullptr;
QLabel* label6 = nullptr;
QLabel* label7 = nullptr;
QLabel* label8 = nullptr;
QLabel* label9 = nullptr;
QLabel* label10 = nullptr;
QLabel* label11 = nullptr;
QLabel* label12 = nullptr;
QCheckBox* photoDistribution = nullptr;
DIntNumInput* grainSizeInput = nullptr;
DIntNumInput* intensityLumInput = nullptr;
DIntNumInput* shadowsLumInput = nullptr;
DIntNumInput* midtonesLumInput = nullptr;
DIntNumInput* highlightsLumInput = nullptr;
DIntNumInput* intensityChromaBlueInput = nullptr;
DIntNumInput* shadowsChromaBlueInput = nullptr;
DIntNumInput* midtonesChromaBlueInput = nullptr;
DIntNumInput* highlightsChromaBlueInput = nullptr;
DIntNumInput* intensityChromaRedInput = nullptr;
DIntNumInput* shadowsChromaRedInput = nullptr;
DIntNumInput* midtonesChromaRedInput = nullptr;
DIntNumInput* highlightsChromaRedInput = nullptr;
DExpanderBox* expanderBox = nullptr;
};
// --------------------------------------------------------
FilmGrainSettings::FilmGrainSettings(QWidget* const parent)
: QWidget(parent),
d (new Private)
{
const int spacing = layoutSpacing();
QGridLayout* const grid = new QGridLayout(parent);
// -------------------------------------------------------------
QWidget* const commonPage = new QWidget();
QGridLayout* const grid0 = new QGridLayout(commonPage);
d->sizeLabel = new QLabel(i18n("Grain Size:"), commonPage);
d->grainSizeInput = new DIntNumInput(commonPage);
d->grainSizeInput->setRange(1, 5, 1);
d->grainSizeInput->setDefaultValue(1);
d->grainSizeInput->setWhatsThis(i18n("Set here the graininess size of film."));
d->photoDistribution = new QCheckBox(i18n("Photographic Distribution"), commonPage);
d->photoDistribution->setWhatsThis(i18n("Set on this option to render grain using a photon statistic distribution. "
"This require more computation and can take a while."));
grid0->addWidget(d->sizeLabel, 0, 0, 1, 1);
grid0->addWidget(d->grainSizeInput, 1, 0, 1, 1);
grid0->addWidget(d->photoDistribution, 2, 0, 1, 1);
grid0->setContentsMargins(spacing, spacing, spacing, spacing);
// -------------------------------------------------------------
QWidget* const firstPage = new QWidget();
QGridLayout* const grid1 = new QGridLayout(firstPage);
d->label1 = new QLabel(i18n("Intensity:"), firstPage);
d->intensityLumInput = new DIntNumInput(firstPage);
d->intensityLumInput->setRange(1, 100, 1);
d->intensityLumInput->setDefaultValue(25);
d->intensityLumInput->setWhatsThis(i18n("Set here the film ISO-sensitivity to use for "
"simulating the film graininess."));
// -------------------------------------------------------------
d->label2 = new QLabel(i18n("Shadows:"), firstPage);
d->shadowsLumInput = new DIntNumInput(firstPage);
d->shadowsLumInput->setRange(-100, 100, 1);
d->shadowsLumInput->setDefaultValue(-100);
d->shadowsLumInput->setWhatsThis(i18n("Set how much the filter affects highlights."));
// -------------------------------------------------------------
d->label3 = new QLabel(i18n("Midtones:"), firstPage);
d->midtonesLumInput = new DIntNumInput(firstPage);
d->midtonesLumInput->setRange(-100, 100, 1);
d->midtonesLumInput->setDefaultValue(0);
d->midtonesLumInput->setWhatsThis(i18n("Set how much the filter affects midtones."));
// -------------------------------------------------------------
d->label4 = new QLabel(i18n("Highlights:"), firstPage);
d->highlightsLumInput = new DIntNumInput(firstPage);
d->highlightsLumInput->setRange(-100, 100, 1);
d->highlightsLumInput->setDefaultValue(-100);
d->highlightsLumInput->setWhatsThis(i18n("Set how much the filter affects shadows."));
grid1->addWidget(d->label1, 0, 0, 1, 1);
grid1->addWidget(d->intensityLumInput, 1, 0, 1, 1);
grid1->addWidget(d->label2, 2, 0, 1, 1);
grid1->addWidget(d->shadowsLumInput, 3, 0, 1, 1);
grid1->addWidget(d->label3, 4, 0, 1, 1);
grid1->addWidget(d->midtonesLumInput, 5, 0, 1, 1);
grid1->addWidget(d->label4, 6, 0, 1, 1);
grid1->addWidget(d->highlightsLumInput, 7, 0, 1, 1);
grid1->setContentsMargins(spacing, spacing, spacing, spacing);
grid1->setSpacing(spacing);
// -------------------------------------------------------------
QWidget* const secondPage = new QWidget();
QGridLayout* const grid2 = new QGridLayout(secondPage);
d->label5 = new QLabel(i18n("Intensity:"), secondPage);
d->intensityChromaBlueInput = new DIntNumInput(secondPage);
d->intensityChromaBlueInput->setRange(1, 100, 1);
d->intensityChromaBlueInput->setDefaultValue(25);
d->intensityChromaBlueInput->setWhatsThis(i18n("Set here the film sensitivity to use for "
"simulating the CCD blue noise."));
// -------------------------------------------------------------
d->label6 = new QLabel(i18n("Shadows:"), secondPage);
d->shadowsChromaBlueInput = new DIntNumInput(secondPage);
d->shadowsChromaBlueInput->setRange(-100, 100, 1);
d->shadowsChromaBlueInput->setDefaultValue(-100);
d->shadowsChromaBlueInput->setWhatsThis(i18n("Set how much the filter affects highlights."));
// -------------------------------------------------------------
d->label7 = new QLabel(i18n("Midtones:"), secondPage);
d->midtonesChromaBlueInput = new DIntNumInput(secondPage);
d->midtonesChromaBlueInput->setRange(-100, 100, 1);
d->midtonesChromaBlueInput->setDefaultValue(0);
d->midtonesChromaBlueInput->setWhatsThis(i18n("Set how much the filter affects midtones."));
// -------------------------------------------------------------
d->label8 = new QLabel(i18n("Highlights:"), secondPage);
d->highlightsChromaBlueInput = new DIntNumInput(secondPage);
d->highlightsChromaBlueInput->setRange(-100, 100, 1);
d->highlightsChromaBlueInput->setDefaultValue(-100);
d->highlightsChromaBlueInput->setWhatsThis(i18n("Set how much the filter affects shadows."));
grid2->addWidget(d->label5, 0, 0, 1, 1);
grid2->addWidget(d->intensityChromaBlueInput, 1, 0, 1, 1);
grid2->addWidget(d->label6, 2, 0, 1, 1);
grid2->addWidget(d->shadowsChromaBlueInput, 3, 0, 1, 1);
grid2->addWidget(d->label7, 4, 0, 1, 1);
grid2->addWidget(d->midtonesChromaBlueInput, 5, 0, 1, 1);
grid2->addWidget(d->label8, 6, 0, 1, 1);
grid2->addWidget(d->highlightsChromaBlueInput, 7, 0, 1, 1);
grid2->setContentsMargins(spacing, spacing, spacing, spacing);
grid2->setSpacing(spacing);
// -------------------------------------------------------------
QWidget* const thirdPage = new QWidget();
QGridLayout* const grid3 = new QGridLayout(thirdPage);
d->label9 = new QLabel(i18n("Intensity:"), thirdPage);
d->intensityChromaRedInput = new DIntNumInput(thirdPage);
d->intensityChromaRedInput->setRange(1, 100, 1);
d->intensityChromaRedInput->setDefaultValue(25);
d->intensityChromaRedInput->setWhatsThis(i18n("Set here the film sensitivity to use for "
"simulating the CCD red noise."));
// -------------------------------------------------------------
d->label10 = new QLabel(i18n("Shadows:"), thirdPage);
d->shadowsChromaRedInput = new DIntNumInput(thirdPage);
d->shadowsChromaRedInput->setRange(-100, 100, 1);
d->shadowsChromaRedInput->setDefaultValue(-100);
d->shadowsChromaRedInput->setWhatsThis(i18n("Set how much the filter affects highlights."));
// -------------------------------------------------------------
d->label11 = new QLabel(i18n("Midtones:"), thirdPage);
d->midtonesChromaRedInput = new DIntNumInput(thirdPage);
d->midtonesChromaRedInput->setRange(-100, 100, 1);
d->midtonesChromaRedInput->setDefaultValue(0);
d->midtonesChromaRedInput->setWhatsThis(i18n("Set how much the filter affects midtones."));
// -------------------------------------------------------------
d->label12 = new QLabel(i18n("Highlights:"), thirdPage);
d->highlightsChromaRedInput = new DIntNumInput(thirdPage);
d->highlightsChromaRedInput->setRange(-100, 100, 1);
d->highlightsChromaRedInput->setDefaultValue(-100);
d->highlightsChromaRedInput->setWhatsThis(i18n("Set how much the filter affects shadows."));
grid3->addWidget(d->label9, 0, 0, 1, 1);
grid3->addWidget(d->intensityChromaRedInput, 1, 0, 1, 1);
grid3->addWidget(d->label10, 2, 0, 1, 1);
grid3->addWidget(d->shadowsChromaRedInput, 3, 0, 1, 1);
grid3->addWidget(d->label11, 4, 0, 1, 1);
grid3->addWidget(d->midtonesChromaRedInput, 5, 0, 1, 1);
grid3->addWidget(d->label12, 6, 0, 1, 1);
grid3->addWidget(d->highlightsChromaRedInput, 7, 0, 1, 1);
grid3->setContentsMargins(spacing, spacing, spacing, spacing);
grid3->setSpacing(spacing);
// -------------------------------------------------------------
d->expanderBox = new DExpanderBox();
d->expanderBox->setObjectName(QLatin1String("Noise Expander"));
d->expanderBox->addItem(commonPage, QIcon::fromTheme(QLatin1String("system-run")),
i18n("Common Settings"),
QLatin1String("CommonSettingsContainer"), true);
d->expanderBox->addItem(firstPage, QIcon(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/colors-luma.png"))),
i18n("Luminance Noise"),
QLatin1String("LuminanceSettingsContainer"), true);
d->expanderBox->addItem(secondPage, QIcon(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/colors-chromablue.png"))),
i18n("Chrominance Blue Noise"),
QLatin1String("ChrominanceBlueSettingsContainer"), true);
d->expanderBox->addItem(thirdPage, QIcon(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/colors-chromared.png"))),
i18n("Chrominance Red Noise"),
QLatin1String("ChrominanceRedSettingsContainer"), true);
d->expanderBox->addStretch();
d->expanderBox->setCheckBoxVisible(1, true);
d->expanderBox->setCheckBoxVisible(2, true);
d->expanderBox->setCheckBoxVisible(3, true);
grid->addWidget(d->expanderBox, 0, 0, 1, 1);
grid->setContentsMargins(spacing, spacing, spacing, spacing);
grid->setSpacing(spacing);
// -------------------------------------------------------------
connect(d->grainSizeInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->photoDistribution, SIGNAL(toggled(bool)),
this, SIGNAL(signalSettingsChanged()));
connect(d->expanderBox, SIGNAL(signalItemToggled(int,bool)),
this, SLOT(slotItemToggled(int,bool)));
connect(d->intensityLumInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->shadowsLumInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->midtonesLumInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->highlightsLumInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->intensityChromaBlueInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->shadowsChromaBlueInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->midtonesChromaBlueInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->highlightsChromaBlueInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->intensityChromaRedInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->shadowsChromaRedInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->midtonesChromaRedInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
connect(d->highlightsChromaRedInput, SIGNAL(valueChanged(int)),
this, SIGNAL(signalSettingsChanged()));
}
FilmGrainSettings::~FilmGrainSettings()
{
delete d;
}
void FilmGrainSettings::slotItemToggled(int index, bool b)
{
switch (index)
{
case 1:
{
d->label1->setEnabled(b);
d->label2->setEnabled(b);
d->label3->setEnabled(b);
d->label4->setEnabled(b);
d->intensityLumInput->setEnabled(b);
d->shadowsLumInput->setEnabled(b);
d->midtonesLumInput->setEnabled(b);
d->highlightsLumInput->setEnabled(b);
break;
}
case 2:
{
d->label5->setEnabled(b);
d->label6->setEnabled(b);
d->label7->setEnabled(b);
d->label8->setEnabled(b);
d->intensityChromaBlueInput->setEnabled(b);
d->shadowsChromaBlueInput->setEnabled(b);
d->midtonesChromaBlueInput->setEnabled(b);
d->highlightsChromaBlueInput->setEnabled(b);
break;
}
case 3:
{
d->label9->setEnabled(b);
d->label10->setEnabled(b);
d->label11->setEnabled(b);
d->label12->setEnabled(b);
d->intensityChromaRedInput->setEnabled(b);
d->shadowsChromaRedInput->setEnabled(b);
d->midtonesChromaRedInput->setEnabled(b);
d->highlightsChromaRedInput->setEnabled(b);
break;
}
}
Q_EMIT signalSettingsChanged();
}
FilmGrainContainer FilmGrainSettings::settings() const
{
FilmGrainContainer prm;
prm.grainSize = d->grainSizeInput->value();
prm.photoDistribution = d->photoDistribution->isChecked();
prm.addLuminanceNoise = d->expanderBox->isChecked(1);
prm.lumaIntensity = d->intensityLumInput->value();
prm.lumaShadows = d->shadowsLumInput->value();
prm.lumaMidtones = d->midtonesLumInput->value();
prm.lumaHighlights = d->highlightsLumInput->value();
prm.addChrominanceBlueNoise = d->expanderBox->isChecked(2);
prm.chromaBlueIntensity = d->intensityChromaBlueInput->value();
prm.chromaBlueShadows = d->shadowsChromaBlueInput->value();
prm.chromaBlueMidtones = d->midtonesChromaBlueInput->value();
prm.chromaBlueHighlights = d->highlightsChromaBlueInput->value();
prm.addChrominanceRedNoise = d->expanderBox->isChecked(3);
prm.chromaRedIntensity = d->intensityChromaRedInput->value();
prm.chromaRedShadows = d->shadowsChromaRedInput->value();
prm.chromaRedMidtones = d->midtonesChromaRedInput->value();
prm.chromaRedHighlights = d->highlightsChromaRedInput->value();
return prm;
}
void FilmGrainSettings::setSettings(const FilmGrainContainer& settings)<--- Shadow argument
{
blockSignals(true);
d->grainSizeInput->setValue(settings.grainSize);
d->photoDistribution->setChecked(settings.photoDistribution);
d->expanderBox->setChecked(1, settings.addLuminanceNoise);
d->intensityLumInput->setValue(settings.lumaIntensity);
d->shadowsLumInput->setValue(settings.lumaShadows);
d->midtonesLumInput->setValue(settings.lumaMidtones);
d->highlightsLumInput->setValue(settings.lumaHighlights);
d->expanderBox->setChecked(2, settings.addChrominanceBlueNoise);
d->intensityChromaBlueInput->setValue(settings.chromaBlueIntensity);
d->shadowsChromaBlueInput->setValue(settings.chromaBlueShadows);
d->midtonesChromaBlueInput->setValue(settings.chromaBlueMidtones);
d->highlightsChromaBlueInput->setValue(settings.chromaBlueHighlights);
d->expanderBox->setChecked(3, settings.addChrominanceRedNoise);
d->intensityChromaRedInput->setValue(settings.chromaRedIntensity);
d->shadowsChromaRedInput->setValue(settings.chromaRedShadows);
d->midtonesChromaRedInput->setValue(settings.chromaRedMidtones);
d->highlightsChromaRedInput->setValue(settings.chromaRedHighlights);
slotItemToggled(1, settings.addLuminanceNoise);
slotItemToggled(2, settings.addChrominanceBlueNoise);
slotItemToggled(3, settings.addChrominanceRedNoise);
blockSignals(false);
}
void FilmGrainSettings::resetToDefault()
{
setSettings(defaultSettings());
}
FilmGrainContainer FilmGrainSettings::defaultSettings() const
{
return FilmGrainContainer();
}
void FilmGrainSettings::readSettings(const KConfigGroup& group)
{
FilmGrainContainer prm;
FilmGrainContainer defaultPrm = defaultSettings();
prm.grainSize = group.readEntry(d->configGrainSizeEntry, defaultPrm.grainSize);
prm.photoDistribution = group.readEntry(d->configPhotoDistributionEntry, defaultPrm.photoDistribution);
prm.addLuminanceNoise = group.readEntry(d->configAddLumNoiseEntry, defaultPrm.addLuminanceNoise);
prm.lumaIntensity = group.readEntry(d->configIntensityLumAdjustmentEntry, defaultPrm.lumaIntensity);
prm.lumaShadows = group.readEntry(d->configShadowsLumAdjustmentEntry, defaultPrm.lumaShadows);
prm.lumaMidtones = group.readEntry(d->configMidtonesLumAdjustmentEntry, defaultPrm.lumaMidtones);
prm.lumaHighlights = group.readEntry(d->configHighlightsLumAdjustmentEntry, defaultPrm.lumaHighlights);
prm.addChrominanceBlueNoise = group.readEntry(d->configAddChromaBlueNoiseEntry, defaultPrm.addChrominanceBlueNoise);
prm.chromaBlueIntensity = group.readEntry(d->configIntensityChromaBlueAdjustmentEntry, defaultPrm.chromaBlueIntensity);
prm.chromaBlueShadows = group.readEntry(d->configShadowsChromaBlueAdjustmentEntry, defaultPrm.chromaBlueShadows);
prm.chromaBlueMidtones = group.readEntry(d->configMidtonesChromaBlueAdjustmentEntry, defaultPrm.chromaBlueMidtones);
prm.chromaBlueHighlights = group.readEntry(d->configHighlightsChromaBlueAdjustmentEntry, defaultPrm.chromaBlueHighlights);
prm.addChrominanceRedNoise = group.readEntry(d->configAddChromaRedNoiseEntry, defaultPrm.addChrominanceRedNoise);
prm.chromaRedIntensity = group.readEntry(d->configIntensityChromaRedAdjustmentEntry, defaultPrm.chromaRedIntensity);
prm.chromaRedShadows = group.readEntry(d->configShadowsChromaRedAdjustmentEntry, defaultPrm.chromaRedShadows);
prm.chromaRedMidtones = group.readEntry(d->configMidtonesChromaRedAdjustmentEntry, defaultPrm.chromaRedMidtones);
prm.chromaRedHighlights = group.readEntry(d->configHighlightsChromaRedAdjustmentEntry, defaultPrm.chromaRedHighlights);
setSettings(prm);
}
void FilmGrainSettings::writeSettings(KConfigGroup& group)
{
FilmGrainContainer prm = settings();
group.writeEntry(d->configGrainSizeEntry, prm.grainSize);
group.writeEntry(d->configPhotoDistributionEntry, prm.photoDistribution);
group.writeEntry(d->configAddLumNoiseEntry, prm.addLuminanceNoise);
group.writeEntry(d->configIntensityLumAdjustmentEntry, prm.lumaIntensity);
group.writeEntry(d->configShadowsLumAdjustmentEntry, prm.lumaShadows);
group.writeEntry(d->configMidtonesLumAdjustmentEntry, prm.lumaMidtones);
group.writeEntry(d->configHighlightsLumAdjustmentEntry, prm.lumaHighlights);
group.writeEntry(d->configAddChromaBlueNoiseEntry, prm.addChrominanceBlueNoise);
group.writeEntry(d->configIntensityChromaBlueAdjustmentEntry, prm.chromaBlueIntensity);
group.writeEntry(d->configShadowsChromaBlueAdjustmentEntry, prm.chromaBlueShadows);
group.writeEntry(d->configMidtonesChromaBlueAdjustmentEntry, prm.chromaBlueMidtones);
group.writeEntry(d->configHighlightsChromaBlueAdjustmentEntry, prm.chromaBlueHighlights);
group.writeEntry(d->configAddChromaRedNoiseEntry, prm.addChrominanceRedNoise);
group.writeEntry(d->configIntensityChromaRedAdjustmentEntry, prm.chromaRedIntensity);
group.writeEntry(d->configShadowsChromaRedAdjustmentEntry, prm.chromaRedShadows);
group.writeEntry(d->configMidtonesChromaRedAdjustmentEntry, prm.chromaRedMidtones);
group.writeEntry(d->configHighlightsChromaRedAdjustmentEntry, prm.chromaRedHighlights);
}
} // namespace Digikam
#include "moc_filmgrainsettings.cpp"
|