/src/libkdcraw/src/rawdecodingsettings.cpp
Line | Count | Source |
1 | | /* |
2 | | SPDX-FileCopyrightText: 2006-2015 Gilles Caulier <caulier dot gilles at gmail dot com> |
3 | | SPDX-FileCopyrightText: 2006-2013 Marcel Wiesweg <marcel dot wiesweg at gmx dot de> |
4 | | SPDX-FileCopyrightText: 2007-2008 Guillaume Castagnino <casta at xwing dot info> |
5 | | |
6 | | SPDX-License-Identifier: GPL-2.0-or-later |
7 | | */ |
8 | | |
9 | | #include "rawdecodingsettings.h" |
10 | | |
11 | | namespace KDcrawIface |
12 | | { |
13 | | |
14 | | RawDecodingSettings::RawDecodingSettings() |
15 | 0 | { |
16 | 0 | fixColorsHighlights = false; |
17 | 0 | autoBrightness = true; |
18 | 0 | sixteenBitsImage = false; |
19 | 0 | brightness = 1.0; |
20 | 0 | RAWQuality = BILINEAR; |
21 | 0 | inputColorSpace = NOINPUTCS; |
22 | 0 | outputColorSpace = SRGB; |
23 | 0 | RGBInterpolate4Colors = false; |
24 | 0 | DontStretchPixels = false; |
25 | 0 | unclipColors = 0; |
26 | 0 | whiteBalance = CAMERA; |
27 | 0 | customWhiteBalance = 6500; |
28 | 0 | customWhiteBalanceGreen = 1.0; |
29 | 0 | medianFilterPasses = 0; |
30 | |
|
31 | 0 | halfSizeColorImage = false; |
32 | |
|
33 | 0 | enableBlackPoint = false; |
34 | 0 | blackPoint = 0; |
35 | |
|
36 | 0 | enableWhitePoint = false; |
37 | 0 | whitePoint = 0; |
38 | |
|
39 | 0 | NRType = NONR; |
40 | 0 | NRThreshold = 0; |
41 | |
|
42 | 0 | enableCACorrection = false; |
43 | 0 | caMultiplier[0] = 0.0; |
44 | 0 | caMultiplier[1] = 0.0; |
45 | |
|
46 | 0 | inputProfile = QString(); |
47 | 0 | outputProfile = QString(); |
48 | |
|
49 | 0 | deadPixelMap = QString(); |
50 | |
|
51 | 0 | whiteBalanceArea = QRect(); |
52 | | |
53 | | //-- Extended demosaicing settings ---------------------------------------------------------- |
54 | |
|
55 | 0 | dcbIterations = -1; |
56 | 0 | dcbEnhanceFl = false; |
57 | 0 | eeciRefine = false; |
58 | 0 | esMedPasses = 0; |
59 | 0 | NRChroThreshold = 0; |
60 | 0 | expoCorrection = false; |
61 | 0 | expoCorrectionShift = 1.0; |
62 | 0 | expoCorrectionHighlight = 0.0; |
63 | 0 | } |
64 | | |
65 | | RawDecodingSettings::~RawDecodingSettings() |
66 | 0 | { |
67 | 0 | } |
68 | | |
69 | 0 | RawDecodingSettings::RawDecodingSettings(const RawDecodingSettings& o) = default; |
70 | | |
71 | 0 | RawDecodingSettings& RawDecodingSettings::operator=(const RawDecodingSettings& o) = default; |
72 | | |
73 | | bool RawDecodingSettings::operator==(const RawDecodingSettings& o) const |
74 | 0 | { |
75 | 0 | return fixColorsHighlights == o.fixColorsHighlights |
76 | 0 | && autoBrightness == o.autoBrightness |
77 | 0 | && sixteenBitsImage == o.sixteenBitsImage |
78 | 0 | && brightness == o.brightness |
79 | 0 | && RAWQuality == o.RAWQuality |
80 | 0 | && inputColorSpace == o.inputColorSpace |
81 | 0 | && outputColorSpace == o.outputColorSpace |
82 | 0 | && RGBInterpolate4Colors == o.RGBInterpolate4Colors |
83 | 0 | && DontStretchPixels == o.DontStretchPixels |
84 | 0 | && unclipColors == o.unclipColors |
85 | 0 | && whiteBalance == o.whiteBalance |
86 | 0 | && customWhiteBalance == o.customWhiteBalance |
87 | 0 | && customWhiteBalanceGreen == o.customWhiteBalanceGreen |
88 | 0 | && halfSizeColorImage == o.halfSizeColorImage |
89 | 0 | && enableBlackPoint == o.enableBlackPoint |
90 | 0 | && blackPoint == o.blackPoint |
91 | 0 | && enableWhitePoint == o.enableWhitePoint |
92 | 0 | && whitePoint == o.whitePoint |
93 | 0 | && NRType == o.NRType |
94 | 0 | && NRThreshold == o.NRThreshold |
95 | 0 | && enableCACorrection == o.enableCACorrection |
96 | 0 | && caMultiplier[0] == o.caMultiplier[0] |
97 | 0 | && caMultiplier[1] == o.caMultiplier[1] |
98 | 0 | && medianFilterPasses == o.medianFilterPasses |
99 | 0 | && inputProfile == o.inputProfile |
100 | 0 | && outputProfile == o.outputProfile |
101 | 0 | && deadPixelMap == o.deadPixelMap |
102 | 0 | && whiteBalanceArea == o.whiteBalanceArea |
103 | | |
104 | | //-- Extended demosaicing settings ---------------------------------------------------------- |
105 | | |
106 | 0 | && dcbIterations == o.dcbIterations |
107 | 0 | && dcbEnhanceFl == o.dcbEnhanceFl |
108 | 0 | && eeciRefine == o.eeciRefine |
109 | 0 | && esMedPasses == o.esMedPasses |
110 | 0 | && NRChroThreshold == o.NRChroThreshold |
111 | 0 | && expoCorrection == o.expoCorrection |
112 | 0 | && expoCorrectionShift == o.expoCorrectionShift |
113 | 0 | && expoCorrectionHighlight == o.expoCorrectionHighlight |
114 | 0 | ; |
115 | 0 | } |
116 | | |
117 | | void RawDecodingSettings::optimizeTimeLoading() |
118 | 0 | { |
119 | 0 | fixColorsHighlights = false; |
120 | 0 | autoBrightness = true; |
121 | 0 | sixteenBitsImage = true; |
122 | 0 | brightness = 1.0; |
123 | 0 | RAWQuality = BILINEAR; |
124 | 0 | inputColorSpace = NOINPUTCS; |
125 | 0 | outputColorSpace = SRGB; |
126 | 0 | RGBInterpolate4Colors = false; |
127 | 0 | DontStretchPixels = false; |
128 | 0 | unclipColors = 0; |
129 | 0 | whiteBalance = CAMERA; |
130 | 0 | customWhiteBalance = 6500; |
131 | 0 | customWhiteBalanceGreen = 1.0; |
132 | 0 | halfSizeColorImage = true; |
133 | 0 | medianFilterPasses = 0; |
134 | |
|
135 | 0 | enableBlackPoint = false; |
136 | 0 | blackPoint = 0; |
137 | |
|
138 | 0 | enableWhitePoint = false; |
139 | 0 | whitePoint = 0; |
140 | |
|
141 | 0 | NRType = NONR; |
142 | 0 | NRThreshold = 0; |
143 | |
|
144 | 0 | enableCACorrection = false; |
145 | 0 | caMultiplier[0] = 0.0; |
146 | 0 | caMultiplier[1] = 0.0; |
147 | |
|
148 | 0 | inputProfile = QString(); |
149 | 0 | outputProfile = QString(); |
150 | |
|
151 | 0 | deadPixelMap = QString(); |
152 | |
|
153 | 0 | whiteBalanceArea = QRect(); |
154 | | |
155 | | //-- Extended demosaicing settings ---------------------------------------------------------- |
156 | |
|
157 | 0 | dcbIterations = -1; |
158 | 0 | dcbEnhanceFl = false; |
159 | 0 | eeciRefine = false; |
160 | 0 | esMedPasses = 0; |
161 | 0 | NRChroThreshold = 0; |
162 | 0 | expoCorrection = false; |
163 | 0 | expoCorrectionShift = 1.0; |
164 | 0 | expoCorrectionHighlight = 0.0; |
165 | 0 | } |
166 | | |
167 | | QDebug operator<<(QDebug dbg, const RawDecodingSettings& s) |
168 | 0 | { |
169 | 0 | dbg.nospace() << '\n'; |
170 | 0 | dbg.nospace() << "-- RAW DECODING SETTINGS --------------------------------" << '\n'; |
171 | 0 | dbg.nospace() << "-- autoBrightness: " << s.autoBrightness << '\n'; |
172 | 0 | dbg.nospace() << "-- sixteenBitsImage: " << s.sixteenBitsImage << '\n'; |
173 | 0 | dbg.nospace() << "-- brightness: " << s.brightness << '\n'; |
174 | 0 | dbg.nospace() << "-- RAWQuality: " << s.RAWQuality << '\n'; |
175 | 0 | dbg.nospace() << "-- inputColorSpace: " << s.inputColorSpace << '\n'; |
176 | 0 | dbg.nospace() << "-- outputColorSpace: " << s.outputColorSpace << '\n'; |
177 | 0 | dbg.nospace() << "-- RGBInterpolate4Colors: " << s.RGBInterpolate4Colors << '\n'; |
178 | 0 | dbg.nospace() << "-- DontStretchPixels: " << s.DontStretchPixels << '\n'; |
179 | 0 | dbg.nospace() << "-- unclipColors: " << s.unclipColors << '\n'; |
180 | 0 | dbg.nospace() << "-- whiteBalance: " << s.whiteBalance << '\n'; |
181 | 0 | dbg.nospace() << "-- customWhiteBalance: " << s.customWhiteBalance << '\n'; |
182 | 0 | dbg.nospace() << "-- customWhiteBalanceGreen: " << s.customWhiteBalanceGreen << '\n'; |
183 | 0 | dbg.nospace() << "-- halfSizeColorImage: " << s.halfSizeColorImage << '\n'; |
184 | 0 | dbg.nospace() << "-- enableBlackPoint: " << s.enableBlackPoint << '\n'; |
185 | 0 | dbg.nospace() << "-- blackPoint: " << s.blackPoint << '\n'; |
186 | 0 | dbg.nospace() << "-- enableWhitePoint: " << s.enableWhitePoint << '\n'; |
187 | 0 | dbg.nospace() << "-- whitePoint: " << s.whitePoint << '\n'; |
188 | 0 | dbg.nospace() << "-- NoiseReductionType: " << s.NRType << '\n'; |
189 | 0 | dbg.nospace() << "-- NoiseReductionThreshold: " << s.NRThreshold << '\n'; |
190 | 0 | dbg.nospace() << "-- enableCACorrection: " << s.enableCACorrection << '\n'; |
191 | 0 | dbg.nospace() << "-- caMultiplier: " << s.caMultiplier[0] |
192 | 0 | << ", " << s.caMultiplier[1] << '\n'; |
193 | 0 | dbg.nospace() << "-- medianFilterPasses: " << s.medianFilterPasses << '\n'; |
194 | 0 | dbg.nospace() << "-- inputProfile: " << s.inputProfile << '\n'; |
195 | 0 | dbg.nospace() << "-- outputProfile: " << s.outputProfile << '\n'; |
196 | 0 | dbg.nospace() << "-- deadPixelMap: " << s.deadPixelMap << '\n'; |
197 | 0 | dbg.nospace() << "-- whiteBalanceArea: " << s.whiteBalanceArea << '\n'; |
198 | | |
199 | | //-- Extended demosaicing settings ---------------------------------------------------------- |
200 | |
|
201 | 0 | dbg.nospace() << "-- dcbIterations: " << s.dcbIterations << '\n'; |
202 | 0 | dbg.nospace() << "-- dcbEnhanceFl: " << s.dcbEnhanceFl << '\n'; |
203 | 0 | dbg.nospace() << "-- eeciRefine: " << s.eeciRefine << '\n'; |
204 | 0 | dbg.nospace() << "-- esMedPasses: " << s.esMedPasses << '\n'; |
205 | 0 | dbg.nospace() << "-- NRChrominanceThreshold: " << s.NRChroThreshold << '\n'; |
206 | 0 | dbg.nospace() << "-- expoCorrection: " << s.expoCorrection << '\n'; |
207 | 0 | dbg.nospace() << "-- expoCorrectionShift: " << s.expoCorrectionShift << '\n'; |
208 | 0 | dbg.nospace() << "-- expoCorrectionHighlight: " << s.expoCorrectionHighlight << '\n'; |
209 | 0 | dbg.nospace() << "---------------------------------------------------------" << '\n'; |
210 | |
|
211 | 0 | return dbg.space(); |
212 | 0 | } |
213 | | |
214 | | } // namespace KDcrawIface |