Changeset View
Changeset View
Standalone View
Standalone View
imagelib/effects/kpEffectBalance.cpp
Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | 161 | { | |||
---|---|---|---|---|---|
166 | const quint8 blue = static_cast<quint8> (qBlue (rgb)); | 166 | const quint8 blue = static_cast<quint8> (qBlue (rgb)); | ||
167 | const quint8 alpha = static_cast<quint8> (qAlpha (rgb)); | 167 | const quint8 alpha = static_cast<quint8> (qAlpha (rgb)); | ||
168 | 168 | | |||
169 | qimage.setPixel (x, y, | 169 | qimage.setPixel (x, y, | ||
170 | qRgba (transformRed [red], | 170 | qRgba (transformRed [red], | ||
171 | transformGreen [green], | 171 | transformGreen [green], | ||
172 | transformBlue [blue], | 172 | transformBlue [blue], | ||
173 | alpha)); | 173 | alpha)); | ||
174 | | ||||
175 | #if 0 | | |||
176 | qimage.setPixel (x, y, | | |||
177 | brightnessContrastGammaForRGB (qimage.pixel (x, y), | | |||
178 | channels, | | |||
179 | brightness, contrast, gamma)); | | |||
180 | #endif | | |||
181 | } | 174 | } | ||
182 | } | 175 | } | ||
183 | } | 176 | } | ||
184 | else | 177 | else | ||
185 | { | 178 | { | ||
186 | for (int i = 0; i < qimage.colorCount (); i++) | 179 | for (int i = 0; i < qimage.colorCount (); i++) | ||
187 | { | 180 | { | ||
188 | const QRgb rgb = qimage.color (i); | 181 | const QRgb rgb = qimage.color (i); | ||
189 | 182 | | |||
190 | const quint8 red = static_cast<quint8> (qRed (rgb)); | 183 | const quint8 red = static_cast<quint8> (qRed (rgb)); | ||
191 | const quint8 green = static_cast<quint8> (qGreen (rgb)); | 184 | const quint8 green = static_cast<quint8> (qGreen (rgb)); | ||
192 | const quint8 blue = static_cast<quint8> (qBlue (rgb)); | 185 | const quint8 blue = static_cast<quint8> (qBlue (rgb)); | ||
193 | const quint8 alpha = static_cast<quint8> (qAlpha (rgb)); | 186 | const quint8 alpha = static_cast<quint8> (qAlpha (rgb)); | ||
194 | 187 | | |||
195 | qimage.setColor (i, | 188 | qimage.setColor (i, | ||
196 | qRgba (transformRed [red], | 189 | qRgba (transformRed [red], | ||
197 | transformGreen [green], | 190 | transformGreen [green], | ||
198 | transformBlue [blue], | 191 | transformBlue [blue], | ||
199 | alpha)); | 192 | alpha)); | ||
200 | | ||||
201 | #if 0 | | |||
202 | qimage.setColor (i, | | |||
203 | brightnessContrastGammaForRGB (qimage.color (i), | | |||
204 | channels, | | |||
205 | brightness, contrast, gamma)); | | |||
206 | #endif | | |||
207 | } | 193 | } | ||
208 | 194 | | |||
209 | } | 195 | } | ||
210 | 196 | | |||
211 | return qimage; | 197 | return qimage; | ||
212 | } | 198 | } | ||
213 | 199 | |